Tasks PR Upstream source still queries origin This was generated by AI during triage.…
- User
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 withrepo:<upstream-owner>/<repo>.
- Open a forked repository in Orca where
- Assistant
I’ll trace the GitHub client’s source-resolution path and existing tests, then patch list/count behavior and run the focused suite.
- Assistant
rgisn’t installed in this workspace, so I’m using the repository’s available search tools and checking for any nested instructions before editing. - Assistant
The source preference doubles as the selector’s persistent issue/PR target, while
sources.prsis also the renderer’s only origin metadata. I’m preserving that response shape, but separating the origin metadata from the effective PR query target so explicitUpstreamroutes both PR listing and counting correctly without making the selector disappear. - Assistant
The implementation and focused regression coverage are in place. I’m running the new tests plus the existing work-item/source suites now; those existing suites verify legacy auto behavior and the renderer-facing source envelope.
- Assistant
The three focused suites pass (31 tests). Formatting and lint checks are clean so far; the Node typecheck is still running.
- Assistant
The formatter found only layout differences in the new test file. I’m applying the repository formatter, then rerunning formatting, lint, and typechecking.
- Assistant
One related UI string now became inaccurate: the selector tooltip says it only changes issues, even though the fix makes explicit Upstream apply to PR queries too. I’m aligning that copy and its comments with the corrected behavior, using the existing component and localization workflow.
- Assistant
All verification is green: 31 focused tests, formatting, lint, and the full Node/CLI/web typecheck. I’m doing one final diff review for scope and whitespace before handing it back.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.