Repository navigation
Keep a chat's accepted model options in what it shows and sends - #31208
Conversation
A pick held while a new chat is created is committed into the chat's active option record once accepted, through the same step a normal pick takes, and older options reads are dropped. The host also publishes the chat's saved effort, Fast and speed as optional status fields so another device's pick moves the option stamp and re-reads options.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c5c4ec59-d327-4b4a-a598-22219a2c65d4
📒 Files selected for processing: 68
mobile/src/session/mobile-structured-agent-session-host-support.tsmobile/src/session/mobile-structured-agent-session-rpc.tsmobile/src/session/mobile-structured-agent-session-send.tsmobile/src/session/use-mobile-structured-agent-options.test.tsmobile/src/session/use-mobile-structured-agent-options.tsmobile/src/session/use-mobile-structured-agent-session.tsmobile/src/session/use-mobile-structured-option-surface.tsmobile/src/session/use-mobile-structured-selection-controller.tsmobile/src/session/use-mobile-structured-send-with-outcome.tsmobile/src/session/use-mobile-structured-session-option-stamp.tssrc/main/codex/codex-structured-message-options.test.tssrc/main/codex/codex-structured-message-options.tssrc/main/codex/codex-structured-session-adapter.tssrc/main/codex/codex-structured-turn-start.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adapter-router.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adapter.tssrc/main/native-chat/agent-session-wire/structured-agent-session-create.tssrc/main/native-chat/agent-session-wire/structured-agent-session-delivery-context.tssrc/main/native-chat/agent-session-wire/structured-agent-session-delivery-loop.tssrc/main/native-chat/agent-session-wire/structured-agent-session-execution-options.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.tssrc/main/native-chat/agent-session-wire/structured-agent-session-message-options.tssrc/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-message-rig-provider.test-fixture.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-messages.tssrc/main/native-chat/agent-session-wire/structured-agent-session-send-options.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-summary-equality.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-summary.tssrc/main/native-chat/agent-session-wire/structured-agent-session-steer-while-stopping.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-turns.tssrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsxsrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsxsrc/renderer/src/components/native-chat/structured-agent-session-message-sender.tssrc/renderer/src/components/native-chat/structured-agent-session-pending-sends.tssrc/renderer/src/components/native-chat/structured-agent-session-send-attempt.tssrc/renderer/src/components/native-chat/structured-agent-session-send-slot.tssrc/renderer/src/components/native-chat/use-structured-agent-session-option-state.tssrc/renderer/src/components/native-chat/use-structured-agent-session-options.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-options.tssrc/renderer/src/components/native-chat/use-structured-agent-session-send-options.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-send-options.tssrc/renderer/src/components/native-chat/use-structured-agent-session-sends.tssrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/renderer/src/lib/launch-structured-agent-session.tssrc/renderer/src/lib/structured-agent-session-launch-create-call.tssrc/renderer/src/lib/structured-agent-session-launch-create-message.test.tssrc/renderer/src/lib/structured-agent-session-launch-create-message.tssrc/renderer/src/lib/structured-agent-session-launch-lifecycle.tssrc/renderer/src/lib/structured-agent-session-launch-options.test.tssrc/renderer/src/lib/structured-agent-session-launch-options.tssrc/renderer/src/lib/structured-agent-session-launch-registry.tssrc/renderer/src/lib/structured-agent-session-selection-controller.tssrc/renderer/src/runtime/structured-agent-session-client.tssrc/shared/agent-session-create-capabilities.tssrc/shared/agent-session-execution-options.tssrc/shared/agent-session-status-option-stamp.tssrc/shared/agent-session-wire.tssrc/shared/rpc-contract/structured-agent-session-agent-params.test.tssrc/shared/rpc-contract/structured-agent-session-identifiers.tssrc/shared/rpc-contract/structured-agent-session-params.tssrc/shared/structured-agent-session-create.tssrc/shared/structured-agent-session-option-view.tssrc/shared/structured-agent-session-selection-operations.test.tssrc/shared/structured-agent-session-selection-operations.tssrc/shared/structured-agent-session-send-mutation.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f63461a4-c112-4cfd-9187-fc94d63eebbb
📒 Files selected for processing: 2
src/main/codex/codex-structured-message-options.test.tssrc/main/codex/codex-structured-message-options.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Allow accepted model-only messages to use the… · codex-structured-message-options.ts:30-38
src/main/codex/codex-structured-message-options.ts:30-38
🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAllow accepted model-only messages to use the provider default effort.
An accepted delayed message can contain a model without an effort. If another client stores an effort and the captured model has no applicable default, this guard throws before
turn/start. The resolver already preserves the captured model and removes effort in this case. Limit the guard to messages without a captured model.Suggested fix
- if (choices.effort === undefined && priorEffort && !defaultEffort) { + if ( + choices.effort === undefined && + priorEffort && + !defaultEffort && + choices.model === undefined + ) { throw new AgentSessionOptionRejectedError(new Error('codex default effort is unavailable')) }
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
97ce3b24-735c-49a0-be55-c3429ac97cc1
📒 Files selected for processing: 3
src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.mid-turn.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
[Medium impact] The changes since the previous review appear safe to merge. SummaryKeeps each chat’s accepted choices separate from provider reports and captures those choices when a message is sent.
Both supplied previous threads are unnumbered and resolved. The mobile fixture now supplies
|
There was a problem hiding this comment.
Actionable comments posted: 5

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fbe043b1-1f84-48e8-9d66-65579dcdea7e
Files selected for processing: 94-
mobile/src/session/mobile-structured-agent-session-host-support.tsmobile/src/session/mobile-structured-agent-session-send.tsmobile/src/session/use-mobile-structured-agent-options.lifetime.test.tsmobile/src/session/use-mobile-structured-agent-options.test-fixture.tsmobile/src/session/use-mobile-structured-agent-options.test.tsmobile/src/session/use-mobile-structured-agent-options.tsmobile/src/session/use-mobile-structured-agent-session.tsmobile/src/session/use-mobile-structured-option-state.tsmobile/src/session/use-mobile-structured-option-surface.tsmobile/src/session/use-mobile-structured-selection-controller.tsmobile/src/session/use-mobile-structured-send-with-outcome.tsmobile/src/session/use-mobile-structured-session-option-stamp.tssrc/main/codex/codex-structured-message-options.test.tssrc/main/ipc/runtime-environments/runtime-environment-selection-affinity.test-fixture.tssrc/main/ipc/runtime-environments/runtime-environments-call-routing.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-codex-applied-inputs.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-create.tssrc/main/native-chat/agent-session-wire/structured-agent-session-execution-options.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.tssrc/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.accepted-inputs.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-messages.tssrc/main/native-chat/agent-session-wire/structured-agent-session-resting-options.tssrc/main/native-chat/agent-session-wire/structured-agent-session-send-options.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-summary-equality.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-summary.tssrc/main/native-chat/agent-session-wire/structured-agent-session-turns.tssrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.mid-turn.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsxsrc/renderer/src/components/native-chat/native-chat-session-option-settings-write.tssrc/renderer/src/components/native-chat/native-chat-subscriptions.performance.test.tsxsrc/renderer/src/components/native-chat/structured-agent-session-option-first-frame.tssrc/renderer/src/components/native-chat/structured-agent-session-options-contract.tssrc/renderer/src/components/native-chat/structured-agent-session-pending-sends.tssrc/renderer/src/components/native-chat/structured-agent-session-send-attempt.tssrc/renderer/src/components/native-chat/structured-agent-session-send-slot.tssrc/renderer/src/components/native-chat/use-host-model-catalog-upgrade.test.tsxsrc/renderer/src/components/native-chat/use-host-model-catalog-upgrade.unavailable.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-provisional-launch.tssrc/renderer/src/components/native-chat/use-structured-agent-session-option-state.tssrc/renderer/src/components/native-chat/use-structured-agent-session-options.first-frame.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-options.learned-default.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-options.preloaded-agents.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-options.test-fixture.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-options.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-options.tssrc/renderer/src/components/native-chat/use-structured-agent-session-provisional.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-send-options.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-send-options.tssrc/renderer/src/components/native-chat/use-structured-agent-session-sends.tssrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/renderer/src/components/native-chat/use-structured-session-selection-reads.tssrc/renderer/src/lib/agent-session/launch/structured-agent-session-launch-outcome-tracking.tssrc/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.tssrc/renderer/src/lib/agent-session/launch/structured-agent-session-launch-reload.test.tssrc/renderer/src/lib/agent-session/launch/structured-agent-session-launch-reload.tssrc/renderer/src/lib/launch-structured-agent-session.tssrc/renderer/src/lib/structured-agent-session-launch-action-effort.test-fixture.tssrc/renderer/src/lib/structured-agent-session-launch-create-call.tssrc/renderer/src/lib/structured-agent-session-launch-create-message.test-fixture.tssrc/renderer/src/lib/structured-agent-session-launch-create-message.test.tssrc/renderer/src/lib/structured-agent-session-launch-create-message.tssrc/renderer/src/lib/structured-agent-session-launch-lifecycle.tssrc/renderer/src/lib/structured-agent-session-launch-options.test.tssrc/renderer/src/lib/structured-agent-session-launch-options.tssrc/renderer/src/lib/structured-agent-session-launch.tssrc/renderer/src/lib/structured-agent-session-selection-controller.tssrc/renderer/src/lib/structured-agent-session-selection-lifetime.test.tsxsrc/renderer/src/runtime/runtime-environment-revision.tssrc/renderer/src/runtime/runtime-host-contact-regained.test.tssrc/renderer/src/runtime/runtime-host-contact-regained.tssrc/renderer/src/runtime/runtime-rpc-selection-order.test.tssrc/renderer/src/runtime/structured-agent-session-client.tssrc/renderer/src/runtime/structured-agent-session-tab-retirement.test.tssrc/renderer/src/runtime/structured-agent-session-tab-retirement.tssrc/renderer/src/store/slices/worktrees/teardown/purged-structured-launch-retirement.tssrc/shared/agent-session-create-capabilities.tssrc/shared/agent-session-execution-options.tssrc/shared/agent-session-options-result.tssrc/shared/agent-session-wire.tssrc/shared/rpc-contract/structured-agent-session-params.tssrc/shared/structured-agent-session-create.tssrc/shared/structured-agent-session-option-state.tssrc/shared/structured-agent-session-option-view.test.tssrc/shared/structured-agent-session-option-view.tssrc/shared/structured-agent-session-options.test.tssrc/shared/structured-agent-session-options.tssrc/shared/structured-agent-session-selection-operations.test.tssrc/shared/structured-agent-session-selection-operations.tssrc/shared/structured-agent-session-send-mutation.ts
Files skipped from review as they are similar to previous changes: 1-
- src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
|
A choice made while a chat was being created could be replaced by an older request. Another client could also change the chat after the window displayed its choice, causing the next message to use different controls. This PR keeps current choices with the chat, orders accepted updates, and captures each message’s selection at submission. The opening message retains its original capture, while later messages use later accepted choices. The shared Send implementation from merged #31927 owns native application. On capable hosts an unpicked Fast choice means Off; saved choices are preserved, and older hosts retain their supported paths. The full review ended at terminal round 6. Fixes cover logical ownership across reconnects, held versus attached selection ordering, phone display and permission parity, original-host request outcomes, and message journal identity. The final whole-mechanism comparison is complete; the differences from the common pattern are intended adaptations for independently updated clients and hosts. No open source defect is claimed by the final bounded reviews. Validation: complete final-head CI passed, including all ten root shards, compiler/static checks, mobile and WSL. Actual Bun execution passed the specific cold store/controller imports and the relocated queue/affinity case; mobile passed all 135 required cases and both type gates. Real Windows lifecycle QA carried prior-build saved Claude and Codex chats through graceful restart, then received two new replies each. Both held-create/follow-up flows completed; Claude retained the opening capture and produced one opening. The targeted Fast step proved exact selection capture, a matching native Fast=true acknowledgement, effective=true readbacks and the same real reply. That reply used standard speed and reported Fast off/preference. Matching-CLI/main-parity analysis identifies the discrepancy as inherited; the earlier baseline also showed selected Fast with an off/standard result, while incoming main retains the native path unchanged. Main parity is source-based, and the baseline did not save a raw reason/ack trace. The lane owner’s scoped acceptance condition closes this PR’s caller/application target; provider Fast execution and the underlying availability cause remain unproved. Separate inherited follow-up: tracked in STA-12849. All copies stopped gracefully with zero owned survivors; five real-config hashes were unchanged. Reviewed head: 89c5c9b. Runtime QA head: ac6e39a. The intervening 4ccdfac type annotation/proof repair and 89c5c9b test-only repair were independently reviewed; they leave the exercised lifecycle behavior unchanged. Their targeted tests and current-head CI passed. Deferred P3: on an older host, if original ownership ends after creation, the existing failed-start/Retry wording can be generic. The unsent draft remains and no automatic resend occurs. The inherited lifecycle serializer cost remains tracked in STA-11837; held-option settlements bypass the global notifier, but this PR does not claim to remove that separate cost. For Brennan’s review Saved Claude conversation on main, and two real replies after restart on the branch: Saved Codex conversation on main, and two real replies after restart on the branch: Held creation followed by a distinct real reply (Claude caption is not proof of provider Fast execution): Targeted Fast Off→On and the one next reply. These show the UI choice and completed reply; native telemetry reported standard speed, so the images do not prove provider Fast execution. |









A model, effort or Fast choice made while a chat was being created could later revert when an older request completed. An open window could also send a different choice from the one it showed after another client changed the chat. This change keeps accepted choices with the chat, applies newer choices in order, and captures each message’s accepted selection when it is sent.
Changed default: when a chat has no saved or seeded Fast choice, new hosts show Fast off and apply false. This also affects older clients connected to a new host. Saved Fast on and off choices are preserved; older hosts retain their existing behavior.
A Codex message with a different effective speed is accepted and queued immediately, then runs in the next compatible turn. Messages at the same speed can still join the running turn. The configured default speed stays intact.
The shared Send correction tracked in #31927 is merged and adopted here. Native request compilation and applied-input knowledge remain owned by that shared implementation. No saved-data migration or minimum paired-server version is introduced.
Tracked in STA-10852, STA-11443, #30561 and #28046. The remaining launch-registry performance issue is tracked in STA-11837; held-option settlement now bypasses its global notifier.
Validation on reviewed head 89c5c9b: the complete CI watch passed, including all ten root test shards, static analysis/typechecking, mobile verification and WSL. The latest test-only repair passed 91 targeted tests across five named files and the normal commit hook. Full-path correctness, reference and readiness/performance reviews completed within terminal round 6; the terminal design ruling retained this implementation. Independent execution review confirmed that the compiler ran, the specific Bun cold store/controller cases passed, and the eight required mobile files passed all 135 cases and both type gates.
Real Windows QA carried saved Claude and Codex chats from the previous build through a graceful restart and obtained two new replies each. Both agents completed held-create and follow-up flows; Claude's opening was captured once and retained its selection. The longer artificial holds reached the existing uncertainty deadline, so prompt handback was expected. A targeted Claude Fast Off→On run obtained a real next reply and proved that native Fast=true was acknowledged and read back as effective=true. That reply nevertheless reported Fast off, reason preference, and standard speed; provider Fast execution is not claimed. Independent matching-CLI and main-parity analysis identifies this as an inherited availability/application discrepancy: the earlier baseline also returned standard with Fast selected, and incoming main retains the same native path. The baseline did not capture a raw preference-reason frame or native acknowledgement; main parity is a source comparison, not a new main replay. The verified result for this PR is exact capture, successful native application and a real reply. Provider Fast execution is not claimed, and no unsupported-account or opt-in cause is inferred. The inherited discrepancy is tracked in STA-12849; no rig fault or PR caller defect was established.
The QA runtime head is ac6e39a. Commit 4ccdfac changes a type annotation and test proofs; 89c5c9b changes only test fixtures/project placement. Their bounded delta reviews confirmed unchanged runtime behavior. All test copies stopped gracefully with zero owned survivors; five real-config hashes stayed unchanged. No second full QA round was run.