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 withrepo:<upstream-owner>/<repo>.
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /orca, current file: none) bash-$
- Open a forked repository in Orca where
- Assistant
I’ll trace the GitHub client methods and source-selection data flow, identify how
issueResolveddiffers fromprOwnerRepo, then make the smallest targeted change so PR list and count use the selected source. I’ll run focused tests (and broader relevant tests if available), inspect the diff, and only submit once behavior is verified. - Assistant
The relevant implementation is in
client.ts, and existing issue-source tests already cover upstream behavior for issues. I’m now inspecting the resolver signatures and nearby tests to preserve argument compatibility and ensure both list and count paths select the upstream PR repository only when the preference requests it. - Assistant
The fix is to derive the PR repository from the same preference-aware resolution: explicit
upstreamusesissueResolved.source(including its existing fallback-to-origin behavior), whileorigin/autoretain the current origin PR behavior. The raw upstream candidate remains only for selector metadata. Count must apply the same rule, so it will use the resolved issue source for upstream preference and origin otherwise. This avoids changing defaultautosemantics while fixing the explicit selector case. - Assistant
The first edit attempt could not run because this environment has no
pythonexecutable; no files were changed. I’ll apply the same targeted replacement with Node, then run the focused Vitest suites. - Assistant
The source edit completed, but the combined verification command timed out when Corepack prompted to download the pinned pnpm version. I’ll verify the diff independently and invoke the repository’s local Vitest binary directly to avoid that interactive package-manager bootstrap.
- Assistant
The diff is clean and contains only the intended source-selection changes. The local Vitest invocation itself rejected duplicated worker flags, and the typecheck command rejected an unsupported
--incremental falseoverride for this composite project; neither indicates a code failure. I’ll rerun both with valid options. - Assistant
Verification succeeded: both focused GitHub client suites pass (29 tests), node typechecking passes, and
git diff --checkreports no formatting errors. The implementation also preserves edge cases: if explicit upstream is unavailable, the existing resolver falls back to origin; if no repository resolves, count still returns zero; andautoremains origin for PRs as before. I’m submitting the focused change now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →