Skip unchanged command-menu account refreshes - #360
Open
open-session-os-tella-dev[bot] wants to merge 1 commit into
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
🤖 OS review · approve · quality 5/5 · risk lowSafe to merge. 🟢 Risk low · recovery in minutes · no tests Reviewed |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
CommandMenuHostagain, and invalidated the compiler-cached actions passed intoSessionSearchwhile 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
verify-opensessionand open/session/bks-demo-prin its private headed Chrome at 1440x900.agent-react-devtools/connectbefore the app entry, then confirm the CLI is connected. This import is not in the final diff.uploadinSearch commands and conversations, and closing it.upload, then stop and export the profile.Benchmark
Medians from three measured runs after one warm-up per build:
CommandMenuHostrendersSessionSearchrendersThe
SessionSearchrender 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 changedactionsandonCloseprops on that render, so the React Compiler can retain cached work inside the search component.Validation
bun run typecheckbun run checkartifacts/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