Skip to content
TheChatArchiveThe Chat Archive
gpt-5.6-sol· openaiHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Tasks PR Upstream source still queries origin This was generated by AI…

  1. User

    ISSUE DESCRIPTION

    Tasks PR Upstream source still queries origin

    This was generated by AI during triage.

    Summary

    In the Tasks page, selecting the PRs tab and choosing Upstream in the source selector can show No matching GitHub work even 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, so is:pr is:open author:@me searches the fork/origin repo instead of the selected upstream repo.

    Reproduction

    1. Open a forked repository in Orca where origin points to the fork and upstream points to the canonical repo.
    2. Open Tasks.
    3. Select PRs.
    4. Select Upstream in the source selector.
    5. 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 Upstream is 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.ts resolves issueResolved with the selected preference, but resolves prOwnerRepo separately via getOwnerRepo(repoPath, connectionId), which is the origin repo.
    • listWorkItems passes that prOwnerRepo into both recent and queried PR fetches.
    • countWorkItems uses the same prOwnerRepo for PR count queries, so pagination/count can also be wrong.
    • src/renderer/src/components/TaskPage.tsx renders the selector using origin={s.sources.prs} and upstream={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 repo:<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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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-$

  2. Assistant

    I’ll trace the GitHub client’s owner/repo resolution and its existing tests, reproduce the divergent origin/upstream arguments through the relevant test suite, then make the smallest shared-resolution fix and run focused plus broader validation.

  3. Assistant

    The repository already has focused work-item and issue-source client tests. I’ll now inspect listWorkItems/countWorkItems, the source-resolution helpers, and test mocks to identify whether selected-source resolution can be reused directly without changing interfaces.

  4. Assistant

    Current tests explicitly encode the old split (“upstream issues, origin PRs”), confirming the reported behavior. The production code resolves resolveIssueSource(repoPath, preference, connectionId) and getOwnerRepo(...) in parallel. I’ll inspect the exact contracts and query/count branches before deciding whether PRs should simply share issueResolved.source for all preferences or only for an explicit source selection.

  5. Assistant

    The selector preference is repository-wide despite legacy “issue source” naming, and the expected behavior says PR list/count must use the selected upstream owner/repo. The safest implementation is to resolve once via the existing preference-aware fallback contract and use that source for both sides; this also keeps explicit-upstream fallback behavior and makes counts avoid double-counting one repository. I’ll verify the complete list implementation and locate assertions that need to pass under the corrected semantics (without editing tests).

  6. Assistant

    A key compatibility detail is that existing 'auto' mode deliberately uses upstream for issues and origin for PRs, and many tests cover that heuristic. The bug concerns an explicit selector choice. Therefore, rather than collapsing auto semantics, I’ll preserve the legacy split for undefined/'auto' while making explicit 'origin' or 'upstream' selections route PRs to the same resolved (including fallback) source. This directly fixes both list and count with minimal behavioral change.

  7. Assistant

    There is an important envelope/UI constraint: sources.prs is the only existing origin slug and is passed to the selector as origin. Replacing it with the selected upstream would make origin and upstream equal and hide the selector, violating the no-new-interface constraint. I’ll therefore separate the origin metadata from the effective PR query source: keep sources.prs as the origin candidate for the control, but pass the preference-selected source into PR fetches/counts. I’ll also check other sources.prs consumers to ensure this invariant is intentional.

  8. Assistant

    Other renderer logic treats sources.issues !== sources.prs as a genuine split indicator, so preserving sources.prs=origin after querying upstream would create incorrect status UI. A better no-interface solution is already available: upstreamCandidate plus the persisted preference can derive origin only when sources.prs remains origin—but cannot derive origin after switching. Thus the current shape conflates “queried PR source” and “origin metadata.” Since the issue explicitly says no new interfaces, the likely intended patch is narrower: keep source metadata as before while only correcting backend routing, accepting that sources.prs is origin metadata by established TaskPage contract. I’ll inspect these renderer predicates to ensure they are only auto-mode indicators and then implement that intended minimal patch.

  9. Assistant

    The renderer confirms sources.prs is intentionally serving as origin metadata for both Tasks and Create Issue selectors, while effective issue source is separate. I’ll preserve that contract and introduce a small internal resolver for PR work-item queries: explicit preferences use issueResolved.source; auto/unset retains origin. Then both list and count will use the effective PR source, while list continues returning origin metadata for selector stability.

  10. Assistant

    Python is not installed in this environment, so no files changed. I’ll apply the same targeted edit using the repository editor’s edit/replace commands instead.

  11. Assistant

    The editor’s replacement command requires the target to be within its displayed window. I’ll use line-range edits bottom-to-top so earlier insertions do not shift later target line numbers.

  12. Assistant

    Review caught two line-range mistakes: the replacement omitted the closing brace of sources, and the original trimmedQuery declaration was displaced when the list-resolution block gained a line. I’ll restore both before running any tests.

  13. Assistant

    Both corrections were applied successfully; only the optional formatter check timed out. I’ll now run the two focused GitHub client suites. Existing explicit-preference tests should continue passing while exercising the changed branch, and auto-mode split tests should verify compatibility.

  14. Assistant

    The test command hit Corepack’s first-run download prompt, which cannot be answered interactively. I’ll disable the prompt and rerun; if the package manager is not cached, I’ll use the repository’s available local Vitest binary directly.

  15. Assistant

    Focused tests pass (29/29), including auto split and explicit source matrix. Static reasoning confirms the reported paths: for explicit upstream, queried PR list receives upstream in --repo; count sees issue/PR sources equal and builds one repo:<upstream> search. I’ll now update stale renderer comments/tooltips that claim the selector does not affect PRs, then run typechecking and the broader GitHub client test set.

  16. Assistant

    The tooltip’s user-facing text is now materially incorrect on Tasks (“Showing issues from” while it also routes PRs). Changing localized copy would require catalog synchronization and broaden the patch, but leaving it is misleading. I’ll update it to “Showing GitHub work from” while retaining the stable localization key, and adjust the prop/TaskPage comments. Then localization verification will tell us whether catalog artifacts need synchronization.

  17. Assistant

    The localization key has translated values in five catalogs, so changing only the fallback would leave non-English UI incorrect and catalog validation likely fails. Since the issue is backend routing and catalog changes would be disproportionate, I’ll revert the copy change and leave localization untouched. I’ll still correct the English source comments via exact line edits, which has no runtime/catalog impact.

  18. Assistant

    The successive line edits shifted the component and accidentally removed tooltip JSX. Since renderer changes are not necessary for the backend fix, I’ll cleanly restore both renderer files from Git and keep the patch confined to client.ts.

  19. Assistant

    The working tree is now clean except for the intended client change, and syntax/diff checks pass. I’ll run all main GitHub tests and node typechecking to catch interactions beyond the focused suites.

  20. Assistant

    All 191 GitHub tests and node typechecking pass. I’ll do a final format/lint check on the changed file and inspect the complete diff for accidental changes. I’ll also verify the shared result type does not promise that sources.prs is the effective query target, since it remains origin metadata for the existing selector contract.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.