Use native Codex side threads and OpenAI auth fallback#80493
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. at source level, not live in this review. Current main routes Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the Codex-native Do we have a high-confidence way to reproduce the issue? Yes at source level, not live in this review. Current main routes Is this the best way to solve the issue? Mostly yes. Moving Codex Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c2a13e292f98. |
1be72ce to
532e4c7
Compare
|
@clawsweeper review |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@clawsweeper review |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3b0d2fb to
2115d85
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
6248533 to
803c973
Compare
10202aa to
da472e0
Compare
|
Landed via GitHub rebase merge onto main. Proof:
Thanks @pashpashpash! |
OpenClaw already treats
/sideas an alias for/btw, but the implementation was still a generic one-shot provider call. That was fine for API-key providers, but it is the wrong transport onceopenai/gpt-5.5is running through the Codex harness with a Codex OAuth profile: the side question falls through to plain OpenAI Responses auth, where the token can fail with missingapi.responses.writescopes.This change adds a small optional side-question hook to agent harnesses and implements it for the Codex app-server harness. When
/btwor/sideis routed to Codex, OpenClaw now forks the bound Codex thread as an ephemeral side thread, injects a side-conversation boundary, starts the side turn there, returns the answer as the existingchat.side_resultpayload, and unsubscribes afterward. The Codex path stays native for auth and thread context, but it preserves the existing/btwcontract: the side turn is tool-free, read-only, and outside the parent transcript. PI and non-Codex providers keep the existing direct lightweight path.If there is no Codex parent thread yet, OpenClaw now fails clearly and asks the user to send a normal message first instead of silently trying public OpenAI auth.
While touching the same routing area, this also makes OpenAI/Codex auth ordering less weird. New config can put Codex-compatible OAuth and API-key profiles under
auth.order.openai, while existingopenai-codex:*profiles andauth.order.openai-codexkeep working. That gives users the obvious subscription-first, API-key-backup shape without forcing a migration.The account command now explains that setup in the terms users actually care about. If the ChatGPT subscription is active,
/codex accountsays Codex is running on the subscription, shows the readable subscription usage windows, and lists the configured backup. If the subscription is paused and OpenClaw has moved to an API key, it says the API-key backup is active, why the subscription was skipped, when OpenClaw will try it again, and shows the full ordered ladder without raw bucket names,primary/secondary, oropenai-codexnaming.Fixes #80469.