Skip to content
TheChatArchiveThe Chat Archive
x-ai/grok-4.5· unknownHugging 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 start by exploring the repository structure and the files mentioned in the issue.

  3. Assistant

    Examining how prOwnerRepo and issue resolution work in the GitHub client.

  4. Assistant

    rg is not available, let me use grep.

  5. Assistant

    Reading the relevant sections of client.ts and related helpers.

  6. Assistant

    Looking at how issue source preference is resolved and how TaskPage wires the selector.

  7. Assistant

    Checking getOwnerRepo vs origin remote and existing tests for the expected behavior.

  8. Assistant

    Let me read those functions fully.

  9. Assistant

    Reviewing existing tests and docs for guided fix patterns.

  10. Assistant

    Examining how IssueSourceSelector uses origin/upstream and how sources.prs is consumed.

  11. Assistant

    Checking the sources type definition and how the PR tab shows the selector.

  12. Assistant

    Let me read the types definition carefully.

  13. Assistant

    Checking design docs and related discussions about issue source preference.

  14. Assistant

    Reviewing list/query helpers and recent history around this code.

  15. Assistant

    Inspecting how sources.prs is used for filtering and display.

  16. Assistant

    Checking how PR list args and tests expect --repo to look.

  17. Assistant

    Implementing preference-aware PR owner/repo resolution in listWorkItems and countWorkItems, while keeping sources.prs as origin so the selector still works.

  18. Assistant

    Updating listWorkItems and countWorkItems to resolve PR owner/repo from the preference.

  19. Assistant

    Updating countWorkItems the same way.

  20. Assistant

    Update countWorkItems similarly.

  21. Assistant

    Updating the outdated selector comment, then verifying with tests.

  22. Assistant

    Updating the selector docs and tooltip so they reflect that the preference now applies to PRs too.

  23. Assistant

    Update the tooltip text too.

  24. Assistant

    Updating the remaining outdated comment near the tooltip.

  25. Assistant

    Creating a temporary script to reproduce the issue and verify the fix.

  26. Assistant

    Running existing related tests to check for regressions.

  27. Assistant

    Verifying the final diff.

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