Skip to content

Follow-up from #2338: pr threads fetch accepts only exit 0, so real gh GraphQL errors bypass the scrubbed NOT_FOUND path #241

Open

Description

@oxa-agent

From the exact-head review of oxstack/ox-llm#2338 (head 96bef23734e1293001b2b13ffb1cf3d99d638bbd), P2.

oxa/oxa-cli/src/pr_threads_cmd.rs:220: fetch calls run_accepting("gh", ..., &[0]), but real gh api graphql exits 1 on GraphQL errors. Verified live with the PR's exact query: a non-existent PR number makes gh exit 1 and print {"data":{"repository":{"pullRequest":null}},"errors":[{"type":"NOT_FOUND",...}]} on stdout. With ok_codes=[0] the command returns the generic gh exited with status 1 (is gh auth status logged in, and does the repository exist?); the scrubbed doc["errors"] path and the PR #N was not found NOT_FOUND path never run with real gh, and the hint blames auth for a missing PR.

Fix: accept exit 1 here (as pr_checks accepts 0/1/8) and keep the existing errors/null parsing and credential scrubbing. Add a mock-gh test that answers with exit 1 and an errors body, asserting the scrubbed message / NOT_FOUND code.

Activity

  1. transferred this issue fromon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions