Repository navigation
docs(skill): support OpenCode in agent handoffs section - #2108
Merged
Merged
Conversation
The "Agent handoffs" guidance was Claude-only. OpenCode users hit this when triggering parallel-worktree handoffs because the skill told the agent to use `claude` literally. Make the skill instruct the agent to use whichever CLI it is running as (`claude` or `'opencode run'`), broaden the project-instructions reference to include `AGENTS.md`, and update the user-facing docs example with the OpenCode substitution. Refs #2076
max-sixty
enabled auto-merge (squash)
April 12, 2026 01:00
This was referenced Apr 12, 2026
max-sixty
pushed a commit
to max-sixty/tend
that referenced
this pull request
Apr 12, 2026
…ml (#256) ## 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](https://github.com/max-sixty/tend/actions/runs/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](max-sixty/worktrunk#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: ```bash BOT_LOGIN=$(gh api user --jq '.login') ``` After: ```bash 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 - [x] Pre-commit passes on edited file - [x] Dry-run of the new bash block correctly resolves `worktrunk-bot` from `max-sixty/worktrunk/.config/tend.toml` - [x] Dry-run resolves `tend-agent` from `max-sixty/tend/.config/tend.toml` - [x] Dry-run resolves `prql-bot` from `PRQL/prql/.config/tend.toml` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: continuous-bot <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claudefor Claude Code or'opencode run'for OpenCode — instead of hardcodingclaudein the example commands.AGENTS.mdalongsideCLAUDE.md.AGENTS.mdreference) to the user-facing "Agent handoffs" example indocs/content/tips-patterns.md.Closes the concrete sub-request from #2076: when an OpenCode session was asked to spawn a parallel worktree, the skill told it to run
claudeliterally, so the handoff defaulted to Claude Code. After this change the agent is told to substitute its own CLI.The broader docs-prominence question from #2076 (a dedicated
reference/opencode.md, OpenCode mentions inclaude-code.md, etc.) is intentionally left out of this PR for maintainer judgment.Test plan
cargo test --test integration test_command_pages_and_skill_files_are_in_sync— passes; auto-syncsskills/worktrunk/reference/tips-patterns.mdand the.well-known/agent-skills/index.jsondigest.cargo test --test integration test_docs_quickstart_examples_are_in_sync— passes.typosruns clean on the touched files.opencode runaccepts a positional prompt (opencode run [message..]) per the OpenCode CLI docs, and thatwt switch -x 'opencode run' -- '<task>'works because--executeis passed through the user's shell, so the multi-word command is parsed correctly and trailing--args are shell-escaped and appended.