Repository navigation
perf: group Space decision inputs by workspace - #26297
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe projection now groups agent statuses, migration entries, retained agents, and open files by worktree. It passes each worktree’s grouped inputs to Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This change groups the inputs used by the Space decision logic by workspace to reduce repeated scans. It is not expected to change what the page displays or deletes. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description covers the required explanation, changes, rationale, visual proof, testing, limitations, review notes, and checklist. However, the required Linked Issue section has no issue link and states that no existing issue is linked.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
ELI5
The Space view repeatedly searched every agent record and open file for each workspace whenever a terminal title changed. It now groups those records once and gives each workspace only its relevant inputs, keeping the same display and deletion decisions.
What Changed
The existing Space decision hook memoizes an index of live agents, migration warnings, retained agents and open files by workspace. It rebuilds when their source records, tabs or scan rows change. The existing decision code still evaluates freshness, title activity, dirty drafts, host identity and deletion readiness. The index reuses the existing pane-key parser, including legacy keys, and retains no state outside the mounted hook.
Why
Repeated global scans multiply work by the number of scanned workspaces. Grouping source references removes that repeated work without changing status authority, dropping records, limiting visible rows or caching freshness verdicts.
A hidden Electron check mounted the actual complete Space page and panel with production components, controllers and store actions. With 300 generated workspaces, 500 retained agents and 40 live agents, five alternating paired trials reduced median complete-panel title publication from 30.1 to 21.0 ms. Both versions made the same 300 controlled Git-status requests. Complete rendered text and status, retention, draft and freshness controls matched; before/after screenshots are byte-identical.
An isolated production-React hook check reduced title publication from 11.6 to 0.19 ms at the same size, and 1.65 to 0.095 ms with 100 workspaces. Empty and one-workspace cases were essentially unchanged. This is a Space-view improvement; it does not establish the cause of the intermittent Codex typing pause.
Linked Issue
Performance audit; no existing issue linked.
Visual Proof
Before:
After:
These hidden-renderer screenshots use the same generated fixture and are byte-identical. The timing above measures the complete panel’s response to real title publications.
Testing
__proto__keys, migration workspace-or-tab ownership and deferred metadata refreshes. The formatted production modules emit identical code to the measured proposal.Native timing was macOS/Electron with generated scan rows and controlled Git-status responses; it did not exercise a real PTY, Git scan or connected SSH host. Existing host-aware decision and deletion logic is unchanged and covered by routing tests. No Windows/Linux timing claim.
Review
Independent source, regression and native-evidence review found no blocker. The change reads the existing agent-status store and preserves its presentation rules. It adds no polling, global cache, status producer, remote protocol, design-system changes or freshness delay.
Agent skill upstream boundary
Checklist