Skip to content

Skip unchanged command-menu account refreshes - #360

Open
open-session-os-tella-dev[bot] wants to merge 1 commit into
mainfrom
auto-daily-open-session-react-performance-202609110700-os-01a08f44-284c-7326-a888-1ec10a8ad2bc
Open

open-session-os-tella-dev[bot] wants to merge 1 commit into
mainfrom
auto-daily-open-session-react-performance-202609110700-os-01a08f44-284c-7326-a888-1ec10a8ad2bc

Conversation

@open-session-os-tella-dev

Copy link
Copy Markdown
Contributor

What changed

Opening the command menu refreshes the available MCP accounts. The refresh returned a new server-name array even when the ordered names were unchanged. That replaced React state, rendered CommandMenuHost again, and invalidated the compiler-cached actions passed into SessionSearch while the user was starting a search.

The refresh now keeps the current state object when the ordered server names match. Real account additions, removals, and order changes still update state.

Reproduction

  1. Launch an isolated demo with verify-opensession and open /session/bks-demo-pr in its private headed Chrome at 1440x900.
  2. Temporarily load agent-react-devtools/connect before the app entry, then confirm the CLI is connected. This import is not in the final diff.
  3. Warm up once by opening the command menu, entering upload in Search commands and conversations, and closing it.
  4. Start the React profiler, open the command menu, enter upload, then stop and export the profile.
  5. Close the menu and repeat step 4 three times.
  6. Apply the change, reload the same demo page, warm up once, and repeat the same three runs.

Benchmark

Medians from three measured runs after one warm-up per build:

Metric Before After Delta
React commit time for the interaction 37.4 ms 30.6 ms -18.2%
Slowest commit 8.8 ms 6.9 ms -21.6%
CommandMenuHost renders 2 1 -50.0%
SessionSearch renders 5 5 0.0%
Commits 17 17 0.0%

The SessionSearch render paired with the account refresh remains because its own open-PR request resolves in the same interval. The useful difference is that the profiler no longer reports changed actions and onClose props on that render, so the React Compiler can retain cached work inside the search component.

Validation

  • bun run typecheck
  • bun run check
  • Repeated the command-menu search in the isolated demo at 1440x900 and 390x844.
  • Saved desktop and phone accessibility snapshots and screenshots under artifacts/verification/opensession/react-perf-baseline-20260911-070142-3373837/ locally.

Behavior and limits

The setter returns the current array only when length, order, and every server name match. Any account-list change follows the existing update path. There are no copy, visual, API, dependency, or interaction changes.

The benchmark uses the ten-session synthetic demo dataset on Linux Chrome 146 with the React DevTools connection enabled. Commit timings include profiler overhead and vary between runs, so the table reports medians rather than the fastest run. It covers opening the palette and entering one search term, not long sessions or production data.

Started by Jaap Frolich in this OS session

Avoid replacing the MCP server-name state when a palette refresh returns the same ordered names. This keeps the React Compiler's cached command actions and close callback stable during command-menu search.

Co-authored-by: Michiel Westerbeek <[email protected]>
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
opensession Ready Ready Preview Sep 11, 2026 7:13am UTC

@open-session-os-tella-dev

open-session-os-tella-dev Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

🤖 OS review · approve · quality 5/5 · risk low

Safe to merge.

🟢 Risk low · recovery in minutes · no tests
The diff only changes React state refresh behavior, and reverting restores subsequent command-menu renders; no tests changed.

Reviewed 6c9c993 · GPT-5.6 Sol · open session · labels: os-auto-fix fix and push · os-adversarial deeper pass · os-simplify cleanup

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.

0 participants