Skip to content

Bitbucket PR review-guide generation fails because the provider omits the head SHA #18448

Closed

Description

@AzethW

What happened

Jack reports that generating a review guide for a Bitbucket PR on a headless training host fails with:

This host did not report the pull request's head commit.

Expected: T3 Code generates a guide for the PR's current head.

Diagnosis

The Bitbucket adapter omits the head SHA required by review-guide generation.

Prior inspection of the running service executable's embedded source found that generateReviewGuide requires detail.headSha, while BitbucketPullRequestApi.ts and BitbucketPullRequestProvider.ts do not map it. The provider's getChangeRequest returns the converted PR plus body, checks and diff statistics without a head SHA.

This triage independently checked the matching release tag:

  • RawBranchSchema decodes the branch name and repository, but not source.commit.hash.
  • getChangeRequest does not populate headSha.
  • Review-guide generation sets currentHeadSha = detail.headSha ?? null and returns the exact reported error when it is null, before starting generation.

The likely fix is to decode Bitbucket's source.commit.hash and propagate it through the API result and provider detail as headSha. A regression test should verify that a Bitbucket detail response supplies the SHA and gets past this generation guard. Git fetching and model generation after that guard still need validation.

The UI failure is user-reported. Binary inspection and release-source inspection support the diagnosis; this triage did not run an end-to-end UI reproduction or inspect the affected PR's API payload.

Steps to reproduce

Reporter-described workflow, not independently replayed:

  1. Open a Bitbucket PR in T3 Code on the affected host.
  2. Request generation of its review guide.
  3. Observe the error quoted above instead of a generated guide.

Version

0.0.46-nightly.20261011.2994, release commit d07a07f33c0a1b317dea6234636976231c3688b5.

This was the latest published nightly returned by GitHub during triage. Current upstream Bitbucket decoder/provider code also still omits headSha.

Environment

NixOS, Linux x64, kernel 6.18.44; Node v26.8.2. Headless T3 Code running as t3code.service, packaged with Nix. Client application was not established.

Evidence

Reported UI error:

This host did not report the pull request's head commit.

Matching-release guard:

const currentHeadSha = detail.headSha ?? null;
if (currentHeadSha === null) {
  return yield* new PullRequestOperationError({
    operation: "generateReviewGuide",
    detail: "This host did not report the pull request's head commit.",
  });
}

Private repository names, credentials and home directory paths are omitted.

Related issues

#16301 tracks the same missing Bitbucket head SHA causing PR watches to miss a checks-passed wake after a push. This report records a separate affected feature: review-guide generation immediately fails. The proposed SHA propagation should address both.

Duplicate searches covered Bitbucket issues, "head commit", and "review guide"; no existing report of this review-guide failure was found.

Fix applied or workaround

No fix applied. No source patches, service restarts, database writes or deployments were performed. No verified workaround was found.

Filed by

Prepared by Codex, an OpenAI AI assistant, via T3 Code triage.

Posted by an AI assistant on behalf of Jack.

Activity

  1. juliusmarminge commented on Oct 12, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Thanks for the detailed report. This is already being fixed in #18402, which preserves Bitbucket's source.commit.hash as the PR head SHA so review-guide generation gets past this check. This issue will close when that PR merges.

  2. 0pilatos0 commented on Oct 12, 2026

    @0pilatos0

    Same failure on a different setup, so it isn't host-specific:

    • T3 Code 0.0.46-nightly.20261011.2994 (d07a07f), desktop app, macOS arm64, Node v26.8.2
    • Bitbucket Cloud repo
    • pullRequests.generateReviewGuide failed at 2026-10-12T07:28:45Z with "This host did not report the pull request's head commit."

    I'll confirm here once #18402 lands in a nightly.

    Via t3 triage, Claude Code (Opus 5.5).

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