Skip to content

perf(runtime): coalesce project lineage refreshes - #13638

Merged
nwparker merged 1 commit into
mainfrom
nwparker/perf-coalesce-runtime-lineage-refresh
Aug 11, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/perf-coalesce-runtime-lineage-refresh

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • suppress each per-repo automatic lineage snapshot only when a runtime project event owns a final host-wide refresh
  • reduce runtime worktreesChanged handling from 2 lineage RPCs to 1
  • reduce runtime reposChanged handling from R + 1 lineage RPCs to 1 for R repos
  • run the final host-pinned snapshot after every repo worker settles, including repo failure paths
  • preserve both repo and lineage errors if both stages fail
  • leave standalone, local, and direct-SSH worktree refresh behavior unchanged

ELI5

Lineage is the remote Orca server family tree for all workspaces on that server. Previously, when a server reported project changes, the client asked for the entire family tree once after refreshing every individual project, then asked for it one more time at the end. A server with 20 projects could therefore receive 21 copies of the same full-server request.

Now the client refreshes the project lists first and asks for the full family tree once at the end. A single worktree-change event also drops from two family-tree requests to one.

Compatibility

  • no RPC names, parameters, response shapes, or stream content changed
  • mixed client and remote-server versions remain supported
  • the final request stays pinned to the runtime that emitted the event
  • folder-workspace lineage remains included in the final host-wide snapshot
  • direct SSH and local callers keep their existing paths

Validation

  • two independent adversarial reviews: READY, no P0-P2 findings
  • focused scheduler, IPC-event, and worktree tests: 386 passed
  • typecheck passed
  • Electron build passed
  • lint passed
  • ORCA_CROSS_VERSION_BASELINE_REF=v1.4.177 pnpm test: 4,595 files passed; 49,280 tests passed; 16 files and 99 tests skipped
  • git diff --check passed

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 399584b2-b0ed-4355-9705-c53c57f4f151

📥 Commits

Reviewing files that changed from the base of the PR and between ee7e743 and 0b8f48f.

📒 Files selected for processing (7)
  • src/renderer/src/hooks/runtime-project-refresh-scheduler.test.ts
  • src/renderer/src/hooks/runtime-project-refresh-scheduler.ts
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/store/slices/worktree-helpers.ts
  • src/renderer/src/store/slices/worktrees.test.ts
  • src/renderer/src/store/slices/worktrees.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/store/slices/worktrees.test.ts
  • src/renderer/src/store/slices/worktree-helpers.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/store/slices/worktrees.ts
  • src/renderer/src/hooks/runtime-project-refresh-scheduler.test.ts
  • src/renderer/src/hooks/runtime-project-refresh-scheduler.ts

📝 Walkthrough

Walkthrough

Runtime worktree refreshes now suppress per-repository remote lineage requests. A new scheduler refreshes all repositories and then fetches host-wide lineage. It preserves repository failures, rethrows lineage-only failures, and combines simultaneous failures in an AggregateError. Runtime IPC refresh handling uses this scheduler and passes the suppression option. Tests cover request options, explicit lineage fetching, refresh ordering, and combined errors.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and validation, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections and document the AI review, cross-platform compatibility checks, security audit, screenshots status, and follow-up notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: coalescing runtime project lineage refreshes.
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.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f48fec6-2c19-4bff-9625-1f1f343ff18f

📥 Commits

Reviewing files that changed from the base of the PR and between c0c893d and 205b86e.

📒 Files selected for processing (7)
  • src/renderer/src/hooks/runtime-project-refresh-scheduler.test.ts
  • src/renderer/src/hooks/runtime-project-refresh-scheduler.ts
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/store/slices/worktree-helpers.ts
  • src/renderer/src/store/slices/worktrees.test.ts
  • src/renderer/src/store/slices/worktrees.ts

@nwparker
nwparker force-pushed the nwparker/perf-coalesce-runtime-lineage-refresh branch from 205b86e to 0b8f48f Compare August 11, 2026 05:53
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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