Skip to content

fix(ui): preserve Daybreak choices across chats - #185039

Merged
vyctorbrzezowski merged 7 commits into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/access-inherited-state
Oct 26, 2026
Merged

vyctorbrzezowski merged 7 commits into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/access-inherited-state

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes lost Access choices when creating or reopening a chat, including drafts that use configured model defaults.

User Impact

Daybreak has a toggle with the Blue and Red choices available to the selected account. Turning it off selects Standard; turning it back on restores the last permitted Daybreak choice. A first submission without a previous choice or configured default explicitly uses Standard, including existing conversations whose Access setting has never been saved.

Why This Change Was Made

The session keeps its own Access selection. Authenticated user preferences remember the latest choice and the last Daybreak choice for each agent, independently of model-default policy. Changing effort before preferences finish loading preserves the saved Access choice. The model catalog and runtime request preparation share the same configured Access or Standard baseline, separately from account entitlements. Unknown entitlement metadata is not treated as a confirmed loss of access and does not prevent returning to Standard. Explicit empty Access configuration retains its existing inheritance behavior. Shared browser preferences do not transfer Access choices between people.

The existing preference owner and codecs use shared boot assets, without importing New Session setup or catalog UI into chat startup. The control uses the shared disclosure motion and keeps the menu anchored while expanding upward. Its additional height applies only when Access is present. The shared disclosure-motion module matches #184466 so both controls use one motion definition.

Evidence

  • After integrating the landed composer controls, all 31 tests across the attachment menu, media picker, pointer activation and prompt-attachment suites pass. The tests retain safe-area, activation, focus, growth and overflow checks without fixing obsolete labels or scrollbar styling.

  • Updated branch 72dcf32 passes 49 focused UI tests, 12 affected browser E2E cases, six extra-parameter tests, the affected test typechecks, core and Control UI typechecks, changed-file lint/format, and the production Control UI build. The existing typing test reproduces three unnecessary model-control preparations before the repair and none afterward.

  • E2E repairs exercise the approved Daybreak switch and preserve entitlement, revocation, selection and authenticated-preference assertions. They advertise the session mutation method and retain the actual created session across a mock-page reload. No new tests were added.

  • Review confirmed that unsent draft recovery is isolated by the authenticated Gateway recovery scope and route. It does not write Access into shared browser-origin preferences; accepted submission retires the draft selection.

  • The OpenAI route and Access catalog suites passed all 14 cases after updating the expected known default while preserving strict omission checks for unobserved route metadata.

  • All 33 tests across the five Access catalog, extra-parameter, runtime-plan, Gateway model-list, and prompt-prefix-stability files passed on macOS arm64 at 9f3642a using the repository's serial test wrapper.

  • pnpm ui:check-performance:base 3cd359a passed on macOS arm64 for 9f3642a, with all existing budgets unchanged: chat loads 20 JavaScript and 3 CSS assets, with 1,241,589 bytes of compressed JavaScript (limit: 1,274,861). Startup stays at 5 JavaScript/1 CSS assets; new-session stays at 17 JavaScript/3 CSS assets.

  • 124 focused preference, migration, submission, catalog, model-control, and chat tests passed. The static dependency graph no longer reaches the New Session setup or route-controls packages through the preference owner.

  • Seven Chromium tests passed, including remembered Daybreak choices and recovery when entitlement metadata is absent.

  • The application against a mocked Gateway sent Standard on first creation, saved Red from the chat, retained Red after reload, restored it in a new draft and sent Red on the next creation. The menu bottom remained fixed during expansion.

  • A real HTTP request through the runtime plan, provider wrapper and SDK used a local synthetic endpoint. The previous resolver omitted access_programs; the fix sent Standard with no selection, preserved configured Blue and explicit Red, and preserved explicit Standard over configured Blue.

  • A direct runtime-plan probe passed for both runtime routes. Native parameter projection was checked separately; the native runtime itself was not executed.

Risk and coverage

CI run40403374751 completed: all E2E, type and security jobs passed; the only failed job is the unchanged Codex diagnostic expectation described below. The prior run also exposed an inherited Codex containment-diagnostic expectation: #184901 added a model-visible recovery hint, while its unchanged test still expects the old complete string. That unrelated implementation and test are not modified here. A full local build currently stops in unchanged llm-core declaration generation: Promise.withResolvers is compiled with an ES2023 library target. Its source, build configuration and lockfile match the parent; this repair does not change them. The HTTP proof used a synthetic endpoint; no native runtime binary or live provider account was exercised.

Visual validation

Before and after use the same content, theme, viewport, and state.

Daybreak selection — comparison 1

Daybreak selection — comparison 2

Daybreak selection — comparison 3

Daybreak selection — comparison 4

Expand, select, collapse, and restore Daybreak

daybreak-expansion-final.mp4

Supersedes #184785, which GitHub closed when its stacked base branch was merged and deleted. The integrated branch could not reopen the closed PR.

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 26, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR remembers authenticated users’ Daybreak choices across chats and aligns displayed Access defaults with runtime requests.

Example: An authenticated user selects Daybreak Red for agent main, reloads, and starts another chat.

  • Before: The new chat does not restore the saved Access choice.
  • After: The new draft restores Daybreak Red and includes it in sessions.create.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-directed repair with inspected visual evidence, but two source-confirmed regressions remain and stored-state upgrade compatibility is unproven.
Proof confidence 🐚 platinum hermit (4/6) Maintainer authorship exempts ordinary contributor proof: inspected screenshots demonstrate the changed Control UI, while the body reports preference round trips against a mocked Gateway and physical HTTP requests through runtime preparation; video playback returned Cache miss.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users lose their Access choice when starting another chat, including drafts using configured model defaults.
Reason: The persistence gap is source-backed, and maintainer authorship establishes direction for the toggle and Standard baseline.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: it fixes a concrete preference-persistence gap, but native forwarding and saved-Access recovery regressions block merge.

Priority: P2
Reviewed head: 72dcf320f69134f0d0b0776f14a4f3c1462f7da1

Before merge

  • Preserve native sessions with Access forwarding disabled (P1) - For an OpenAI API-key Codex session with features.api_key_cyber_access_programs=false and no saved or configured Access selection, this resolver manufactures Standard. Runtime-plan preparation injects it into accessPrograms, and the bundled adapter forwards it as turn/start.cyberAccessProgram. The inspected native for_auth implementation rejects every explicit program under that setting, including Standard; its app-server regression confirms omission succeeds while explicit Standard fails. Respect the native forwarding policy when deriving the automatic baseline so existing ordinary turns continue to work.
  • Allow saved Access recovery without a resolvable model (P2) - With a connected, writable chat holding cyberAccessProgram=daybreak_red and a ready but empty or entirely unavailable model catalog, hasResolvableModel is false. This condition disables the replacement Daybreak toggle even though the patch keeps its menu visible and removes the separate Clear saved Access action. The user can no longer return the saved selection to Standard until model availability recovers. Preserve catalog-independent recovery for an existing selection while retaining the existing mutation-permission checks.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Preserve native sessions with Access forwarding disabled — src/agents/model-catalog-access-programs.ts:101-109
  • [P2] Allow saved Access recovery without a resolvable model — ui/src/pages/chat/components/chat-model-controls.tsx:569-570

Provenance

  • Runtime Access baseline: original intent not found (unknown: Scoped git log -S searches found no earlier Access-baseline decision in runtime-plan/build.ts or model-extra-params.ts.)

Tests

  • Missing end-to-end proof: Provide a latest-stable upgrade run preserving existing preferences, unsent drafts, session overrides, and explicit native forwarding settings while exercising the changed Access defaults.
Agent review details

How this fits together

Control UI preferences supply draft and session selections; model catalogs describe defaults and entitlements, and runtime plans prepare provider or native-runtime requests.

flowchart LR
  A[Chat controls] --> B[Authenticated preference owner]
  B --> C[New Session draft]
  D[Model catalog] --> C
  C --> E[Session settings]
  E --> F[Runtime plan]
  F --> G[Provider or native runtime]
Loading

Technical review

Best possible solution:

Keep the existing preference owners while preserving native forwarding opt-outs and allowing saved Access to return to Standard without a usable model catalog.

Do we have a high-confidence way to reproduce the issue?

Base preference codecs and session-creation payloads omit Access, establishing the persistence gap from source; this read-only review ran no reproduction.

Is this the best way to solve the issue?

Extending the existing authenticated preference owner is appropriate, but automatic defaults and replacement recovery controls must preserve supported native settings and catalog-independent clearing.

Full review comments:

  • [P1] Preserve native sessions with Access forwarding disabled — src/agents/model-catalog-access-programs.ts:101-109
    For an OpenAI API-key Codex session with features.api_key_cyber_access_programs=false and no saved or configured Access selection, this resolver manufactures Standard. Runtime-plan preparation injects it into accessPrograms, and the bundled adapter forwards it as turn/start.cyberAccessProgram. The inspected native for_auth implementation rejects every explicit program under that setting, including Standard; its app-server regression confirms omission succeeds while explicit Standard fails. Respect the native forwarding policy when deriving the automatic baseline so existing ordinary turns continue to work.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Allow saved Access recovery without a resolvable model — ui/src/pages/chat/components/chat-model-controls.tsx:569-570
    With a connected, writable chat holding cyberAccessProgram=daybreak_red and a ready but empty or entirely unavailable model catalog, hasResolvableModel is false. This condition disables the replacement Daybreak toggle even though the patch keeps its menu visible and removes the separate Clear saved Access action. The user can no longer return the saved selection to Standard until model availability recovers. Preserve catalog-independent recovery for an existing selection while retaining the existing mutation-permission checks.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0a35a93c1545.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/agents/model-catalog-access-programs.test.ts src/agents/runtime-plan/build.test.ts extensions/codex/src/app-server/turn-params.test.ts
  • pnpm --dir ui test src/pages/chat/components/chat-model-preferences.test.tsx src/pages/chat/components/chat-effort-picker.browser.test.tsx src/pages/new-session/model-control.test.ts
  • pnpm tsgo:ui
  • pnpm tsgo:test:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit dee738b adds ui/src/pages/new-session/draft-preference-state.ts:59 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dee738b84936; files: ui/src/pages/new-session/draft-preference-state.ts)
  • Dallin Romney: Raw commit bcafd72 adds ui/src/pages/new-session/draft-preference-state.ts:51 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bcafd72f610e; files: ui/src/pages/new-session/draft-preference-state.ts)
  • Vincent Koc: Raw commit 8daa537 adds ui/src/pages/new-session/preferences.ts:75 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8daa53763346; files: ui/src/pages/new-session/preferences.ts)
  • Vyctor H. Brzezowski: Raw commit a4bbfad adds ui/src/pages/chat/components/chat-model-controls.tsx:530 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a4bbfad4b916; files: ui/src/pages/chat/components/chat-model-controls.tsx)

PR surface

Source +496, Tests +288. Total +784 across 49 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 31 630 134 +496
Tests 18 445 157 +288
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 49 1075 291 +784

Root-cause cluster

Relationship: canonical
Canonical: #185039
Summary: This PR continues the same implementation after the earlier stacked PR closed without merging.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Remembering Access choices is a bounded chat-settings repair with concrete user value.
  • add merge-risk: 🚨 compatibility: Automatic Standard changes previously omitted native requests and breaks an existing forwarding-disabled configuration.
  • add merge-risk: 🚨 auth-provider: The injected Access parameter causes native API-key turns to fail under the supported forwarding opt-out.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Remembering Access choices is a bounded chat-settings repair with concrete user value.
  • merge-risk: 🚨 compatibility: Automatic Standard changes previously omitted native requests and breaks an existing forwarding-disabled configuration.
  • merge-risk: 🚨 auth-provider: The injected Access parameter causes native API-key turns to fail under the supported forwarding opt-out.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

Reviewed October 26, 2026, 5:37 PM ET / 21:37 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit 3e1eff7 into openclaw:main Oct 26, 2026
173 of 176 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
* fix(ui): preserve Daybreak choices across chats

* fix(ui): preserve unknown Daybreak entitlement state

* fix(runtime): align Access defaults with catalog

* fix(ui): keep new-session setup out of chat boot

* test(gateway): retain known Access defaults without route observations

* fix(ui): prepare Daybreak settings without rebuilding controls

* test(ui): align composer coverage with integrated controls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant