Repository navigation
fix(github): route runtime repo paths by execution host - #33194
Ethereal49 wants to merge 3 commits into
Conversation
When a repo path is registered on both SSH and a paired runtime, path-only lookup could send the SSH-side repo ID to the runtime. Prefer the row owned by the target runtime, then retain the original first-path fallback. AI-Assisted: OpenAI Codex Signed-off-by: ethereal49 <hongyeluo49@gmail.com>
|
No actionable comments were generated in the recent review.
|
|
Thank you @Ethereal49 for this fix and for the clear write-up. Your diagnosis was right: when one folder path has both an SSH row and a paired-server row, the GitHub request to the server could carry the SSH row's repo id, so PR status never loaded. We shipped your commit as-is, with your authorship kept, in PR #33257. On top of it we added two things. The lookup now prefers the repo id the caller already has, and it uses the store's repo index instead of scanning the list. Current main has a test that limits repo reads during a refresh sweep, and the list scan went over that limit. We also dropped the fallback test, because it pinned sending another host's repo id to the server. Your two regression tests are in the PR and fail on main without the fix. Thanks again! |
ELI5
Orca can know the same repository under two different registrations: one over SSH and one on a paired runtime. When both use the same folder path, the GitHub client could pick the SSH registration and send its local repo ID to the runtime. The runtime does not know that ID, so the PR status never loaded. This change makes the client prefer the registration that belongs to the runtime it is asking.
What Changed
When a GitHub request is routed to a runtime environment, the shared repo resolver now:
This covers PR refresh and the shared work-item request path, including pagination, counts, prefetch, issue/PR comments, review threads, and check details. Explicit GitHub task-source contexts already used their own
repoIdand keep that behavior.The general path lookup is unchanged, so callers that only know a path keep their existing first-registration semantics.
Why
findByPath()is first-registration-wins. A legacy SSH row for the same path can therefore win over a runtime row and produce a repo ID that the runtime rejects withrepo_not_found.Passing the candidate
repoIdeverywhere would require wider changes and does not help callers that genuinely only have a path. Filtering by the target runtime's execution host at the shared resolver fixes both affected surfaces with one small change and preserves the old fallback.Linked Issue
Fixes #32997
Visual Proof
N/A: this only changes which repo row is used for GitHub runtime RPCs. There is no UI or interaction change to capture.
Testing
Commands run:
Result after merging the latest
origin/main@35157974b99d: 2 files passed, 21 tests passed.The new PR case previously sent
repo: 'repo-ssh'togithub.prForBranch; it now sendsrepo: 'repo-runtime'. The new work-item case previously sentrepo: 'ssh-repo-id'; it now sendsrepo: 'runtime-repo-id'. A third assertion keeps the existing first-path fallback when the target runtime has no matching row.Also passed:
tsc --noEmit -p config/tsconfig.web.json --composite falsenode config/scripts/check-changed-code-quality.mjsoxfmt --checkon the three changed filesgit diff --checkNot run: a real paired runtime plus legacy SSH registration, full
pnpm lint/pnpm test/pnpm build, and upstream CI. I did not claim manual end-to-end verification.AI Disclosure
Codex harness; model
deepseek-v4.1-flash; reasoningmax. AI assisted with code analysis, implementation, tests.Review
Please focus on the runtime-owner filter/fallback in
getRuntimeRepoTarget()and confirm that explicit GitHub source contexts and local/SSH routing remain unchanged.Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (targeted web typecheck, tests, and changed-code quality passed; full local gates not run)