Skip to content

fix(runtime): refresh open clients after project setup changes - #26941

Merged
OrcaWin merged 1 commit into
mainfrom
nwparker/followup-setup-publication-10-09
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
nwparker/followup-setup-publication-10-09

Conversation

@nwparker

@nwparker nwparker commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When a project's setup is created, renamed, moved, switched between Git and folder mode, or deleted through the Orca CLI or a paired client, open Orca windows now refresh right away instead of showing the old project until a reload.

What Changed

Before: the runtime's project-setup create, update, and delete calls wrote the change to the store and returned. Nothing told open desktop windows or paired clients, so the sidebar kept the old name/rows. If the setup's folder path or Git/folder kind changed, or the setup was deleted, cached worktree scans for that repository kept answering with the old rows.

After: every successful create, update, or delete sends the existing "repos changed" event, which the desktop window and paired clients already listen for. Path changes, kind changes, and deletes also run the existing shared worktree-change invalidators for that repository (the runtime scan cache, the desktop scan cache, and the sparse-checkout cache) and clear the cached folder-access roots. Those invalidators already bump a generation, so a scan that was in flight when the change landed cannot write its old result back.

Why

This reuses the event and the invalidation hook that other repository edits already use, so there is no new event type, RPC field, or remote protocol change; older clients behave exactly as before. A rename only needs a refresh, so it does not throw away scan caches. An earlier version of this PR also added a per-row ownership index and extra fleet-listing rechecks (about 1,800 lines); with the shared invalidators already fencing in-flight scans, that machinery was not needed, so this rebuild keeps only the root fix.

Linked Issue

Fixes #26562

Adapts the publication idea from #26564.

Visual Proof

N/A — no UI code changed; the existing sidebar refresh now receives an event it was previously missing.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

src/main/runtime/runtime-project-host-setup-publication.test.ts fails on current main (5/5) and passes with this change: create/update/delete publish, path and kind changes and deletes retire cached scans, and a rename does not. Existing setup controller, delete-guard, and full runtime suites pass. pnpm tc, pnpm lint, and the changed-code quality gate pass.

Review

Independent read-only review found no P0/P1 issues (notification loops, SSH host scoping, folder workspaces, wire compatibility).

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

SSH: cache retirement runs no Git or filesystem work and changes no host routing; it may refresh a same-id repository's cache on another host, which only costs a rescan. Folder workspaces keep their existing resolution path. No platform-specific code.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker
nwparker marked this pull request as ready for review October 9, 2026 23:16
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9106bdb6-6d57-42de-87fc-e9ec99bfecd4


📥 Commits

Reviewing files that changed from the base of the PR and between 513738a and 6310665.



📒 Files selected for processing (2)
  • src/main/runtime/runtime-project-host-setup-controller.ts
  • src/main/runtime/runtime-project-host-setup-publication.test.ts


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

The runtime setup controller now publishes repository changes after successful setup creation, update, and deletion. Successful updates and deletions invalidate resolved worktrees. Path or kind updates, and deletions that return a repo, also retire the repo catalog. New tests cover publication and cache invalidation for these operations.



Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 63106

The reported checks passed, and no concrete new blocker is established. The acknowledged reader issues remain outside the claimed disappearance behavior.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 12.20% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 41 functions across 24 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Issue [#26562] requires runtime setup create, update, and delete changes to reach open clients. The controller calls notifyReposChanged() after each successful operation. Update and delete call `inv…
Out of Scope Changes check Passed The changes stay within issue [#26562]. The shared invalidators support the required cache cleanup, and the tests verify that behavior. No unrelated feature, protocol change, or UI change is introduce…
Title check Passed The title clearly and concisely describes the main change: refreshing open clients after project setup changes.
Description check Passed The description includes all required sections, links the issue, explains the user impact and mechanism, documents testing, and addresses visual proof, compatibility, security, and performance. Automa…

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

… scans

Runtime setup create/update/delete changed the store without telling open
clients, and a path/kind change or deletion left cached worktree scans
answering for the old registration. Publish reposChanged after each
successful mutation and run the shared worktree-change invalidators on
path/kind changes and deletes.

Fixes #26562
@OrcaWin
OrcaWin force-pushed the nwparker/followup-setup-publication-10-09 branch from 513738a to 6310665 Compare October 11, 2026 07:15
@OrcaWin OrcaWin changed the title fix: refresh open clients after runtime project setup changes fix(runtime): refresh open clients after project setup changes Oct 11, 2026
@OrcaWin
OrcaWin merged commit d56c0fb into main Oct 11, 2026
29 checks passed
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.

[Bug]: Project setup changes made from the CLI do not reach the open window

2 participants