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’s work-item list/count flows and the source-selector types, then update both PR paths to resolve the repository using the selected preference. I’ll inspect existing tests and run the focused test suite (without modifying tests), followed by a diff/status check.
- Assistant
The relevant implementation is concentrated in
listWorkItemsand its query helper. I’m now reading those sections plusIssueSourcePreferenceresolution semantics to ensure the fix preserves issue behavior, auto mode, connection handling, and SSH safeguards. - Assistant
The bug is confirmed:
listWorkItemsalways assignsgetOwnerRepo(origin)to the PR side, andcountWorkItemsdoes the same. The correct compatibility rule is to retain origin forauto/default behavior, while using the preference-resolved source for explicitupstream(including its existing fallback-to-origin behavior); explicitoriginremains origin. I’ll make that selection in both functions, preserving the separate raw upstream candidate used by the UI. - Assistant
The first edit attempt was blocked because this environment has no
pythonexecutable; no file was changed. I’ll apply the same precise replacements using Node, then inspect the resulting diff. - Assistant
The implementation now routes explicit upstream selection consistently through list and count paths, while leaving default/auto PR behavior unchanged. I’ll run the two affected GitHub client test files and typecheck the Node target to catch both behavioral and typing regressions.
- Assistant
The test command did not execute because Corepack attempted an interactive pnpm download and timed out; this is an environment/tooling issue, not a test failure. I’ll use the repository’s locally installed binaries directly (if present), avoiding Corepack prompts, and inspect dependency availability first.
- Assistant
Both focused suites pass (29 tests), and the Node typecheck completed without diagnostics. I’ll perform final whitespace/diff checks and verify that only the intended client changes remain before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.