Repository navigation
fix(agents): run non-OpenAI turns as Standard when Daybreak is saved - #193775
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR applies Standard Access to non-OpenAI turns while retaining saved Daybreak choices and notifying direct chats once. Example: A chat has daybreak_blue saved and switches to claude-cli/opus.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current-main failure, resolves the previous silent-notice finding, and has no remaining concrete code finding. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAgent command and reply runners resolve each model candidate before dispatch; the shared Access resolver projects the saved selection into turn settings, and reply finalization presents notices. flowchart TD
A[Saved session Access] --> B[Candidate provider and model]
B --> C[Shared Access resolver]
C --> D[CLI or embedded dispatch]
D --> E[Provider response]
E --> F[Reply finalization]
F --> G[Direct chat notice and reply]
Technical reviewBest possible solution: Apply Access per candidate through the shared resolver, preserve saved choices, and retain existing OpenAI authorization and direct-chat notice boundaries. Do we have a high-confidence way to reproduce the issue? Current-main guards reproduce the reported rejection directly from saved Blue or Red plus a non-OpenAI candidate; the author reports matching Gateway failures and red-on-base tests, but this review executed no target code. Is this the best way to solve the issue? The repair addresses provider applicability at each execution boundary using one shared policy, preserves the intentional saved-choice contract, and adds no competing persisted owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 57ab01eab302. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +183, Tests +56, Docs +7. Total +246 across 13 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 5, 2026, 6:44 PM ET / 23:44 UTC (Revision 2). |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
…penclaw#193775) * fix(agents): run non-OpenAI turns as Standard when Daybreak is saved * test: compact Daybreak Access regression tests * fix(auto-reply): keep Access notice claim for a visible reply * test: fold Daybreak CLI cases into the existing Access table --------- Co-authored-by: VACInc <[email protected]>
…penclaw#193775) (cherry picked from commit 8662f3b) Release adaptation: Provider normalization only: saved Daybreak remains unchanged, non-OpenAI turns use Standard; OpenAI/Codex retain entitlement and unsupported-runtime errors. Four runtime owner/consumer files and focused tests. Excludes notice caches, UI/reply embellishments and docs. Original co-author: VACInc <[email protected]>. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 140e4ae9cdfb23ab8325a6ea41e56f93099a5bb3)
Summary
High Level TLDR
A chat that once had Daybreak Blue saved kept failing every turn after its model moved to a non-OpenAI model. Daybreak is an OpenAI program, so this PR makes any non-OpenAI turn run as Standard, shows the chat a one-time notice, and keeps the saved choice for when the chat returns to an OpenAI model. OpenAI models keep their existing explicit errors.
Root Cause
The saved session Access choice (
cyberAccessProgram) is intentionally kept across/new, resets, forks, child spawns, and model changes (#184930, #185039). Nothing applies it per provider when the turn actually runs, so three execution sites rejected any non-Standard choice regardless of the model:src/auto-reply/reply/agent-runner-cli-candidate.ts:Daybreak access is unsupported by this CLI runtime...for every chat CLI candidate, including Claude CLI.src/agents/command/attempt-execution.ts: the same error foragent-command CLI turns.src/agents/embedded-agent-runner/run/attempt-stream-settle.ts:Daybreak access is unsupported by this provider...for every non-OpenAI embedded turn.Observed before behavior (redacted): a main chat had
cyberAccessProgram: "daybreak_blue"saved with a user model overrideopenai/gpt-5.6-solon the native Codex runtime. Two pre-migration state snapshots taken by Doctor on two different days show that exact row. Later the override was cleared, so the chat followed the agent defaultanthropic/claude-opus-5-5on the Claude CLI runtime. The saved Blue choice stayed. Every chat and voice turn then failed before reply withEmbedded agent failed before reply: Daybreak access is unsupported by this CLI runtime. Select Standard or use the OpenClaw or native Codex runtime.(3 failures in the Gateway log). Setting the session back to Standard fixed it right away, which confirms the stale saved choice was the only cause.The same thing happens on any path that changes the effective model while the saved choice stays:
/modelorsessions.patchmodel changes and resets, configured fallbacks, live model switches, Doctor model repairs, reset preservation, and parent-to-child inheritance.Change
resolveCyberAccessProgramForProviderinsrc/agents/model-catalog-access-programs.ts. Daybreak applies to OpenAI provider ids (openaiplus the Codex idsopenai-codex,codex,codex-cli). Any other provider getsstandardfor that turn, plus anotAppliedmarker. Undefined and Standard pass through unchanged.run-attempt-dispatch.ts, the point every embedded candidate passes through, including fallbacks, live switches, cron, voice, and the native harness) use it per candidate provider. A non-OpenAI turn therefore never carries Daybreak and never fails because of it.agent-runner-result-payloads.ts) add one notice per chat, program, and model, using the existing notice payload. Direct chats only, like fallback notices. Intentionally silent finals do not use up the notice. Non-chat command and cron turns log once instead.Scope boundary
Real behavior proof
See Verification. Live Gateway proof on the fix head is listed under What was not tested.
What was not tested
Verification
Fix commit
4e37d59cbc7plus test compaction65f9efb9faa(test-lines budget; no assertion removed) andc43ed7e5b48(ClawSweeper P3: an intentionally silent final no longer uses up the one-time notice; the reply case runs a silent turn first and fails without this change), andf3e4ab59d0f(CI test-lines ceiling: the Claude CLI cases now share the existing Codex CLI Access table; the notice text stays covered by the reply case) on main6e7ee204e1b. Commands run withenv -u ANTHROPIC_API_KEY -u OPENAI_API_KEY.Red on base (production files reverted, new tests kept):
The new reply notice case cannot pass on base, because base has no notice code.
Green on the fix head:
The existing Codex CLI case (
allows only Standard Access for a chat CLI turn) still rejects Blue and Red forcodex-cli, so OpenAI models keep the explicit error.pnpm tsgo:core,pnpm tsgo:test:src,oxlint,oxfmt --check, andpnpm check:line-cap-ratchetall pass.