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 start by exploring the repository structure and the files mentioned in the issue.
- Assistant
I'll inspect how
listWorkItems/countWorkItemsresolve upstream vs origin for PR queries. - Assistant
Let me read the listWorkItems and countWorkItems functions more carefully, as well as how getOwnerRepo and issue source preference work.
- Assistant
Let me look at resolveIssueSource and getOwnerRepo, and also the existing tests around this.
- Assistant
There's already issue-source handling; I'll inspect how PR source preference should mirror it.
- Assistant
I'll inspect issue-source helpers and related tests for the right fix pattern.
- Assistant
Let me read the rest of resolveIssueSource and also look at existing issue source tests for PRs and how the selector works in the UI / IPC.
- Assistant
I'll inspect how TaskPage wires the source selector and how sources are typed.
- Assistant
Checking design docs and git history for prior work on PR source preference.
- Assistant
I'll read the issue-source selector design comments and surrounding PR-related tests.
- Assistant
The selector wiring looks fragile if
sources.prsstarts following preference — checking howIssueSourceSelectortreats origin. - Assistant
I'll check how
sources.prsis used so I can decide what the response envelope should report. - Assistant
Next I'll inspect the indicator component and related store usage.
- Assistant
I'll inspect how PR queries are built so the fix and tests match the real
--repopath. - Assistant
I have a clear plan: keep
sources.prsas origin for the UI, but route PR list/count queries through the preference when it’supstreamororigin. - Assistant
I'll navigate to the right section and reapply the edit.
- Assistant
Applying the core client changes now.
- Assistant
Updating
countWorkItemsthe same way. - Assistant
Need to goto first
- Assistant
Now apply the countWorkItems fix.
- Assistant
Checking how
listRecentWorkItemsbehaves when issue and PR sources are the same repo: - Assistant
Confirming the issues endpoint filters pull requests so shared-source listing won't double-count.
- Assistant
I'll run the related client tests and verify with a temporary script.
- Assistant
Running the related unit tests next.
- Assistant
Retrying the tests with a simpler invocation.
- Assistant
Existing tests pass. Next I'll write a temporary script to verify the upstream PR preference path.
- Assistant
I'll put the temporary test under
src/, run it, then delete it. - Assistant
Cleaning up the temp test and running the remaining work-items suite.
- Assistant
Verifying the final diff and that types are in order.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.