Skip to content

Prevent resting chats from delaying native command menus - #35069

Merged
brennanb2025 merged 18 commits into
mainfrom
brennanb2025/lu-at-rest-probes
Oct 29, 2026
Merged

brennanb2025 merged 18 commits into
mainfrom
brennanb2025/lu-at-rest-probes

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2632 $\color{#cf222e}{\Huge{\mathbf{−}}}$​194 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2438
Prod 45 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1007 $\color{#cf222e}{\Huge{\mathbf{−}}}$​153 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​854

What changes

Opening a command menu could wait behind command discovery for unrelated resting chats, including closed tabs. Current clients discover commands for the menu being used and observe cached lists elsewhere once host support is reported. The phone keeps its eager compatibility read until that report, as described below.

Claude and OMP share discovery within each context while explicit menu requests proceed independently of the legacy queue. Account/workspace retirement invalidates matching open menus even when command rows remain absent. Pending reads recover within a bounded episode; settled success stops polling. Closing, hiding or retargeting ends supported-menu recovery. Earlier compatibility reads can still finish. Existing Codex pooling and grace remain.

Typed provider text, attachments and queued edits do not depend on optional inventory. Orca handles its implemented operations through their existing paths and forwards other provider text unchanged. /permissions forwarding is intended; provider support for the command is not promised.

Compatibility and intended differences

Intended: Until a host reports support, the phone keeps today's eager command read, so older hosts never get a slower first menu; a modern host may run one discovery pass in that window. Here one pass describes a stable enabled client/host/session, idle request queue and unchanged context; additional refreshes, reconnects, retargeting or context retirement can add work. Once support is confirmed, discovery is menu-driven. Reconnect or retarget can begin a new discovery window; explicit later menu actions are separate demand. Until that report, a late command list can still require reopening the menu, preserving the existing fallback. Already requested or queued compatibility work can drain after support arrives. This is not a universal process-count limit.

This follows the common pattern of scoped discovery, per-context sharing and explicit app-owned operations. Supported older desktops and phones retain eager delivery and existing catalog admission; new clients on older hosts retain their fallback. There is no version floor, new saved field or RPC. Existing capability metadata, pending replies and bounded change hints support independently updated phones/hosts. Authoritative host, account, workspace and pinned-folder identity remain part of catalog context. Logical cancellation is not a universal physical-process ceiling.

Tracked in STA-10883.

Validation

Independent final review and capability-contract proof are complete on 4e8a4fc69072b2c5f0d87a8bbf8c0fb57ed32b16. Final CI is green on that head, including static analysis/typecheck, all ten root-test shards, Mobile verify, mixed-version wire compatibility, macOS/Windows packaging and all three WSL distro checks.

Full review path: lifecycle, process admission, ordering and mixed-version behavior span host, desktop and phone. Three behavioral rounds, the design-panel settlements, reference/readiness reviews and independent performance verification are complete. Earlier confirmed defects were fixed; the pre-report phone discovery path is the intended compatibility exception described above, with its causal trace preserved. CI supplies lint/typecheck, mobile, mixed-version wire, root tests and packaging checks.

Deterministic production-path N/10N contracts cover both catalogs, mixed legacy/modern subscriptions, duplicate demand, expiry, account/cwd retirement, replacement while cleanup is pending, zero passive acquisition and unaffected per-chat renders. Named root suites ran through tc-gate; the final capability proof passed 38 unique targeted root tests and all 11 new phone cases in CI. The repaired phone fixture also passes the test-typecheck ratchet; the normal hooks passed. The tests execute the actual capability producer, lane, menu callbacks and host catalog dispatch/settlement, including held status, queued refresh, stale-target ownership and N/10N unknown-support demand.

Real QA on macOS and Windows used previous-build-created saved state and graceful upgrade. Ten distinct resting contexts restored; Claude and Codex each completed two real replies; command menus reopened; OMP exposed 67 rows and completed a skill token. Matched Windows resting catalogs and completion matched baseline; an already-open menu replaced account-specific rows on A→B→A selection. The account labels are local fixture metadata, not a login-flow claim. Phone suites ran in CI only.

Fresh process capture on 98d6f359 classified all observed launcher starts and confirmed teardown. Conservative captured-set peaks were 2 roots, 1 command root, 1 immediate native Codex process, and 5 including other captured descendants; QA wrappers are separately counted. Historical process purposes cannot be assigned from retained data. Sampling at 20 ms/200 ms and missing kernel descendant tracking mean these are measured captured-set bounds, not a universal process cap or guaranteed latency.

Visual proof

Restoration and command menus (macOS)
Previous build, resting chat Upgraded branch, same saved chat
Previous-build resting chat Restored chat on the branch
Claude command menu Codex skill menu
Claude command menu Codex skill menu

The Codex screenshots retain a failed gpt-5.4 setup attempt from baseline history. The baseline subsequently succeeded with GPT-6.1-Sol, and both branch replies below succeeded.

Real replies and OMP catalog/completion
Claude: two branch replies Codex: two branch replies
Two real Claude replies after upgrade Two real Codex replies after upgrade
OMP menu (67 catalog rows verified) OMP skill completion
OMP command menu OMP completed skill token
Matched Windows baseline and held-open account menu
Previous-build resting menu Branch, same saved chat and menu
Baseline profile A menu Branch profile A menu
Previous-build completion Branch completion
Baseline collision completion Branch collision completion
Same menu after A→B Same menu after B→A
Held-open menu shows profile B row Held-open menu returns to profile A row

Selection used the production local account-selection API with declared fixture profile labels and real provider authentication. This proves menu replacement, not an OAuth flow or a specific refresh-latency guarantee. The draft, caret and composer stayed the same.

Review classification

Full path: larger than the light threshold; changes lifecycle/process ownership, ordering, recovery and mixed-version behavior; recent catalog fixes share the mechanism; effects cross desktop, host and phone.

Agent skill upstream boundary

Not applicable: no upstream skill-installer code or data is copied.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 28, 2026 11:59
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent 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: ff3ffe15-f3a3-47de-a999-2a5507fbbd08
Commits

Reviewing files that changed from the base of the PR and between 6661ba6 and 13902d2.

Files selected for processing: 6
  • src/main/native-chat/agent-session-wire/agent-session-subscriber-frame-fields.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-at-rest-command-population.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-at-rest-command-rig.test-fixture.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-at-rest-commands.test.ts
  • src/renderer/src/components/native-chat/agent-session-command-menu.test-fixture.tsx
  • src/shared/agent-session-command-menu.test-fixture-contract.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

The change adds capability-gated command reads for structured agent sessions. Server reads can report pending state, and subscriptions can send command-change hints. Renderer and mobile clients connect slash-menu state to command-query lifecycles. At-rest discovery supports demand promotion, snapshots, retries, and retirement notifications. Structured composer recognition now claims only session-option and conversation commands.

Priority: Normal

Merge Risk: Low · up to 13902

This change moves command discovery to on-demand reads and adds test coverage. No behavioral defect was found in the reviewed server and test-fixture changes. One earlier concern remains open: a mobile test file may fail typechecking and fail the Mobile verify job. The current line looks fine, but a typecheck run would confirm it before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.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. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "Prevent resting chats from delaying native command menus" matches the main change. The PR makes capable clients request commands only while the menu is open, so restored chats no longer sta…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template with all main sections present: What changes, Why-style compatibility notes, Validation, Visual proof, and Review classification. It includes extensive …
Full details: Title check

Explanation

The title "Prevent resting chats from delaying native command menus" matches the main change. The PR makes capable clients request commands only while the menu is open, so restored chats no longer start background command probes that delay menu opening. The title is specific and concise, and it names the user-visible symptom and the affected surface.

Full details: Description check

Explanation

The description follows the repository template with all main sections present: What changes, Why-style compatibility notes, Validation, Visual proof, and Review classification. It includes extensive CI and QA evidence, with before and after screenshots for UI behavior. However, the template's ELI5 section is missing, and the Linked Issue section has no issue number. The Testing checklist boxes are not ticked, and the Why section is only partly separated from the description. The AI Disclosure section is not filled in. The Notes and Checklist sections are not addressed. The description is detailed and mostly complete, though it is dense and has some gaps to close.

Full details: Docstring Coverage

Explanation

Docstring coverage is 28.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 25 functions across 65 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


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: 678e663d-126e-47b0-95ba-e7c41dc2d1d6
Commits

Reviewing files that changed from the base of the PR and between 15fac13 and 38fb4a4.

Files selected for processing: 49
  • mobile/src/session/mobile-structured-agent-session-contract.ts
  • mobile/src/session/mobile-structured-agent-session-host-support.ts
  • mobile/src/session/mobile-structured-composer-command.test.ts
  • mobile/src/session/native-chat/composer/MobileNativeChatComposer.structured.test.ts
  • mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-menu.ts
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-structured-composer.ts
  • mobile/src/session/use-mobile-native-chat-session-lane.ts
  • mobile/src/session/use-mobile-structured-agent-session.ts
  • mobile/src/session/use-mobile-structured-agent-state.ts
  • mobile/src/session/use-mobile-structured-session-commands.test.tsx
  • mobile/src/session/use-mobile-structured-session-commands.ts
  • mobile/src/transport/mobile-runtime-client-capabilities.test.ts
  • mobile/src/transport/mobile-runtime-client-capabilities.ts
  • src/main/acp/acp-at-rest-commands.test.ts
  • src/main/acp/acp-at-rest-commands.ts
  • src/main/claude/claude-at-rest-commands.ts
  • src/main/claude/claude-structured-session-commands.test.ts
  • src/main/native-chat/agent-session-wire/agent-session-subscribe-input.ts
  • src/main/native-chat/agent-session-wire/agent-session-subscriber-frame-fields.ts
  • src/main/native-chat/agent-session-wire/at-rest-command-catalog.ts
  • src/main/native-chat/agent-session-wire/at-rest-command-demand.test.ts
  • src/main/native-chat/agent-session-wire/at-rest-command-demand.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-adapter-router.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-at-rest-commands.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-at-rest-commands.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-client-delivery.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-subscribers.ts
  • src/main/runtime/rpc/methods/structured-agent-session-options-read.ts
  • src/main/runtime/rpc/methods/structured-agent-session-policy.ts
  • src/main/runtime/rpc/methods/structured-agent-session-wire-contracts.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session.ts
  • src/renderer/src/components/native-chat/native-chat-composer-types.ts
  • src/renderer/src/components/native-chat/structured-agent-session-command-refresh.test.tsx
  • src/renderer/src/components/native-chat/structured-agent-session-command-refresh.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-command-picker.ts
  • src/renderer/src/components/native-chat/use-native-chat-picker-state.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-picker-state.ts
  • src/renderer/src/components/native-chat/use-native-chat-structured-composer-transport.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/shared/agent-session-command-menu-query.test.ts
  • src/shared/agent-session-command-menu-query.ts
  • src/shared/agent-session-frame-fields.ts
  • src/shared/agent-session-wire.ts
  • src/shared/structured-agent-session-composer.test.ts
  • src/shared/structured-agent-session-composer.ts
  • src/shared/structured-agent-session-renderer-client-capabilities.ts
  • src/shared/structured-agent-session-surface-capabilities.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge; no new blocking issue was found.

Summary

Command discovery now follows open menus instead of resting chats. Desktop and phone menus share cached results and recover pending reads while open.

  • Command lists for capable clients load when someone opens a menu.
  • Provider command text can be sent without a loaded command list.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Chat restored] --> B[Observe cached commands]
  C[Command menu opens] --> D[Request commands for this context]
  D --> E[Join discovery already running]
  D --> F[Start discovery if needed]
  E --> G[Return commands or pending]
  F --> G
  G --> H[Recover pending reads while menu stays open]
  H --> I[Stop on success, close, hide, or retarget]
Loading

Reviews (3) · Last reviewed commit: "test: correct capability proof scope ada..." · Reviewed by Greptile

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closed resting chats could keep command probes ahead of the chat whose menu the user was opening. Once host support is reported, current clients request discovery for the menu they are using; passive transcript updates read cached lists. Explicit Claude/OMP discovery shares work within a context and proceeds independently of the older-client queue. Typed provider text, attachments and queued edits no longer depend on optional menu inventory.

Intended: Until a host reports support, the phone keeps today's eager command read, so older hosts never get a slower first menu; a modern host may run one discovery pass in that window. Here one pass describes a stable enabled client/host/session, idle request queue and unchanged context; additional refreshes, reconnects, retargeting or context retirement can add work. After support is confirmed, discovery is menu-driven. Reconnects, retargeting and explicit later menu actions are separate demand; a late command list can still require reopening the menu before support is known, and earlier compatibility work can drain after support arrives. This is not a universal process-count limit.

The full review completed three behavioral rounds. Fixes cover absent-to-absent retirement wakes, lost change hints, retained versus missing pending lists, cold-failure recovery and settled-success polling. The design rulings were implemented and independently rechecked. Final capability-boundary proof confirms the intended pre-report eager path and suppresses new automatic closed-menu demand after positive support. The final common-pattern comparison labels the supported older-peer delivery, authoritative remote context, bounded phone recovery and unchanged Codex pooling as intended adaptations. /permissions forwarding unchanged to the provider is intended; it does not promise provider support. No known product defect or scaling concern is deferred.

Verified:

  • Production-path N/10N contracts for both catalogs, mixed older/current subscribers, expiry, scoped retirement, overlapping cleanup/replacement and zero passive acquisition; a separate production-hook contract counts unaffected chat renders and RPC operations.
  • Ten genuine previous-build resting contexts restored through graceful upgrade. Claude and Codex each produced two real replies; menus reopened and completed tokens. OMP exposed 67 catalog rows and completed its skill token.
  • Windows resting baseline/branch inputs and results matched (50 catalog tuples, 51 menu items, same two-source skill completion). One held-open menu replaced profile A→B→A rows without changing its draft/caret. Profile labels are local fixture metadata, not login evidence.
  • Fresh macOS capture on 98d6f359 classified every observed current launcher against a proxy root, and recorded native Codex/Git descendants. Conservative captured-set interval peaks: 2 roots, 1 command root, 1 immediate native Codex process, 3 roots plus native, and 5 with other captured descendants. QA wrappers are separately bounded at a deliberately loose 10. The normal pooled request and action-free grace ended; all recorded owned processes exited and assigned ports cleared. Windows open/switch/return children also exited; closed-menu windows recorded no probe starts.

Evidence limits: historical purposes for the retained unknown roots and earlier resolver-bypass families cannot be assigned. Sampling at 20 ms/200 ms, unsupported kernel descendant tracking and short/deep process loss preclude a universal physical cap or exact kernel-overlap claim. The fresh bounded checks passed; no product regression was demonstrated. Failed sampler/driver captures remain recorded and only their unfinished steps were repeated. A hash-only real-config change during the first capture was recorded; the repaired capture left all four monitored hashes unchanged. Phone validation ran in CI only; no phone app run is claimed.

Review is on 4e8a4fc69072b2c5f0d87a8bbf8c0fb57ed32b16. Shared-agent QA is on 62e98bf44f32167ac00e3ea26635140c27f5dc18. Subsequent non-shipped proof commits are 98d6f35991087270534a2fcc37e86f735e3a3702, 64749cf251767c3e4b8f646ae9741af168cb7ce9 and fixture typing repair 4e8a4fc69072b2c5f0d87a8bbf8c0fb57ed32b16; targeted Windows/macOS QA also ran on 98d6f359. Merge c8722b44772a7d1e2a39c9b7a65e9e7d98860815 brings in main b95b11cc under the conflict exception. Both manual resolutions and all 17 overlap interactions were independently checked; six targeted suites passed 79 tests. Runtime bytes remain unchanged since that merge, so the accepted QA and screenshots carry.

The added contract proof runs the actual capability producer, lane, menu callbacks and host catalog dispatch/settlement. It covers held startup/reconnect status, false/refused/timeout outcomes, queued refresh draining, stale-target ownership and N/10N demand without status-retry amplification. Its 38 unique targeted root tests and all 11 new phone cases passed; the final phone fixture passes the typecheck ratchet. Final CI is green on the reviewed head: static analysis/typecheck, all ten root-test shards, Mobile verify, mixed-version wire compatibility, packaging and all three WSL distro checks passed.

For Brennan’s review

Restoration and command menus (macOS)
Previous build, resting chat Upgraded branch, same saved chat
Previous-build resting chat Restored chat on the branch
Claude command menu Codex skill menu
Claude command menu Codex skill menu

The Codex screenshots retain a failed gpt-5.4 setup attempt from baseline history. The baseline subsequently succeeded with GPT-6.1-Sol, and both branch replies below succeeded.

Real replies and OMP catalog/completion
Claude: two branch replies Codex: two branch replies
Two real Claude replies after upgrade Two real Codex replies after upgrade
OMP menu (67 catalog rows verified) OMP skill completion
OMP command menu OMP completed skill token
Matched Windows baseline and held-open account menu
Previous-build resting menu Branch, same saved chat and menu
Baseline profile A menu Branch profile A menu
Previous-build completion Branch completion
Baseline collision completion Branch collision completion
Same menu after A→B Same menu after B→A
Held-open menu shows profile B row Held-open menu returns to profile A row

Selection used the production local account-selection API with declared fixture profile labels and real provider authentication. This proves menu replacement, not an OAuth flow or a specific refresh-latency guarantee. The draft, caret and composer stayed the same.

Three code spots where judgment matters:

@brennanb2025
brennanb2025 merged commit e08cb10 into main Oct 29, 2026
55 of 56 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/lu-at-rest-probes branch October 29, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant