Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
A session using openai/gpt-5.5 with a valid OpenAI Codex OAuth profile fails during compaction with:
Missing API key for OpenAI on the gateway. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API-key runs.
This is not limited to Slack. It appears to happen whenever compaction is triggered. The agent works normally before compaction, and openclaw models status reports Codex OAuth as usable.
The failure path appears to be:
- Session reaches the compaction threshold.
- Codex-native/app-server compaction cannot use the existing thread/session binding.
- OpenClaw falls back to a context-engine/direct provider path.
- That fallback path tries to use the direct OpenAI provider.
- Since the installation is intentionally using Codex OAuth and has no
OPENAI_API_KEY, compaction fails and the user receives the missing API key warning.
Steps to reproduce
-
Start OpenClaw 2026.5.22 with OpenAI Codex OAuth configured.
-
Configure an agent with model openai/gpt-5.5.
-
Do not set OPENAI_API_KEY; use Codex OAuth only.
-
Confirm the agent auth is usable:
openclaw models status --agent <agent-id>
The output shows:
Runtime auth
openai via codex uses openai-codex ... status=usable
-
Use the agent until the session reaches the compaction threshold, or otherwise trigger budget-based compaction.
-
Observe that compaction fails and the user-visible response becomes:
⚠️ Missing API key for OpenAI on the gateway. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API-key runs.
-
Check gateway logs.
Expected behavior
Compacted without errors.
Actual behavior
When compaction is triggered, the session fails with a missing OPENAI_API_KEY warning, even though the active model is openai/gpt-5.5 and Codex OAuth auth is usable.
Observed gateway log:
[agent/embedded] codex app-server compaction could not use thread binding
[agent/embedded] native harness compaction could not use its session binding; falling back to context engine: no codex app-server thread binding
[agent/embedded] [compaction-diag] end runId=2a6dbce3-8204-4ce4-817d-ca3b533d600d sessionKey=agent:jenny:slack:channel:c0b1fnbny5p diagId=cmp-mpkmesl7-485csw trigger=budget provider=openai/gpt-5.5 attempt=1 maxAttempts=1 outcome=failed reason=unknown detail=No_API_key_found_for_provider_openai_._You_are_authenticated_with_OpenAI_Codex_OAuth_OpenAI_agent_mo durationMs=6739
⚠️ Missing API key for OpenAI on the gateway. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API-key runs.
### OpenClaw version
2026.5.22 (a374c3a)
### Operating system
Ubuntu 24.04.4
### Install method
npm / pnpm package-manager install, not git checkout
### Model
openai/gpt-5.5
### Provider / routing chain
OpenClaw -> OpenAI Codex OAuth -> openai/gpt-5.5
### Additional provider/model setup details
_No response_
### Logs, screenshots, and evidence
```shell
Impact and severity
No response
Additional information
No response
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
A session using
openai/gpt-5.5with a valid OpenAI Codex OAuth profile fails during compaction with:Missing API key for OpenAI on the gateway. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API-key runs.This is not limited to Slack. It appears to happen whenever compaction is triggered. The agent works normally before compaction, and
openclaw models statusreports Codex OAuth as usable.The failure path appears to be:
OPENAI_API_KEY, compaction fails and the user receives the missing API key warning.Steps to reproduce
Start OpenClaw 2026.5.22 with OpenAI Codex OAuth configured.
Configure an agent with model
openai/gpt-5.5.Do not set
OPENAI_API_KEY; use Codex OAuth only.Confirm the agent auth is usable:
openclaw models status --agent <agent-id>The output shows:
Runtime authopenai via codex uses openai-codex ... status=usableUse the agent until the session reaches the compaction threshold, or otherwise trigger budget-based compaction.
Observe that compaction fails and the user-visible response becomes:
⚠️ Missing API key for OpenAI on the gateway. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API-key runs.Check gateway logs.
Expected behavior
Compacted without errors.
Actual behavior
When compaction is triggered, the session fails with a missing
OPENAI_API_KEYwarning, even though the active model isopenai/gpt-5.5and Codex OAuth auth is usable.Observed gateway log:
Impact and severity
No response
Additional information
No response