Skip to content

Review run prompt formats commit-SHA fixed point as invalid refs/remotes/origin/<sha> #2046

Closed

Description

@JacobStephens2

This was generated by AI during triage.

From the 2026-11-11 fleet retrospective: across Review run Session traces (thirdshift and tourbot), reviewer subagents attempting to resolve the prompt's fixed-point ref failed with fatal: Needed a single revision (exit 128).

Agent Brief

Category: bug
Summary: prompt::pull_request_review wraps its base argument in refs/remotes/origin/{base}, even when ReviewProcess passes a 40-character commit SHA (snapshot.base_head), producing an invalid git ref refs/remotes/origin/<40-hex-sha> in the rendered Review prompt.

Current behavior:

ReviewProcess calls prompt::pull_request_review(&snapshot.base_head, ...) where snapshot.base_head is a 40-character hexadecimal commit SHA. Inside prompt::pull_request_review, origin_base_ref(base) formats refs/remotes/origin/{base} unconditionally, instructing the session to review changes "since the merge-base with refs/remotes/origin/9ce638c7...". Git has no remote-tracking ref named after a raw SHA, so git rev-parse / git merge-base against that literal string fails with exit status 128 until the agent recovers manually.

Desired behavior:

  • When a fixed point passed to origin_base_ref (or prompt::pull_request_review) is already a full 40-character (or 64-character) hexadecimal commit object ID rather than a branch name, render the commit SHA directly without prefixing refs/remotes/origin/.
  • When a branch name (such as main) is passed (including in generated prompt documentation examples if applicable, or consistent with how prompts_page renders examples), refs/remotes/origin/<branch> continues to be used.
  • Regenerate any affected prompt snapshots / site fragments (UPDATE_PROMPTS=1 cargo test prompts_page) if the canonical prompt example changes, preserving surrounding hand-written HTML.

Key interfaces:

  • origin_base_ref / prompt::pull_request_review in the prompt builder: distinguish a raw commit SHA from a branch name so the rendered merge-base target is always a valid git revision in the Review worktree.
  • Prompt verification tests (prompts_page and prompt unit tests).

Acceptance criteria:

  • Calling prompt::pull_request_review with a 40-character hex commit SHA produces a valid revision string (<sha>, never refs/remotes/origin/<sha>) in the rendered prompt.
  • Calling origin_base_ref / prompt builders with a branch name such as main still renders refs/remotes/origin/main.
  • Unit tests cover both branch names and 40-hex commit SHAs, and cargo test prompts_page passes.

Out of scope:

  • Changing how ReviewProcess fetches commits into the Review worktree.
  • Other prompt wording changes unrelated to the fixed-point revision reference.

Activity

  1. added
    bug
    ready-for-agent
    on Nov 11, 2026
  2. added
    in-progress
    agent-failed
    and removed
    ready-for-agent
    in-progress
    on Nov 11, 2026
  3. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This comment was generated by AI.

    thirdshift's Run on this issue failed, so it waits for the Day shift.

    Put ready-for-agent back to retry.

  4. added
    ready-for-agent
    in-progress
    and removed
    agent-failed
    ready-for-agent
    on Nov 12, 2026
  5. removed
    in-progress
    on Nov 12, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions