Skip to content

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

Closed
vyctorbrzezowski wants to merge 6 commits into
openclaw:brzezowski/effort-speed-pickerfrom
vyctorbrzezowski:brzezowski/access-inherited-state
Closed

vyctorbrzezowski wants to merge 6 commits into
openclaw:brzezowski/effort-speed-pickerfrom
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 is running on the updated main-based branch. 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

@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 26, 2026
@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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/access-inherited-state branch from 8c32e80 to d12b074 Compare October 26, 2026 16:27
@vyctorbrzezowski
vyctorbrzezowski changed the base branch from main to brzezowski/effort-speed-picker October 26, 2026 16:27
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/effort-speed-picker branch from c4ea54b to 40e006a Compare October 26, 2026 16:42
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/access-inherited-state branch from d12b074 to 248b6d4 Compare October 26, 2026 16:43
@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. labels Oct 26, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/effort-speed-picker branch from 40e006a to 3cd359a Compare October 26, 2026 17:08
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/access-inherited-state branch from cb73ebc to 9f3642a Compare October 26, 2026 17:11
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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 catalog defaults with runtime Access parameters.

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

  • 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 work with inspected visual evidence, but three introduced regressions prevent acceptance and upgrade compatibility remains unproven.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 3 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, the implementation reuses existing owners, and the maintainer-authored PR establishes direction for the toggle and Standard baseline.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this PR open: it addresses a real preference-persistence gap, but introduces native-runtime compatibility, Access recovery, and typing-work regressions.

Priority: P2
Reviewed head: 61bb55adc222e895f92a3ff4c89a55bd460f7a32

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 now returns Standard. runtime-plan/build.ts injects it into accessPrograms, and the native adapter forwards it as turn/start.cyberAccessProgram. The inspected native for_auth implementation rejects every explicit program, including Standard, under that setting; its app-server regression test confirms that contract. Previously omitted Access therefore becomes a failed turn. Respect the native forwarding policy rather than unconditionally manufacturing an explicit program.
  • 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. The patch keeps the effort menu visible but disables its Daybreak toggle here, while deleting the separate Clear saved Access action. The user can no longer return the saved selection to Standard until model availability recovers. The base recovery action did not require a resolvable model; preserve that distinction for clearing an existing selection.
  • Resolve submission Access without rebuilding model-control props (P2) - buildSelectedSessionCreateParams now calls this accessor, including from submissionAccess and incognito eligibility reads during composer updates. Calling renderProps repeats catalog-dependent model and thinking projection and allocates control callbacks just to obtain one field. Exact-head checks-ui (3/3) reports three renderProps calls during the existing typing-work regression test, where zero are expected. Resolve the effective Access value through the plain model-selection owner and share that value with renderProps.
  • 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:587-588
  • [P2] Resolve submission Access without rebuilding model-control props — ui/src/pages/new-session/model-control.ts:448-454

Provenance

  • Runtime Access fallback: original intent not found (unknown: Scoped git log -S searches of runtime-plan/build.ts and model-extra-params.ts found no earlier Access baseline decision; some older blob access was unavailable.)

Tests

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

How this fits together

The Control UI stores agent-scoped choices through the existing authenticated preference owner; model catalogs supply runtime defaults, and runtime plans translate selections into provider request parameters.

flowchart LR
  A[Chat and New Session controls] --> B[Authenticated preference owner]
  B --> C[Draft selection]
  D[Model catalog defaults] --> 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, resolve Access without constructing UI props, preserve recovery without a usable catalog, and respect disabled native forwarding.

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

The base preference codecs and creation payload omit Access selections, establishing the reported persistence gap from source; this read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Extending the existing authenticated preference owner is appropriate, but the submission accessor should read domain state directly and the default and recovery paths must preserve supported native settings.

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 now returns Standard. runtime-plan/build.ts injects it into accessPrograms, and the native adapter forwards it as turn/start.cyberAccessProgram. The inspected native for_auth implementation rejects every explicit program, including Standard, under that setting; its app-server regression test confirms that contract. Previously omitted Access therefore becomes a failed turn. Respect the native forwarding policy rather than unconditionally manufacturing an explicit program.
    Confidence: 0.97
  • [P2] Allow saved Access recovery without a resolvable model — ui/src/pages/chat/components/chat-model-controls.tsx:587-588
    With a connected, writable chat holding cyberAccessProgram=daybreak_red and a ready but empty or entirely unavailable model catalog, hasResolvableModel is false. The patch keeps the effort menu visible but disables its Daybreak toggle here, while deleting the separate Clear saved Access action. The user can no longer return the saved selection to Standard until model availability recovers. The base recovery action did not require a resolvable model; preserve that distinction for clearing an existing selection.
    Confidence: 0.99
  • [P2] Resolve submission Access without rebuilding model-control props — ui/src/pages/new-session/model-control.ts:448-454
    buildSelectedSessionCreateParams now calls this accessor, including from submissionAccess and incognito eligibility reads during composer updates. Calling renderProps repeats catalog-dependent model and thinking projection and allocates control callbacks just to obtain one field. Exact-head checks-ui (3/3) reports three renderProps calls during the existing typing-work regression test, where zero are expected. Resolve the effective Access value through the plain model-selection owner and share that value with renderProps.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/new-session/new-session-page.test.ts src/pages/new-session/model-control.test.ts src/pages/chat/components/chat-model-preferences.test.tsx
  • 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 tsgo:ui
  • pnpm tsgo:test:ui
  • git diff --check

What I checked:

  • Introduced change and current-main gap: Reviewed the pinned merge-base-to-head diff. Current main still lacks the added Access preference fields and runtime baseline resolver, so the central persistence change remains distinct work. (ui/src/pages/new-session/preferences.ts:81, 61bb55adc222)
  • Native dependency contract applies: The new resolver supplies Standard for the codex runtime, and the bundled native adapter forwards that value as turn/start.cyberAccessProgram; this makes the native runtime’s forwarding policy directly relevant. (extensions/codex/src/app-server/access-program.ts:11, 61bb55adc222)
  • Native forwarding-disabled failure: Personally inspected the sibling Codex checkout at rust-v0.164.0. Its for_auth implementation rejects every explicit Access program when API-key forwarding is disabled; its app-server test includes Standard and expects the turn to fail. The checkout’s remote is a local cache, so its GitHub repository identity is unverified. (codex-rs/core/src/cyber_access_program.rs:59, 6aaac694803004a63c6f393d153c96d22521a6b9)
  • Recovery regression: The previous recovery action remained available independently of model resolution; the patch removes that action and disables the replacement toggle when no model is resolvable. (ui/src/pages/chat/components/chat-model-controls.tsx:588, 61bb55adc222)
  • Diff-caused hosted failure: The exact-head checks-ui (3/3) annotation reports three renderProps calls during a typing update where the existing work-count contract expects zero; source traces these calls through create-parameter construction to the new accessor. (ui/src/pages/new-session/model-control.ts:449, 61bb55adc222)
  • Visual evidence inspected: Inspected all four downloaded before/after comparisons: desktop and mobile, light and dark, Standard and Red. They demonstrate the changed presentation. The manifest contains no prepared video; opening the video URL returned Cache miss, so animation and restoration claims were not inferred from it. (61bb55adc222)

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)
  • 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: high; commits: a4bbfad4b916; files: ui/src/pages/chat/components/chat-model-controls.tsx)
  • Dallin Romney: Raw commit bcafd72 adds ui/src/pages/new-session/draft-preference-state.ts:52 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)

PR surface

Source +499, Tests +311. Total +810 across 43 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 31 633 134 +499
Tests 12 385 74 +311
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 43 1018 208 +810

Review metrics

Metric Value Why it matters
Added serialized fields 1 catalog field and 2 persisted preference fields cyberAccessProgramDefault extends runtime metadata; cyberAccessProgram and daybreakAccessProgram extend existing preference and draft records.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Injecting Standard changes previously unset native requests and breaks an existing explicit forwarding-disabled configuration.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: Remembering Access choices is a bounded chat-settings improvement with concrete user value.
  • merge-risk: 🚨 compatibility: Injecting Standard changes previously unset native requests and breaks an existing explicit forwarding-disabled configuration.
  • merge-risk: 🚨 auth-provider: The new baseline reaches native API-key request preparation, where disabled Access forwarding rejects the turn.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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, 2:10 PM ET / 18:10 UTC.

@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/effort-speed-picker branch 3 times, most recently from 113d5ba to 1f9025e Compare October 26, 2026 20:33
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/access-inherited-state branch from 61bb55a to 629d5ec Compare October 26, 2026 20:57
@vyctorbrzezowski
vyctorbrzezowski deleted the branch openclaw:brzezowski/effort-speed-picker October 26, 2026 21:11
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Continued in #185039. GitHub automatically closed this PR when the stacked base branch was merged and deleted, then refused reopening after the source branch was rebased. The replacement targets main and preserves the implementation and visual evidence, with the verified integration-test repairs.

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