Skip to content

fix(verify): propagate harness session past extra env prefixes - #551

Merged
solomonneas merged 1 commit into
mainfrom
t3code/fix/541-env-prefix-harness-session
Jul 26, 2026
Merged

fix(verify): propagate harness session past extra env prefixes#551
solomonneas merged 1 commit into
mainfrom
t3code/fix/541-env-prefix-harness-session

Conversation

@solomonneas

Copy link
Copy Markdown
Collaborator

Root cause

The shell and Brigade process received both environment assignments. The second invocation hit verify result reuse because its command and tree matched case A. _write_reused_receipt built the cache-hit receipt without stamping BRIGADE_CLAUDE_SESSION; only _run_verify_commands stamped fresh receipts.

The fix moves the existing 16-hex stamping rule into _stamp_harness_session and calls it from both fresh and reused receipt writers.

Reproduction after the fix

Case A, fresh receipt:

{
  "run_id": "20260726-203955-work-verify-f16366",
  "reused_from": null,
  "harness_session": {
    "harness": "claude",
    "fingerprint": "0123456789abcdef"
  }
}

Case B, two outer environment prefixes and a reused receipt:

{
  "run_id": "20260726-203956-work-verify-0bc5b3",
  "reused_from": "20260726-203955-work-verify-f16366",
  "harness_session": {
    "harness": "claude",
    "fingerprint": "fedcba9876543210"
  }
}

The regression test invokes the real CLI through /bin/sh for both shapes. Existing behavior for environment assignments inside --command remains covered.

Verification

  • Full gate: ./scripts/verify
  • Brigade receipt: 20260726-203339-work-verify-d83604
  • Status: completed
  • Exit code: 0

Closes #541.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aec71f7b-b688-405f-b6ce-e52ab551b374

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/fix/541-env-prefix-harness-session

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@solomonneas solomonneas self-assigned this Jul 26, 2026
@solomonneas
solomonneas merged commit cd00152 into main Jul 26, 2026
28 checks passed
@solomonneas
solomonneas deleted the t3code/fix/541-env-prefix-harness-session branch July 26, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

work verify: harness_session silently dropped when the invocation carries a second env prefix

1 participant