Repository navigation
fix(projects): enrich git remote identity for runtime-addressed repo rows - #23300
Conversation
…rows A repo row stamped `executionHostId: runtime:<env>` is how a paired client addresses a project registered in *this* process, so its files are local (`runtime-repository-registration-controller.ts`, and the helper #23184 added in `repo-execution-host.ts`). #22421 reclassified those rows as peer-owned and dropped them from the identity sweep, so `gitRemoteIdentity` never settled on remote-runtime and paired-web setups: the project stayed pending, fell back to a host-local `repo:<id>` that never grouped across hosts, and a stale automatic avatar never repaired. Reuse `getStoredRepoExecutionHostId` instead of a second host classifier, and keep skipping only a `runtime:` row that also names a nested SSH target — that target lives in the peer's dispatch table and the same path here is a different checkout. The store matches a write against the row's own stamp, so address `updateRepo` by that stamp rather than the probe host, which is `local` for these rows and would match no row at all.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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 (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughRepo identity enrichment now selects probe hosts from stored execution-host stamps and scopes identity writes to the repo row’s stamp. Tests cover nested SSH-target and self-addressed runtime rows. Avatar-refresh tests cover collisions between local rows and SSH- or runtime-stamped rows. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change appears ready to merge after normal checks. No outstanding issue is established for probing runtime-stamped repositories or updating the correct repository row. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change narrows probing of nested remote targets and directs updates to the intended project record. No new exploitable security issue was established, though changes to a project’s host configuration during a probe remain worth guarding against. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 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
- Runtime-addressed rows probe locally again.
getRepoProbeHostIdnow derives the probe host fromgetStoredRepoExecutionHostIdinstead ofgetRepoExecutionHostId+getSshTargetIdForExecutionHost, so a bareruntime:row (a paired client addressing this process) is probed onlocal, while aruntime:row naming a nested SSH target is still skipped viagetRepoSshConnectionId. - Writes are addressed to the row's own stamp.
writeIdentitypassesgetRepoExecutionHostId(snapshot)tostore.updateReporather than the probe host, which is what the store matches a write against (repo-update-operations.ts:80-83). - Tests mirror the real store and split the two host cases. The enrichment fake store now matches
updateRepo'shostIdagainst the row's stamp; the avatar suite separates thessh:buildand bare-runtime:cases and adds a runtime/local collision at the same id and path.
I checked every case of getRepoProbeHostId — local, local + connectionId, ssh:, bare runtime:, runtime: + nested target, a legacy connectionId-only row, and a malformed executionHostId — and only the bare-runtime: case changes behavior, as intended. The write host differs from the probe host only for runtime rows (which previously never wrote), so local and SSH rows are unaffected. Both added tests fail without their respective half of the fix, and pnpm test on the two suites passes locally (56 passed).
The assumption the author flags for confirmation is corroborated elsewhere in the tree: RequestedHostId treats a caller's runtime: id as naming this machine and normalizes new rows to local (with a comment that legacy rows keep their client-minted stamp), and host-repo-catalog-snapshot.ts:58 refuses to serve a remote host catalog for a runtime: request. The one route that copies an arbitrary executionHostId across (profile transfer, createTargetRepo) is same-machine only.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Orca figures out which GitHub/GitLab project a folder belongs to by quietly running
git remote -vin the background, then uses that answer to group the same project across your different machines and to fetch its avatar.For projects you added through a remote Orca machine or the web/mobile client, Orca stopped asking that question entirely. It had mistakenly decided those folders lived on somebody else's computer, when in fact they were sitting right there on the machine doing the asking. So those projects sat forever in a "still figuring it out" state: they never grouped together with the same project on your other machines, and a wrong project picture never fixed itself.
This teaches it that those folders are local, so the question gets asked again.
What Changed
Before: add a project through a remote runtime host or a paired web/mobile client. The project's remote identity never resolves. It stays pending indefinitely, gets a machine-local fallback key so it never groups with the same project on another host, and an automatic project avatar that has gone stale never repairs.
After: the same project resolves its identity on the next background sweep, groups across hosts, and repairs its avatar.
Two mechanisms were wrong, and both had to change for the row to enrich:
Which machine gets asked. Rows carry a stamp saying which host they belong to. A
runtime:<name>stamp is how a paired client addresses a project that is registered in the very process reading it — the files are local. The sweep was instead treating that stamp as proof the files were on another machine and skipping the row. It now reuses the existing helper that already encodes the correct reading, so there is one answer to "which host holds this row's files" rather than two that disagree.Which row gets written. The sweep passed the host it probed (
local) as the identifier for the row it wanted to update. The store matches that argument against the row's own stamp, so for one of these rows it matched nothing and the result was silently discarded. It now addresses the row by its stamp.Rows that name a nested SSH target on top of a
runtime:stamp are still skipped: that target belongs to the remote machine's own connection list, not this one's, and the same path here would be an unrelated checkout. There is no host this process can honestly ask.Why
This is a regression, not a long-standing gap. #22421 added a genuinely useful avatar repair, and while tightening it to avoid writing another machine's metadata it reclassified these rows as belonging to another machine. One day later #23184 wrote down the opposite (and correct) reading of the same stamp in
src/main/repo-execution-host.ts, so the two shipped in the same release contradicting each other.The alternative was a second host classifier local to the sweep. Rejected: a duplicate classifier is how the two readings diverged in the first place. Reusing #23184's helper means there is now a single place that decides this, so the next change to the rule cannot desynchronise them again.
The narrower alternative — treating every
runtime:row as unreachable and instead fixing the symptom downstream in the consumers that read a pending identity — was rejected because the identity genuinely is knowable here, and leaving it unknown keeps every downstream gate permissive.Worth a maintainer's confirmation: #22421's intent was that a
runtime:row is peer-owned. I could not find any code path that puts another machine's repo row into the store this sweep reads, and a runtime host has no notion of its own environment id to compare against, so everyruntime:stamp that reaches this store arrived from a client addressing this host. If that assumption is ever meant to change, this is the decision to revisit.Linked Issue
Fixes #
Visual Proof
N/A— no UI was changed. The user-visible effect is a background field settling, which surfaces indirectly as cross-host project grouping and avatar repair; there is no new or altered pixel to capture.Testing
Automated, in the two test files #22421 created, both of which fail before this change and pass after:
src/main/repo-git-remote-identity-enrichment.test.ts— "probes a self-addressed runtime row here and writes it back under its own stamp". Before:probeGitRemoteIdentityis never called (0 calls). After: called withlocal, and the write is addressedruntime:env-a.src/main/repo-git-remote-avatar-refresh.test.ts— "repairs a same-id runtime-addressed row under its own stamp", covering the avatar repair and per-row write addressing when a runtime row and a local row collide on id and path.Each half of the fix was confirmed necessary on its own: with only the host-classification change applied, the probe runs but the write is still addressed
localand the second assertion fails.The store behaviour that makes the second half necessary was verified against the real
Store, not the test fake:updateRepo(id, updates, 'local')on a row stampedruntime:env-1returnsnull(the write is dropped), while the same call underruntime:env-1succeeds.Still-skip coverage is unchanged and still green — the pre-existing
runtime:peer+connectionId: nestedcases in both files pass untouched, across missing, matching, and differing stored identities.One pre-existing test was corrected rather than added to:
repo-git-remote-avatar-refresh.test.tsparameterised "a foreign row must not be repaired locally" overssh:buildandruntime:peer. Thessh:buildcase is right and is kept verbatim; the bareruntime:peercase asserted the behaviour this PR fixes, so it is replaced by the corrected expectation with a comment explaining why the two hosts differ.pnpm teston all five affected suites: 173 passedpnpm tc:node: cleanpnpm run check:code-quality:changed: 0 new findingsPlatforms: this is host-classification logic with no platform branches and no new process spawning, so there is nothing platform-specific to exercise; verified on macOS.
Review
Notes
git remote -vper repo row (5s local, 20s over SSH), and runtime rows join the existing candidate set under the same retry TTLs, the 6h resolved-refresh window, the 5m startup delay, and theMAX_IDENTITY_REFRESHES_PER_SWEEP = 4cap. No ref enumeration, no--allwalk, no per-refls-tree.executionHostId: ssh:<target>. The one skip that remains is specifically to avoid dialling a peer's nested target from this client.getProjectProviderIdentityare provider-agnostic; the avatar branch this row now reaches was already scoped to icons that aresource: 'github', and that scope is untouched, so GitLab and other providers gain the identity fix without inheriting a GitHub-only assumption.runtime:row that names a nested SSH target is still never dialled from this client.repo.listsweep, so it picks the fix up with no mobile-side change.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)