ISSUE DESCRIPTION Tasks PR Upstream source still queries origin This was generated by AI…
- User
ISSUE DESCRIPTION
Tasks PR Upstream source still queries origin
This was generated by AI during triage.
Summary
In the Tasks page, selecting the
PRstab and choosingUpstreamin the source selector can showNo matching GitHub workeven when matching upstream PRs exist.The upstream/origin selector is visible in the PRs view, but the GitHub client still resolves PR list/count queries from
origin, sois:pr is:open author:@mesearches the fork/origin repo instead of the selected upstream repo.Reproduction
- Open a forked repository in Orca where
originpoints to the fork andupstreampoints to the canonical repo. - Open Tasks.
- Select
PRs. - Select
Upstreamin the source selector. - Use a PR-only query such as
is:pr is:open author:@me.
Actual behavior
The list can be empty with
No matching GitHub work, despite matching PRs existing in the upstream repository.Expected behavior
When
Upstreamis selected, PR list and PR count queries should use the upstream owner/repo, so the PRs tab returns matching upstream PRs.Code evidence
src/main/github/client.tsresolvesissueResolvedwith the selected preference, but resolvesprOwnerReposeparately viagetOwnerRepo(repoPath, connectionId), which is the origin repo.listWorkItemspasses thatprOwnerRepointo both recent and queried PR fetches.countWorkItemsuses the sameprOwnerRepofor PR count queries, so pagination/count can also be wrong.src/renderer/src/components/TaskPage.tsxrenders the selector usingorigin={s.sources.prs}andupstream={s.sources.upstreamCandidate}, which makes the control appear relevant in the PRs surface while the backend still routes PR queries to origin.
Suggested regression coverage
Add tests for:
listWorkItems('/repo-root', 10, 'is:pr is:open author:@me', undefined, 'upstream')using the upstream slug in--repo.countWorkItems('/repo-root', 'is:pr is:open author:@me', 'upstream')building a search query with .
- Open a forked repository in Orca where
- Assistant
I’ll trace the GitHub client methods and existing tests, verify how source preferences are represented, then update PR owner/repo resolution so both listing and counting honor the selected source. I’ll run focused tests (and broader relevant tests if available) without modifying test files.
- Assistant
The client has dedicated
prOwnerRepohandling and already has source-aware issue resolution. I’ll inspect the surrounding implementation and the source-resolution utilities/tests to determine the smallest consistent change, including fallback behavior when an upstream remote is unavailable. - Assistant
The bug is exactly in both fan-outs:
resolveIssueSourcehonorsupstreamfor issues, while PRs independently callgetOwnerRepo(origin). I’ll retain origin fororigin,auto, and unspecified preferences, but use the resolved preference-aware source for PRs when preference isupstream; this also naturally falls back to origin if upstream is missing, matching existing issue-source semantics. Count logic will use the same selected PR repository. - Assistant
The first edit attempt was blocked because this environment has no
python3; no files changed. I’ll apply the same targeted replacements using the repository’s available shell tooling, then inspect the diff. - Assistant
apply_patchis also unavailable, so I’ll use a short Node-based literal replacement (Node is already required by this TypeScript project). The replacement is constrained to the two exact blocks and will fail loudly if source text differs. - Assistant
The implementation now routes both queried/recent PR listing and count searches through the selected upstream owner/repo, while preserving existing fallback behavior. I’ll run the focused GitHub client tests and type/lint checks available from the project scripts.
- Assistant
The focused test command failed before running tests because this Vitest version does not support the supplied
--minWorkersoption. I’ll rerun with supported options, then run the node typecheck to catch any TypeScript issues. - Assistant
The combined verification command timed out because
pnpminvoked Corepack and requested an interactive download; this is an environment issue, not a test failure. I’ll run Vitest separately (which does not need that prompt), and use the locally installed TypeScript binary directly for typechecking. - Assistant
This Vitest build also rejects
--poolOptions; I’ll use only its default supported CLI invocation. If worker startup remains problematic, I’ll record that limitation and still validate with the local compiler and static diff checks. - Assistant
Verification succeeded: both focused test files passed (29 tests), the Node TypeScript check passed, and
git diff --checkfound no formatting errors. The change is limited toclient.ts; no tests were modified. I’ll do one final diff/status review and then submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.