Skip to content

fix(agents): run non-OpenAI turns as Standard when Daybreak is saved - #193775

Merged
VACInc merged 4 commits into
openclaw:mainfrom
VACInc:fix/daybreak-non-openai-standard
Nov 6, 2026
Merged

VACInc merged 4 commits into
openclaw:mainfrom
VACInc:fix/daybreak-non-openai-standard

Conversation

@VACInc

@VACInc VACInc commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

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 for agent-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 override openai/gpt-5.6-sol on 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 default anthropic/claude-opus-5-5 on the Claude CLI runtime. The saved Blue choice stayed. Every chat and voice turn then failed before reply with Embedded 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: /model or sessions.patch model changes and resets, configured fallbacks, live model switches, Doctor model repairs, reset preservation, and parent-to-child inheritance.

Change

  • New owner resolveCyberAccessProgramForProvider in src/agents/model-catalog-access-programs.ts. Daybreak applies to OpenAI provider ids (openai plus the Codex ids openai-codex, codex, codex-cli). Any other provider gets standard for that turn, plus a notApplied marker. Undefined and Standard pass through unchanged.
  • The two CLI sites and the embedded attempt dispatch (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.
  • Chat replies (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.
  • The saved session choice is not rewritten. Switching back to an OpenAI model restores exactly what the user picked, and Standard never escalates.

Scope boundary

  • OpenAI models are unchanged: wrong runtime, unadvertised program, or a missing role grant still fail visibly, as documented.
  • No schema, migration, config, or protocol change. The notice dedupe is in memory (bounded), so after a Gateway restart the notice can appear once more.

Real behavior proof

See Verification. Live Gateway proof on the fix head is listed under What was not tested.

What was not tested

  • No isolated-Gateway end-to-end run with a real Claude CLI turn on this head. Proof is at the owning boundaries: the chat CLI candidate, the command CLI attempt, embedded dispatch, and the chat reply payload.
  • The Control UI Access picker still shows the saved Blue choice while a non-OpenAI model is selected. That display is unchanged.

Verification

Fix commit 4e37d59cbc7 plus test compaction 65f9efb9faa (test-lines budget; no assertion removed) and c43ed7e5b48 (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), and f3e4ab59d0f (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 main 6e7ee204e1b. Commands run with env -u ANTHROPIC_API_KEY -u OPENAI_API_KEY.

Red on base (production files reverted, new tests kept):

pnpm test src/agents/embedded-agent-runner/run/run-attempt-dispatch.owner.test.ts ...
 × dispatches the generic harness ... access daybreak_blue ...          (fixture provider got daybreak_blue, expected standard)
 × runs a non-OpenAI chat CLI turn as Standard with a saved daybreak_blue choice   (now: gates Access for a claude-cli/opus chat CLI turn)
 × runs a non-OpenAI chat CLI turn as Standard with a saved daybreak_red choice
 × runs a non-OpenAI CLI turn as Standard when a saved Daybreak choice is set
 × runs a non-OpenAI CLI turn as Standard when a run-scoped Daybreak choice is set

The new reply notice case cannot pass on base, because base has no notice code.

Green on the fix head:

pnpm test src/agents/model-catalog-access-programs.test.ts src/agents/command/attempt-execution.harness.test.ts \
  src/auto-reply/reply/agent-runner-execution-runtime.test.ts \
  src/agents/embedded-agent-runner/run/run-attempt-dispatch.owner.test.ts \
  src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts
[test] passed 4 Vitest shards (43 + 6 + 9 + 201 tests; access unit file now 11 tests after table-driven compaction)

The existing Codex CLI case (allows only Standard Access for a chat CLI turn) still rejects Blue and Red for codex-cli, so OpenAI models keep the explicit error. pnpm tsgo:core, pnpm tsgo:test:src, oxlint, oxfmt --check, and pnpm check:line-cap-ratchet all pass.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@VACInc

VACInc commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Nov 5, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Every turn fails because the CLI runtime rejects Daybreak.
  • After: The turn runs with Standard Access, a visible reply includes a one-time notice, and the saved Blue choice remains available for OpenAI.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with the prior finding resolved; supplied runtime evidence remains limited to mock-backed owner tests, and exact-head CI is pending.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Chats stop answering after a model change leaves an OpenAI-only Daybreak choice saved on a non-OpenAI runtime.
Reason: The maintainer-authored direction resolves a reported operational failure while retaining explicit OpenAI errors and saved preferences.

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
Reviewed head: c43ed7e5b484be35f80e8bf5cac72ed5aef13ba9

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped-entry-point run demonstrates a saved-Blue chat completing a Claude turn, presenting the notice, and retaining its choice when returning to OpenAI, including an existing session after upgrade.
Agent review details

How this fits together

Agent 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]
Loading

Technical review

Best 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

  • CLI Access rejection changes intended behavior with a stated reason (ad9b7ae: Explicit Access choices were preserved and unsupported CLI execution rejected rather than silently changing OpenAI Access.)
  • Embedded Access forwarding changes intended behavior with a stated reason (ee584a7: Turn-scoped Access replaced retiring model aliases while preserving explicit selections and account checks.)
  • Saved selections and configured defaults keeps the original intent (3e1eff7: Session selections and authenticated preferences must survive reopening and model-default changes.)
  • Routing-notice audience keeps the original intent (7d05f7c: Routing details must stay out of group and channel replies while direct-chat notices remain visible.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vito Cappello: Raw commit 94390ec adds docs/providers/openai/models.md:123 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 94390ecb6b3d; files: docs/providers/openai/models.md)
  • Vyctor H. Brzezowski: Raw commit 3e1eff7 adds src/agents/model-catalog-access-programs.ts:101 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3e1eff7f703c; files: src/agents/model-catalog-access-programs.ts)
  • RoboClaw: Raw commit ad9b7ae adds docs/providers/openai/models.md:127 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ad9b7aec3fa6; files: docs/providers/openai/models.md)

PR surface

Source +183, Tests +56, Docs +7. Total +246 across 13 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 189 6 +183
Tests 4 72 16 +56
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 268 22 +246

Preflight source

Source 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

Metric Value Why it matters
Production versus test changes Production +124/-6; tests +137/-16 Production growth supplies shared provider policy and bounded notices; tests cover separate execution boundaries and silent-first reply behavior.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: A retained Daybreak choice can prevent every chat or voice reply after switching to a non-OpenAI runtime.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-05T22:58:18.471Z sha 4e37d59 :: needs changes before merge. :: [P3] Preserve the notice claim across intentionally silent turns

Reviewed November 5, 2026, 6:44 PM ET / 23:44 UTC (Revision 2).

@VACInc

VACInc commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@VACInc
VACInc merged commit 8662f3b into openclaw:main Nov 6, 2026
127 of 128 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…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]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant