You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): wait for runtime readiness before option picks - #37626
Phone model choices stay visible while a chat loads, but become selectable only when a pick can apply.
What Changed
The phone offered catalog choices before its session had a runtime fence, then silently rejected the pick in the mutation wrapper. One readiness value now drives the shared option writer and desktop's existing snapshot lock, including snapshots returned after a pick settles. Model, effort, and permission picks follow the same rule.
Why
This matches desktop's documented behavior without adding a queue. Catalog discovery still runs early, and options remain usable during a pending or failing options read once a runtime fence exists.
Isolated production phone controls and hooks rendered in headless Chromium at 390 × 720, with a scripted host catalog arriving before the fence. These are component-fixture captures, not a native device session.
Before: offered while loading
After: locked while loading
Before interaction: the loading-state tap is refused with zero writes. After interaction: controls wait for readiness, then the model pick applies with one fenced write. Light and dark rendering checked.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
On macOS, 82 focused mobile tests across 10 files pass, covering the first frame, option lifetimes, permissions, chat return, and runtime restart. The new regression uses the real mutation wrapper, fails against baseline on the selectable null-fence descriptor, and passes with the fix. It also checks the arriving fence in the write envelope and current locked snapshots after disabling during an in-flight pick.
All 15 selected pnpm check:changed --maxWorkers=2 checks pass, along with changed-file oxlint/oxfmt, changed-code quality, React Doctor, and git diff --check. Every test listed by test-dependents.sh passed. Scripted rendered interactions are shown above; native iOS/Android, Windows/Linux, and live SSH were not run locally. CI covers broad platform and mobile verification.
Risk
Level: Low. The main risk is leaving controls locked after readiness changes; the regression covers unlocking on fence arrival and locking after disabling. No protocol, host routing, or persisted data format changes. A plain revert restores prior behavior.
AI Disclosure
Review
Exactly two independent Codex/Claude review rounds on the three-file diff, pinned to HEAD and merge-base dbd0c2448e17209cf8d65e42d4ce4b4e74293824. Round 1 had no findings. Round 2 identified a low-priority test gap around the writer readiness gate; the regression was strengthened to require zero requests from locked picks, so a rejected premature attempt cannot hide behind the mutation wrapper. No unresolved P0/P1 findings. Removing only the writer gate makes the strengthened test fail with 5 requests instead of 2; the complete fix passes. Final test-audit and simplification checks retain one behavioral regression and the existing shared lock/write owner. The first Mobile verify run caught an inferred RPC mock response type in the new test; a test-only follow-up supplies the real transport signature, with focused test/lint/format checks passing.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
The readiness rule is client-side and applies equally to local/remote hosts and folder/git workspaces. Existing legacy-host permission handling and catalog fallback remain intact. No paths, shortcuts, native modules, or host capabilities change.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
The options hook locks option snapshots unless a client, session, enabled state, and non-null runtime fence are present. After a write, the option surface returns the latest snapshot. The test checks option locking, a request with runtime fence 3, and locking after options are disabled.
Merge Risk: Minimal · up to aa1ae
The readiness changes preserve locked and unlocked option behavior without an identified merge-blocking risk.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: mobile option picks now wait for runtime readiness.
Description check
The description is complete and focused. It includes the required explanation, change summary, rationale, linked issue, visual proof, testing results, risk assessment, review notes, compatibility cons…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is complete and focused. It includes the required explanation, change summary, rationale, linked issue, visual proof, testing results, risk assessment, review notes, compatibility considerations, and checklist status. The unchecked manual-testing item is explained by the reported automated and CI coverage.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ast-grep (0.51.1)
ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/ruby/security/ruby-mysql2-hardcoded-secret-ruby.yml
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Phone model choices stay visible while a chat loads, but become selectable only when a pick can apply.
What Changed
The phone offered catalog choices before its session had a runtime fence, then silently rejected the pick in the mutation wrapper. One readiness value now drives the shared option writer and desktop's existing snapshot lock, including snapshots returned after a pick settles. Model, effort, and permission picks follow the same rule.
Why
This matches desktop's documented behavior without adding a queue. Catalog discovery still runs early, and options remain usable during a pending or failing options read once a runtime fence exists.
Linked Issue
Fixes STA-13340.
Visual Proof
Isolated production phone controls and hooks rendered in headless Chromium at 390 × 720, with a scripted host catalog arriving before the fence. These are component-fixture captures, not a native device session.
Before interaction: the loading-state tap is refused with zero writes. After interaction: controls wait for readiness, then the model pick applies with one fenced write. Light and dark rendering checked.
Testing
On macOS, 82 focused mobile tests across 10 files pass, covering the first frame, option lifetimes, permissions, chat return, and runtime restart. The new regression uses the real mutation wrapper, fails against baseline on the selectable null-fence descriptor, and passes with the fix. It also checks the arriving fence in the write envelope and current locked snapshots after disabling during an in-flight pick.
All 15 selected
pnpm check:changed --maxWorkers=2checks pass, along with changed-file oxlint/oxfmt, changed-code quality, React Doctor, andgit diff --check. Every test listed bytest-dependents.shpassed. Scripted rendered interactions are shown above; native iOS/Android, Windows/Linux, and live SSH were not run locally. CI covers broad platform and mobile verification.Risk
Level: Low. The main risk is leaving controls locked after readiness changes; the regression covers unlocking on fence arrival and locking after disabling. No protocol, host routing, or persisted data format changes. A plain revert restores prior behavior.
AI Disclosure
Review
Exactly two independent Codex/Claude review rounds on the three-file diff, pinned to HEAD and merge-base
dbd0c2448e17209cf8d65e42d4ce4b4e74293824. Round 1 had no findings. Round 2 identified a low-priority test gap around the writer readiness gate; the regression was strengthened to require zero requests from locked picks, so a rejected premature attempt cannot hide behind the mutation wrapper. No unresolved P0/P1 findings. Removing only the writer gate makes the strengthened test fail with 5 requests instead of 2; the complete fix passes. Final test-audit and simplification checks retain one behavioral regression and the existing shared lock/write owner. The first Mobile verify run caught an inferred RPC mock response type in the new test; a test-only follow-up supplies the real transport signature, with focused test/lint/format checks passing.Agent skill upstream boundary
Notes
The readiness rule is client-side and applies equally to local/remote hosts and folder/git workspaces. Existing legacy-host permission handling and catalog fallback remain intact. No paths, shortcuts, native modules, or host capabilities change.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)