Skip to content

perf(renderer): batch dashboard orchestration selection - #10149

Merged
nwparker merged 1 commit into
mainfrom
nwparker/perf-orchestration-selector
Jul 24, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/perf-orchestration-selector

Conversation

@nwparker

@nwparker nwparker commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Batch runtime-orchestration attribution once for dashboard snapshots containing
    two or more unarchived worktrees, instead of rescanning the global runtime map
    for every dashboard card.
  • Read tab membership only for the worktrees requested by the dashboard and
    preserve runtime order, duplicate-tab fanout, parent-pane attribution, and
    exact-key live/retained attribution.
  • Keep the existing per-worktree selector unchanged. A zero-worktree snapshot
    releases the batch cache, and a one-worktree snapshot uses the legacy selector
    exactly; only the multi-worktree path batches.
  • Reuse unchanged per-worktree result identities and bound all raw and derived
    cache state to the latest source generation.

ELI5

The dashboard used to reread the same global agent address book once for every
worktree card. It now reads that address book once and sorts the answers into the
requested cards. A dashboard with only one card still takes the original path,
so the optimization does not make that small case heavier.

Proof of zero regression

  • The first implementation was held after independent review found a 31%
    singleton slowdown. The final production route sends zero/one-worktree
    snapshots through the empty/legacy paths and batches only two or more
    worktrees; the same reviewer found no remaining correctness, lifecycle,
    platform, or material performance issue.
  • The final review checked attribution, runtime order, duplicate fanout, exact
    live/retained lookup, parent panes, archived filtering, partial store mocks,
    SSH-before-tab attribution, cache transitions, and bounded cache ownership.
  • Focused and related validation: 109/109 tests passed.
  • Full post-rebase suite: 3,276 files and 34,845 tests passed; 8 files and 60
    tests were skipped by the existing suite.
  • Full Node/CLI/web TypeScript checks, touched ordinary and type-aware lint,
    formatting, max-lines ratchet, localization catalog/coverage, and
    git diff --check passed.
  • Full lint passed oxlint, switch exhaustiveness, styled-scrollbar checks, 47
    reliability gates, max-lines, and bundled-guide checks. Its only failure was
    the released orca-cli revision-9 skill-manifest blocker, reproduced
    identically on clean origin/main; this diff changes no skill files.
  • The change is renderer-local and introduces no timers, I/O, paths, Git
    commands, provider behavior, or native dependencies. macOS, Linux, Windows,
    WSL, SSH, relay, and runtime hosts continue to supply the same immutable store
    snapshots.

Proof of performance improvement

  • Actual buildDashboardSnapshot benchmark, seven alternating runs of 5,000
    live-status invalidations with 128 runtime contexts:
    • 24 worktrees: 2,994.226 ms → 202.581 ms median, 93.23% lower and 14.78×
      faster.
    • 1 worktree: 145.497 ms → 146.274 ms median, +0.53%, within measurement
      noise and independently confirmed as no material regression.
  • For one invalidating 24-worktree snapshot, runtime-map enumerations fall from
    24 to 1 and runtime-context visits fall from 3,072 to 128 (95.83% fewer).
  • Unchanged source publications reuse the batch without rescanning; live-status
    churn rescans the 128 runtime contexts once while retaining the requested tab
    membership index.
  • The claim is dashboard-snapshot-only. useWorktreeAgentRows and its existing
    per-worktree selector are intentionally unchanged, so mounted consumers that
    do not receive dashboard-precomputed rows retain their prior per-consumer
    scan cost.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a cached batch selector for runtime agent orchestration across worktrees, including pane attribution, live and retained agent sources, cache invalidation, and reference reuse. Dashboard snapshots now use batch selection for multiple active worktrees, singleton selection for one, and release behavior for zero. New tests cover routing, metadata propagation, cache lifecycle, attribution parity, operation counts, and runtime scan reuse.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has useful detail, but it doesn't follow the required template and is missing explicit Screenshots, Testing checklist, Security Audit, and Notes sections. Reformat the PR description to match the template: add Summary, Screenshots (or 'No visual change'), Testing checklist, AI Review Report, Security Audit, and Notes sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title concisely and accurately summarizes the main change: batching dashboard orchestration selection for renderer performance.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@nwparker
nwparker merged commit 9181e2b into main Jul 24, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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