feat(review): configurable bot reviewers via REVIEW_BOTS - #85
Merged
Conversation
Replace the hardcoded /q review enforcement in autonomous-review.sh with a per-project REVIEW_BOTS setting. Built-in registry: q, codex, claude. Custom bots via REVIEW_BOTS_<NAME>_TRIGGER and _LOGIN env vars. Empty REVIEW_BOTS disables bot enforcement entirely. - New skills/autonomous-dispatcher/scripts/lib-review-bots.sh: registry + parse_review_bots / get_bot_trigger / get_bot_login / render_bot_review_section helpers. Fail-fast validation rejects unknown bots at wrapper startup. - autonomous-review.sh sources the lib, validates REVIEW_BOTS at startup (REVIEW_BOTS_VALIDATED), and replaces the hardcoded Q-review heredoc with $(render_bot_review_section ...). Report-table section iterates over the validated list. - autonomous.conf.example documents the new setting and defaults to REVIEW_BOTS="q" to preserve prior behavior. - autonomous-dev SKILL + references and autonomous-review SKILL now condition bot triggers on REVIEW_BOTS membership and list all 3 built-ins (Claude uses @claude review, NOT /claude review). - Tests: 33 unit cases for the lib + 11 source-of-truth grep cases against the wrapper. All pass.
There was a problem hiding this comment.
This PR successfully implements configurable review bots with a well-designed abstraction layer. The implementation replaces hardcoded Amazon Q enforcement with a flexible, registry-based system supporting multiple bots (Q, Codex, Claude) plus custom bots via environment variables.
Strengths:
- Clean separation of concerns with
lib-review-bots.shlibrary - Fail-fast validation prevents silent config errors
- Comprehensive test coverage (44 test cases)
- Backward compatible - defaults to
REVIEW_BOTS="q"preserving existing behavior - Proper handling of Claude's
@claude reviewtrigger (not/claude review) - Well-documented with design canvas and inline comments
Code Quality:
- Bash syntax validated with
bash -n - Proper error handling and return codes
- Security-conscious (validates input, uses proper quoting)
- Clear function contracts and documentation
All acceptance criteria appear to be met. The implementation is production-ready.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Validate REVIEW_BOTS at the start of dispatcher-tick.sh, alongside the existing EXECUTION_BACKEND precheck. A typo (e.g. REVIEW_BOTS="q codx") would otherwise let the tick swap an issue's label to `reviewing` and spawn autonomous-review.sh, which exits 1 at startup — burning a retry slot on every tick until MAX_RETRIES marks the issue stalled. The precheck aborts the whole tick with a clear error before any gh API call or label transition. Multi-project wrapper unchanged: it already runs each project's tick in a subshell and continues past per-project failures. - skills/autonomous-dispatcher/scripts/dispatcher-tick.sh: source lib-review-bots.sh and call parse_review_bots after the EXECUTION_BACKEND case statement, before any side-effects. - tests/unit/test-dispatcher-tick-review-bots.sh: 9 cases — bad value exits non-zero, gh shim records zero calls, error message references the bad bot name and autonomous.conf, empty REVIEW_BOTS clears the precheck, source-of-truth grep + line-position check that the precheck runs before any dispatch(). - docs/designs/configurable-review-bots.md: document the two-layer validation (dispatcher precheck + wrapper defense-in-depth).
5 tasks
zxkane
added a commit
that referenced
this pull request
May 10, 2026
## Summary One-line README update: the "Amazon Q integration" row in the Review Agent capability table was stale after #85 generalized bot enforcement to all configured bots. Replace it with a row that names the `REVIEW_BOTS` setting plus the three built-in bots (`/q`, `/codex`, `@claude`) and mentions the custom-bot extension. ## Test Plan - [x] Markdown renders cleanly (table cell, no formatting changes outside the row) - [ ] CI checks pass ## Checklist - [x] No code changes — single-row update in `README.md` - [x] Build/tests not affected - [x] PR review skipped (trivial copy change in a documentation table)
7 tasks
zxkane
added a commit
that referenced
this pull request
May 10, 2026
…87) ## Summary Three docs-only changes to README.md: 1. **New "For AI Agents — Install and Configure" top-level section.** Six-step walkthrough (`npx skills add ... -a claude-code -y`, symlinks, required plugins, `autonomous.conf` variable table, GitHub label setup, smoke tests) plus a copy-paste prompt block agents can execute end-to-end on the user's behalf. 2. **Option B Step 3 generalized.** The dispatcher tick is host-agnostic; OpenClaw is the recommended host but plain cron + `dispatcher-tick.sh`, Claude Cowork, and GitHub Actions schedules all work. Replaced the OpenClaw-only instruction with a 3-row host table and a two-example cron block. 3. **Supported Agent CLIs table refreshed.** Verified each CLI against current upstream docs (May 2026): - **Codex CLI** marked code-side broken — `lib-agent.sh` uses `-p`, but current Codex parses that as `--profile`. Headless invocation is now `codex exec "<prompt>"`. Follow-up `fix(dispatcher)` PR pending. - **Kiro CLI** binary corrected from `kiro` to `kiro-cli`; headless pattern is `chat --no-interactive [--agent <name>]`. - **Cursor Agent** and **Gemini CLI** rows added (both work via the generic `<cli> -p <prompt>` fallback). - Documented `AGENT_TIMEOUT` (default `4h`) and `AGENT_DEV_MODEL` / `AGENT_REVIEW_MODEL`, which ship in `autonomous.conf.example` but were missing from the README. ## Why After the configurable-review-bots PR (#85) and an upstream Codex CLI breaking change, the existing README was both incomplete (no agent-driven install path, no `AGENT_TIMEOUT` / `REVIEW_BOTS` doc) and inaccurate (Codex `-p` flag, Kiro `kiro` binary, OpenClaw-only dispatcher framing). This PR doesn't change behavior — it just stops shipping wrong instructions. ## Code-review findings addressed The code-reviewer agent flagged five issues on the first draft; all resolved: 1. ❌ `claude --skill autonomous-dispatcher` — that flag doesn't exist. → Replaced with `bash dispatcher-tick.sh` (which is what every host calls anyway). 2. ❌ Copy-paste prompt's Step 5 ran `setup-labels.sh "$REPO"` without sourcing `autonomous.conf` first → `$REPO` would be empty. → Wrapped in `( source scripts/autonomous.conf && ... )` subshell. 3. Missing `AGENT_TIMEOUT` / `AGENT_DEV_MODEL` / `AGENT_REVIEW_MODEL` rows in the variable table. → Added. 4. Codex contradiction (variable table said `codex` works; agent-CLI table said it's broken). → Tightened the variable table to mark `codex` as currently broken with a back-reference. 5. `dispatcher-tick.sh` referenced in Step 6 without prior introduction. → Added inline annotations to the smoke-test commands. ## Test Plan - [x] `claude --help` confirmed: no `--skill` flag (verified the broken example was actually broken) - [x] `codex --help` and `codex exec --help` confirmed: `-p` is `--profile`, prompts are positional - [x] All 5 code-review findings addressed before push - [ ] CI checks pass ## Follow-ups (not in this PR) - `fix(dispatcher)`: switch `lib-agent.sh` codex branch from `-p "$prompt"` to `codex exec "$prompt"`, and add a codex case to `resume_agent` using `codex exec resume`. Will also evaluate adding an `opencode` branch (provider-agnostic, but session ID is opencode-minted, not caller-provided — needs adapter work). ## Checklist - [x] No code changes — README only - [x] Build/tests not affected - [x] PR review agent run; all blocking findings resolved
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
Replace the hardcoded
/q reviewenforcement inautonomous-review.shwith a per-projectREVIEW_BOTSsetting. Built-in registry:q,codex,claude. Custom bots viaREVIEW_BOTS_<NAME>_TRIGGERandREVIEW_BOTS_<NAME>_LOGINenv vars. EmptyREVIEW_BOTSdisables bot enforcement entirely.Why
The dev/review pipeline previously assumed every consuming repo had Amazon Q Developer installed. Projects without Q (or with Codex/Claude instead) had no way to opt out or swap bots — the wrapper would force
/q reviewand block the review on a Q response that never came. This PR makes bot enforcement project-driven.Design
docs/designs/configurable-review-bots.mdskills/autonomous-dispatcher/scripts/lib-review-bots.sh— registry +parse_review_bots/get_bot_trigger/get_bot_login/render_bot_review_sectionhelpers. Fail-fast validation rejects unknown bots so a typo inautonomous.confsurfaces immediately rather than silently dropping the bot.dispatcher-tick.shstartup precheck — runs before any GitHub API call or label transition. A bad value aborts the whole tick withexit 1. Without this, a typo would let the tick swap an issue's label toreviewingand spawn the wrapper, which exits 1 — burning a retry slot every tick untilMAX_RETRIES. Multi-project wrapper unchanged: it already handles per-project failures.autonomous-review.shstartup validation — defense in depth, since the wrapper can be invoked outside the dispatcher.autonomous-review.shsources the lib, computesREVIEW_BOTS_VALIDATEDonce at startup, and replaces the hardcoded Q-review heredoc with$(render_bot_review_section ...). The E2E report-table iterates over the validated list.autonomous.conf.exampledefaults toREVIEW_BOTS="q"to preserve prior behavior — existing projects see no change unless they edit the config.autonomous-devSKILL + references andautonomous-reviewSKILL now condition bot triggers onREVIEW_BOTSmembership and list all 3 built-ins. Critical detail: Claude uses@claude review(NOT/claude review) per the anthropics/claude-code-action docs.Test Plan
tests/unit/test-lib-review-bots.shcovering parse happy/empty/unknown/custom-via-env, case normalization, helper lookups, render output for empty/single/multi-bot configs, and a@claude reviewregression guard.tests/unit/test-autonomous-review-prompt.shverifying the wrapper sources the lib, validates fail-fast, embedsrender_bot_review_sectionin the prompt, drops the hardcoded Q block, and passesbash -n.tests/unit/test-dispatcher-tick-review-bots.sh— bad value → rc != 0, gh shim records zero calls (precheck aborts before side-effects), error contents, empty REVIEW_BOTS clears precheck, source-of-truth grep + line-position check that precheck precedes anydispatchcall.bash -nclean onlib-review-bots.sh,autonomous-review.sh,dispatcher-tick.shBackwards Compatibility
autonomous.conf.exampledefaults toREVIEW_BOTS="q", which renders the same 5-step trigger/poll/fail flow the wrapper used before — only the local var name changed (Q_COUNT→COUNT, scoped to the rendered prompt). Existing deployments that copy from the example see identical behavior.Checklist
docs/designs/configurable-review-bots.md)