Repository navigation
fix: restore Daybreak options for OpenAI API keys - #184451
Conversation
Co-authored-by: VACInc <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Co-authored-by: VACInc <[email protected]>
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRestores advertised Daybreak programs for OpenAI API keys and fixes sharing-scope retirement when a session is replaced. Example: A configured OpenAI API key advertises Daybreak Blue for gpt-6.1-sol.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes missing API-key Daybreak options and preserves the merged OAuth-refresh repair; no actionable introduced defect was found. Current-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherAuthenticated provider discovery supplies account-scoped capabilities to model listings and the chat picker; execution rechecks the selected credential, route, and runtime before submitting the program. flowchart TD
A[Configured key or selected account] --> B[Authenticated model discovery]
B --> C[Current runtime catalog]
C --> D[Gateway model listing]
D --> E[Chat Access selection]
E --> F[Execution authority guard]
C --> F
F --> G[Responses or Codex turn submission]
Technical reviewBest possible solution: Land the existing-owner repairs after the exact-head required checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source excludes direct credentials from Access projection and execution; supplied red/green discovery and visibility results corroborate that path, without this review executing target code. Is this the best way to solve the issue? The change repairs existing credential, catalog, and execution owners while preserving selected-account precedence, route isolation, and final-request freshness checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c833796fa6d6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +54, Tests +460, Docs -1. Total +513 across 19 files. Added test files: 0. View PR surface stats
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 (5 earlier review cycles)
Reviewed October 26, 2026, 7:04 AM ET / 11:04 UTC (Revision 6). |
Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Retire the captured mutation scope when the row owner reports retirement, even if the canonical list already projected the successor and no old row remains to remove. Cover event-first and canonical-list-first ordering without relaxing assertions or timeouts. Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Resolve the access-program guard conflict while keeping configured-key discovery and upstream provider-owned OAuth account identity checks. Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
* fix: restore Daybreak options for OpenAI API keys Co-authored-by: VACInc <[email protected]> * test: qualify Daybreak API-key and subscription flows Co-authored-by: VACInc <[email protected]> * test: prove Daybreak credential isolation at dispatch Co-authored-by: VACInc <[email protected]> * test: await mobile sharing fixture readiness Reuse the focused synchronization repair from openclaw#184346 (79ccd0b) after the same UI CI failure. Preserve all assertions and timeouts. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: VACInc <[email protected]> * fix(ui): retire sharing scope after session list replacement Retire the captured mutation scope when the row owner reports retirement, even if the canonical list already projected the successor and no old row remains to remove. Cover event-first and canonical-list-first ordering without relaxing assertions or timeouts. Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
Merge pinned official main 02e6a79 to incorporate the named checks-ui prerequisite from #184451. Preserve the reviewed notice patch byte-for-byte; no authored conflict resolution. Co-authored-by: vincentkoc <[email protected]>
Related: #177812
What Problem This Solves
Fixes missing Daybreak Access options when OpenAI uses a configured API key or API-key authentication in the Codex runtime.
User Impact
Eligible accounts can select their advertised Daybreak programs without switching authentication methods. Saved-account selections still take precedence over provider defaults. Unknown, revoked, or other-account grants remain unavailable; custom endpoints do not inherit OpenAI grants.
Why This Change Was Made
Discovery selected a saved profile ahead of an explicitly configured key, while Access projection and embedded execution rejected direct credentials. Native Codex also retained a ChatGPT-only restriction despite the bundled 0.164.0 client supporting API-key programs.
The fix uses the existing discovery, selected-account, and runtime owners. It adds no cache, configuration option, or persistence schema. Explicit account discovery keeps its credential lock and the original request configuration.
Evidence
Final qualification
Head
71d8dfe02df61716d9cfccf20ebc03fa60eab501is conflict-free. CI run 40311562574 completed successfully with all 70 jobs settled and no failures. ClawSweeper's exact-head review has no findings or before-merge items. VACInc merged the qualified head on 2026-10-26 at 11:20 UTC as02e6a799b59a189bb9e07e297e033ac88bd8a7ae. Deployment is separate and was not performed by this task.OAuth-refresh conflict resolution
Integrated
mainat32db508cbd27482c30ca377d1e829f33f24411e8in merge commit71d8dfe02df61716d9cfccf20ebc03fa60eab501, preserving #184364. The shared Access guard now retains both configured-key discovery and the upstream provider-owned same-account check across OAuth refresh. No history was rewritten.Both affected guard suites pass: 34 tests, including same-account refresh, foreign-account rejection, configured-key grants, and final-dispatch revocation. Core typecheck, targeted lint/format, whitespace checks, and independent P0–P2 review passed on the integrated candidate. Prior browser and upgrade evidence below remains prior-head proof; current-head hosted CI passed and ClawSweeper reported no findings or before-merge items.
CI-discovered sharing lifetime race
Two successive runs failed
checks-ui (2/3)onkeeps sharing busy through refresh and retires it for a same-key successor, while the Daybreak browser lane passed. The first failure did not identify its assertion. Focused replay, 20 repetitions, the six observed predecessor files, and two-core/three-worker execution passed locally; those passes were not treated as a fix.The same failure was independently observed in Peter Steinberger's PR #184346. We first reused only its reviewed fixture synchronization from
79ccd0b5cefe91be14ed4db3891dbb96fcdc654f: await pane DOM commit and actual lazy mutation RPC admission. Peter is credited. The added assertion messages then identified the remaining failure in run 40308706575: the successor failed to retire the previous sharing scope. Fixture synchronization alone did not fix that bug.A deterministic production-path regression now publishes the successor through the canonical session list before delivering the change event. This fails against
6e21487with the same successor-retirement assertion. The existing row-observation owner was returning early when the canonical list had already projected the successor, because no predecessor row remained to remove; that accidentally skipped retiring the old mutation scope.The production fix moves the existing retirement call before those projection-cleanup early returns. Active scoped observation callbacks still exclude unresolved and stale bindings. No new state owner, cache, timeout, or permission is introduced. The regression retains every busy-through-refresh and stale-completion assertion, and covers both event-first and canonical-list-first arrival.
The reproduction passes with the fix. All 56 tests across the sharing component, sharing authority, and session-event suites passed in 6.44 seconds. UI production/test typechecks, targeted lint/format, and independent P0–P2 review passed. Hosted CI on the final integrated head passed, including the previously failing UI lane; no failed job was blindly rerun.
Final-dispatch authority proof
The committed
ui/src/e2e/chat-daybreak.real-gateway.e2e.test.tsuses real session creation,sessions.patch,models.list,config.patch, the paired Control UI'schat.send,agent.wait, and persistedchat.history. An external synthetic HTTP server records the actual target-model Responses requests. No internal admission decision is mocked.access_programs.cyber=daybreak_bluenot advertised for the current accountbefore_agent_run; replace with key B and refresh before releasingprepared model runtime publication was supersededBoth negative runs reached terminal error. The late case asserts the preparation barrier was reached before replacement and that no target request crossed it. The existing runtime owner retires the old prepared credential before transport; its earlier rejection is intentionally asserted rather than mislabeled as an Access error. The independent captured-Access-guard test still checks freshness immediately before request use.
The temporary test plugin explicitly opts into conversation access. Its loopback pause request uses the same isolated Undici dispatcher as the external provider fixture. Earlier fixture attempts exposed a missing hook opt-in and a closed global HTTP pool; both were corrected without changing production guards or weakening the zero-request assertion.
Stable-to-head data compatibility
An isolated install of the official npm
[email protected]package (157d8c2) produced and read back:The candidate opened that same isolated state through the supported Doctor migration. The inherited agent database upgraded from v25 to v37; no schema change is introduced by this PR. Doctor completed with exit 0 after the build was settled. Candidate SDK readers independently resolved the configured key and the pinned saved key, preserved the session ID, model/provider overrides and user pin, then persisted Daybreak Blue and read it back in a new process. A final read after successful Doctor completion preserved all of those values.
The stable baseline predates this Access feature, so the Access field was set only after upgrade; no claim is made that stable could write it. The initial Doctor attempt overlapped a runtime rebuild and encountered missing generated modules; its migration and state readbacks were retained, then the supported command completed successfully against the settled build. All credentials and session content in this probe are synthetic.
Focused proof timing and reproduction
Selected-account regressions: 58 tests, 56.53 seconds including compilation. Native catalog: 15 tests, 49.89 seconds including compilation. Native process regression: 1 test, 77.71 seconds including compilation.
Final browser suite: 3/3 passed, 55.31 seconds wall time. Configured-key flow: 7.529 seconds; final-dispatch authority: 7.473 seconds; subscription desktop/mobile queue flow: 30.068 seconds. The suite shares one Gateway; the longer queue scenario proves real persisted preference changes across two active queued turns and both viewport sizes.
After building the candidate, reproduce with:
The suite retains sanitized
proof.jsonwith per-case rejection, selected/foreign capabilities and physical request counts. Gateway diagnostics are retained separately as private logs.Visual evidence
Before: synthetic reproduction of the missing-capability response observed on Team; Access is absent.
After: the isolated built Gateway discovers the configured key's Blue grant and the real UI exposes it.