Skip to content

fix(review-reviewers): resolve target repo's bot from .config/tend.toml - #256

Merged
max-sixty merged 1 commit into
mainfrom
hourly/review-24295690958
Apr 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
hourly/review-24295690958

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

The review-reviewers skill's Step 1 resolved BOT_LOGIN with gh api user --jq '.login', which returns the currently authenticated analysis bot — e.g., tend-agent when review-reviewers runs on tend. That login is not the target repo's bot when analyzing cross-repo (e.g., worktrunk-bot on max-sixty/worktrunk, prql-bot on PRQL/prql). The wrong login was then passed into the Haiku outcome-survey subagent's prompt as The bot's login is `$BOT_LOGIN`., and the subagent filtered reviews/comments by that wrong login → false "no bot output" negatives on runs where real bot reviews were posted.

Fix: read bot_name from the target repo's .config/tend.toml — the authoritative source every tend adopter already declares.

Evidence

Run: 24295690958 (review-reviewers on max-sixty/worktrunk)

The Haiku subagent I spawned was told The bot's login is `tend-agent`. and reported:

  • 24295397943 — tend-review on PR #2108 — No bot review posted despite run completing successfully
  • 24295084845 — tend-review on PR #2104 — No bot review posted despite run completing successfully
  • 24294851520 — tend-review on PR #2107 — No bot review posted despite run completing successfully

Verified directly with the actual bot login:

$ gh api repos/max-sixty/worktrunk/pulls/2107/reviews --jq '.[] | {user: .user.login, state, submitted_at}'
{"state":"APPROVED","submitted_at":"2026-04-12T00:25:46Z","user":"worktrunk-bot"}

$ gh api repos/max-sixty/worktrunk/pulls/2104/reviews --jq '.[] | {user: .user.login, state, submitted_at}'
{"state":"COMMENTED","submitted_at":"2026-04-12T00:09:43Z","user":"worktrunk-bot"}
{"state":"APPROVED","submitted_at":"2026-04-12T00:17:08Z","user":"worktrunk-bot"}
{"state":"APPROVED","submitted_at":"2026-04-12T00:20:28Z","user":"worktrunk-bot"}

So PR #2107 was reviewed+approved+merged, and PR #2104 had three prior bot reviews — the analysis bot filtered them out because it was looking for tend-agent, not worktrunk-bot. The false negatives would have triggered session-log drilldowns and potentially spurious findings if the main Opus agent hadn't manually double-checked.

The prior max-sixty/worktrunk PR #2108 (bot-authored docs PR) also "looked" unreviewed — but that one was a correct silent exit on a self-authored PR, and only visible as such after verifying the bot login manually.

Fix

Before:

BOT_LOGIN=$(gh api user --jq '.login')

After:

BOT_LOGIN=$(gh api "repos/$ARGUMENTS/contents/.config/tend.toml" --jq '.content' 2>/dev/null \
  | base64 -d 2>/dev/null \
  | grep -E '^bot_name\s*=' | head -1 | sed -E 's/.*=\s*"?([^"]+)"?.*/\1/')
if [ -z "$BOT_LOGIN" ]; then
  echo "ERROR: could not resolve bot_name from \$ARGUMENTS/.config/tend.toml" >&2
  exit 1
fi

Verified against all three live tend adopters:

Target Resolved BOT_LOGIN
max-sixty/worktrunk worktrunk-bot
max-sixty/tend tend-agent
PRQL/prql prql-bot

Gate assessment

  • Evidence level: Critical. The bug silently produces wrong analysis input for every cross-repo run. 1 occurrence is sufficient.
  • Classification: Structural — same inputs always produce the wrong BOT_LOGIN for cross-repo analysis. Deterministic, not model-dependent.
  • Change type: Targeted fix (small bash-block replacement, same step, no new step).
  • Gate 1 (confidence): PASS — critical structural bug, 1 confirmed occurrence.
  • Gate 2 (magnitude): PASS — targeted fix is proportionate to the bug.

Not fixed here (out of scope)

plugins/tend-ci-runner/skills/review-runs/SKILL.md:101 references $BOT_LOGIN without defining it (that skill runs in-repo, so gh api user would at least be consistent, but the var is never set). Separate problem; leaving alone.

Test plan

  • Pre-commit passes on edited file
  • Dry-run of the new bash block correctly resolves worktrunk-bot from max-sixty/worktrunk/.config/tend.toml
  • Dry-run resolves tend-agent from max-sixty/tend/.config/tend.toml
  • Dry-run resolves prql-bot from PRQL/prql/.config/tend.toml

🤖 Generated with Claude Code

`BOT_LOGIN=$(gh api user --jq '.login')` returned the analysis bot
(e.g., `tend-agent` when review-reviewers runs on tend), which is not
the target repo's bot (e.g., `worktrunk-bot`) when analyzing cross-repo.
The wrong login was passed to the Haiku outcome-survey subagent, which
then reported false "no bot output" negatives. Read `bot_name` from
the target repo's `.config/tend.toml` instead — the authoritative
source for every tend adopter.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label Apr 12, 2026
@max-sixty
max-sixty merged commit 627bcd9 into main Apr 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the hourly/review-24295690958 branch April 12, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants