Repository navigation
perf: always show project names and remove notification scans - #20931
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The notification-label changes cover the stated host-aware, fallback, and legacy-flag behaviors without an identified current-head regression. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Hoisted per-dispatch agent indexes —
countReposNeedingNotificationDisambiguationnow buildsactiveAgentTabIds(fresh entries fromagentStatusByPaneKey) andretainedAgentWorktreeIds(fromretainedAgentsByPaneKey) once per dispatch instead of rescanning both collections inside everyhasActiveWorktreeStatecall. hasActiveWorktreeStatetakes the precomputed sets — its early-return order (live PTY → browser tabs →workspaceStatus === 'in-progress'→ retained agent → fresh agent tab) is unchanged, so the worktree-level verdict is preserved.- New regression test at reported scale — 870 workspaces / 27 repos / 177 agent rows with counted getters pins
paneKeyReads <= 177andretainedWorktreeReads <= 1; the same suite covers empty buckets, stale/live-PTY/suppressed/mirrored/restored freshness, hydration repo buckets, and folder workspaces. Verified locally: 4/4 pass.
The transformation is a faithful index hoist: the original computed worktree tab ids ∩ fresh agent tab ids, the new code computes worktree tabs ∩ global fresh agent tab ids — the same intersection. Only benign differences remain (shared now per dispatch; a pure freshness predicate invoked for a few extra non-worktree tab ids). getWorktreeMapFromState is still called per worktree but is WeakMap-cached in store/worktree-repo-index.ts, so it is not a lingering scan.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Dropping hasMultipleActiveRepos from the dispatch payload leaves an existing test asserting it, so that suite is now red.
Reviewed changes
Incremental review of ca00c091 (perf: always label notifications and remove project counting) since the prior Pullfrog review on 3b91ada.
- Deleted the agent-inventory scan — removed
countReposNeedingNotificationDisambiguation,countReposWithWorktrees, andhasActiveWorktreeState; label resolution no longer readsagentStatusByPaneKeyorretainedAgentsByPaneKey. - Added
getNotificationWorkspaceLabels— resolves project/workspace names from the cached repo/worktree maps for Git workspaces and the host-indexed folder/project-group owner lookups for folder workspaces, failing closed on cross-host id collisions and falling back to the terminal title thenworkspace. - Always render the project name —
formatNotificationWorktreeContextprependsrepoLabelunconditionally; the legacyhasMultipleActiveReposfield remains in the shared type as accepted-but-ignored. - New and updated tests —
terminal-notification-state.test.ts(8 tests) covers label resolution and the no-scan guarantee via throwing getters; the formatter test is parameterized over the legacy flag.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
ca00c09 to
a634bc7
Compare
There was a problem hiding this comment.
🟡 Minor · Preserve host ownership when resolving non-folder notification labels.
src/renderer/src/components/terminal-pane/terminal-notification-state.ts:155-171
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPreserve host ownership when resolving non-folder notification labels.
getNotificationWorkspaceLabelsresolves a non-folder notification through the ID-only worktree map. When the same worktree ID exists on multiple hosts, the map retains one row, so a notification from the other host can display the retained worktree and repository labels. This affects presentation only; these fields do not control click routing or delivery. Preserve host context during lookup, or fail closed for ambiguous IDs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 3a50dc4d-d6e6-408b-9c06-859bc9f4fd37
📥 Commits
Reviewing files that changed from the base of the PR and between ca00c091b67fa03e65876388f82cd41d85af7b9e and a634bc7.
📒 Files selected for processing (1)
src/renderer/src/components/terminal-pane/use-notification-dispatch.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
Important
No new issues in this delta — the branch was rebased onto current main and the PR's own changes are unchanged. The previously flagged failing test is still red, so the PR is not mergeable as-is.
Reviewed changes
Incremental review of a634bc7d since the prior pullfrog review on ca00c091. The delta is a rebase plus no net change to the PR's own diff.
- Rebased onto current
main—git diff ca00c091..HEADrestricted to the PR's six files shows onlyuse-notification-dispatch.ts, and only becausemainindependently introduced theresolveAgentAttention/applyAgentAttentionflow; the PR'sgetNotificationWorkspaceLabelssubstitution re-applied cleanly insiderequestDelivery. - PR behavior unchanged —
getNotificationWorkspaceLabelsstill resolves Git/folder labels without reading the agent inventory,formatNotificationWorktreeContextstill prependsrepoLabelunconditionally, andhasMultipleActiveReposremains accepted-but-ignored.request.workspaceIdalways equals the outerworktreeId, so no label or liveness semantics shifted. - Tests —
terminal-notification-state.test.ts(8),notifications-message-formatting.test.ts(15), anduse-notification-dispatch.test.ts(34) pass;tc:webis clean.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Folder notifications resolved the folder host-aware, then looked its project group up by bare ID. The owner index fails a bare ID closed when two hosts publish the same group ID, so a remote folder lost the project name the catalog already had. Also drops the identity rescans that recovered display fields: the catalog finders now return the caller's row type, matching findIndexedRepoOwnerForHost. Updates the idle-arbitration expectation that still asserted the removed hasMultipleActiveRepos flag.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Incremental review of dc79cbf since the prior Pullfrog review on a634bc7. The delta fixes the previously flagged red test and tightens folder project-group host resolution.
- Fixed the red idle-arbitration suite — removed the stale
hasMultipleActiveRepos: trueassertion frompty-connection-hook-idle-arbitration.test.ts, so the suite is green again (5/5); the prior blocker thread is replied to and resolved. - Host-qualified the folder project-group lookup —
getNotificationWorkspaceLabelsnow resolves the group withgetCatalogOwnerHostId(folder)as the host, so a folder onssh:serverselects thessh:servergroup instead of failing closed when the same group id also exists locally. - Generic owner-lookup returns —
findIndexedFolderWorkspaceOwner/findIndexedProjectGroupOwnergained<T extends …Record>and returnT | null, matching the existingfindIndexedRepoOwnerForHostpattern; the call site drops its identity.findnarrowing. - Regression test —
qualifies project groups by the folder host (legacy SSH: %s)covers bothconnectionIdandexecutionHostIdstamping and fails against the unqualified lookup.
Verified locally: terminal-notification-state.test.ts (10), pty-connection-hook-idle-arbitration.test.ts (5), notifications-message-formatting.test.ts (15), and use-notification-dispatch.test.ts (34) all pass; pnpm tc:web clean; check:code-quality:changed passes with 0 new findings.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ai#20931) * perf: avoid repeated agent scans when labeling notifications * perf: always label notifications and remove project counting * fix: qualify the notification project group by its folder's host Folder notifications resolved the folder host-aware, then looked its project group up by bare ID. The owner index fails a bare ID closed when two hosts publish the same group ID, so a remote folder lost the project name the catalog already had. Also drops the identity rescans that recovered display fields: the catalog finders now return the caller's row type, matching findIndexedRepoOwnerForHost. Updates the idle-arbitration expectation that still asserted the removed hasMultipleActiveRepos flag.

Background agent notifications repeatedly scanned every agent for every accumulated workspace just to decide whether to show the project name. Always include the available project name and delete that decision path entirely.
Behavior
Project / Workspace - Codex finished(or the current agent/status).workspace; do not expose an internal workspace ID.hasMultipleActiveReposrequest field accepted but ignore it. No remote transport, status ownership, or lifecycle changes.The final production change removes the global count and temporary sets. No new cache. Benchmark machinery remains independent in draft #20934.
Validation
Earlier before/fix/reversal runs established the bottleneck: original p90 57–90 ms; the intermediate scan-once version 20–23 ms; restoring the original build brought p90 back to 71 ms. Corrected-byte-rate baseline was 85 ms p90 / 341 ms maximum. The final implementation removes the scan altogether; these are synthetic timings, not a claim that all STA-7551 symptoms are resolved. Buffer timing is not pixel paint; native-focus behavior and live paired-host execution are not exercised.
The original profile (~10 MB durable state) is not reproduced in full. The fixture has 870 saved workspaces, 27 repositories, 1,410 terminal tabs, 2,000 unified tabs, 857 sleeping records and 177 statuses. Twenty-three real PTY producers alternate working/waiting through the production OSC parser and 33 ms batching.
Native banners are not displayed on the user's desktop; tests verify the exact Electron notification options. Hidden-renderer screenshots verify the terminal echo and attention state.
Addresses https://linear.app/stably/issue/STA-7551/urgent-live-terminal-typing-lag-isolate-input-from-workspace-wide
Agent skill upstream boundary
Hidden renderer proof