Repository navigation
feat(code-review-sage): run reviews on claude and other client backends - #31145
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Reviews now run on the backend the operator configured, using the same capability check the knowledge pool already relies on. The one remaining concern is that the PR hand-writes per-process lifecycle code an existing engine already owns. Not checked: whether Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: an operator who set
[FIRST-PRINCIPLES-REVIEWED] 746c947 Description read[DESCRIPTION-READ] dbf23e8f0b2e74615d27e69e31cb57b8f8451c1692b78e8c7b9d0d02e527be83 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS The new per-task client path changes where every review runs on BlockersManual verification skipped on a branch that only runs where CI can't reach
If any one fails, every review on those backends fails, and no setting brings back the kiro-cli path. Fix: run one real review end to end on a Clears when: the description's Manual verification section records a real Notes
[DESIGN-REVIEWED] 746c947 Description read[DESCRIPTION-READ] c3e6b75d48003f7e6956cf43bb4d620df4c72316d81e21257b8a58a55119519c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
69a4217 to
dc1a308
Compare
|
Rebased: main moved in docs/architecture/resource-protection.md, docs/system-specs/modules/acp-client.md, docs/system-specs/modules/governance.md, docs/system-specs/modules/sel.md since this head went green (1e990f8 -> d0583bc); CI re-running. The same push records the review pool's PID read for its per-task client as an owner-marked site in |
|
dc1a308 to
bf22d0e
Compare
|
Rebased: main moved in docs/architecture/resource-protection.md, docs/guides/windows-install.md, docs/system-specs/modules/acp-client.md, docs/system-specs/modules/governance.md since this head went green (d0583bc -> 480d162); CI re-running. The rebase is clean and the patch is unchanged. The previous head's red lanes all failed on the CI app's installation rate limit, not on a finding, so this run re-judges them. |
bf22d0e to
42ea4c6
Compare
|
Rebased: main moved in docs/system-specs/modules/acp-client.md, docs/system-specs/modules/governance.md, docs/system-specs/modules/sel.md since this head went green (480d162 -> 0795ebc); CI re-running. The rebase is clean and the patch is unchanged. The previous head's two red test shards failed on tests this diff does not touch: |
42ea4c6 to
05d2e1f
Compare
|
[operator: bolichen97] The two red Backend Tests jobs (shard 2, Linux and Windows) fail only A rerun reuses the old merge commit, so only a re-sync onto current main clears it, and this PR has spent its re-sync budget (3 of 3). Main has since moved in three files this PR edits ( |
|
Re-sync budget reset The base moved under this PR more times than the re-sync budget allows; a maintainer asked for one more round of re-syncs so it can be rebased and its conflicts resolved. [operator: bolichen97] |
05d2e1f to
df402d2
Compare
|
Rebased: main moved in docs/architecture/resource-protection.md, docs/guides/windows-install.md, docs/system-specs/modules/acp-client.md, docs/system-specs/modules/governance.md since this head went green (e30915e -> a398062); CI re-running. The rebase was clean. The old head's only red was main's own: Backend Tests shard 2 (Linux and Windows) failed [operator: bolichen97] |
|
[operator: bolichen97] Subtraction in this push, after a retrospective over every mechanism this PR adds.
|
|
[operator: bolichen97] Subtraction in this push, after a retrospective over every mechanism this PR adds.
|
[operator: bolichen97] |
df402d2 to
1465be4
Compare
A host whose agent.acp_backend is a backend the shared review runtime cannot drive (claude, opencode, goose, pi, deepseek, ...) ran every review on kiro-cli instead, so a host with only claude-agent-acp could not review at all. Such a backend now runs each review on a provider of its own, with the runtime's sandbox mode, cwd, approval and audit, the configured review effort, and its PID shielded from the orphan sweep while the review runs. Part of #22196
1465be4 to
746c947
Compare
|
[operator: bolichen97] On the First Principles note (item 3, a duplicate of
The same change is ported to the app's own repository through its |
A host whose agent.acp_backend is a backend the shared review runtime cannot drive (claude, opencode, goose, pi, deepseek, copilot, strands) ran every review on kiro-cli with one warning, and an enterprise build refused it. Review quality, sign-in, quotas and models then came from a provider the operator did not pick. For such a backend the batch now spawns no shared runtime. Each task starts one provider through the host's build_acp_provider with the runtime's own settings (sandbox_mode auto, the app root as cwd, the reviewer agent) plus the reviewer model and review.effort, runs through the same approval, audit and host-deny loop, and is shut down after. It runs with temporary memory, its PID is kept out of the orphan sweep while it runs, shutdown() stops one still running, and the pool's occupancy counts it. No follow-up is offered for such a review. The four host names are looked up through _host; a host missing any of them keeps the backend on the kiro-cli fallback, as before. Ported from kirodotdev/KiroCrew#31145 (part of kirodotdev/KiroCrew#22196). Co-authored-by: Bolin Chen <bolichen@amazon.com>
|
Rebased onto main (d0583bc-era base -> 41ba859): main had renamed the Enterprise Edition to the LTS Edition (#32970), which conflicted in The old head's red Backend Tests shard 6 (Linux and Windows) failed only The same push drops the em dashes this PR's added and rewrapped lines carried ( The app's own repository has the same change: commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on head 746c947: PR Readiness is green, every AI review lane on this head passes with no blocking findings, and no change request stands.
Problem / Motivation
Goal: A host whose configured agent backend is Claude (or another backend the shared review runtime cannot drive) runs its Code Review Sage reviews on that backend instead of on kiro-cli.
Code Review Sage drives every review through one shared
AcpRuntime, and that runtime only serves kiro, KAS and Codex. On a host set toclaude,opencode,goose,piordeepseek, reviews quietly run on kiro-cli with one warning. Review quality, sign-in, quotas and models then come from a provider the operator did not pick, and a host with onlyclaude-agent-acpinstalled cannot review at all. An LTS build refuses those reviews outright.Why it matters
An operator who chose a backend expects reviews on it. Today a review failure on such a host is traced to the wrong provider, and a host without kiro-cli has no working Code Review Sage.
Not a goal
What changed (motivation → approach → change)
Reviews now follow the configured backend on every backend a per-session client can run.
claude,opencode,goose,pi,deepseek,copilot,strandsApproach.
review_backend()asks the same capability the knowledge pool asks,acp_client_spawnable. For such a backend the batch spawns no shared runtime. Each task starts oneAcpProviderthroughbuild_acp_providerwith the shared runtime's own settings (sandbox_mode="auto", the app root as cwd, the reviewer agent) plus the reviewer model and the configuredreview.effort. The effort is keyed on that model, or carried unkeyed when the reviewer runs the unpinned default, so the dashboard's effort is the one the review runs at. It runs through the same loop as a runtime session: the security-floor refusal, auto-approval, the per-tool SEL audit and the host-deny notice. Then it is shut down.Three things keep it as contained as a destroyed runtime session:
memory_mode="temporary": Claude's auto-memory is off, so nothing one review writes reaches the next, and its transcript is removed at shutdown.ReviewPool.shutdown()stops any such provider still running. Pool occupancy counts these tasks too.The config provider factory was the other option. It was not used because it takes the operator's
agent.sandbox, andstricthides~/.config/gh, which the reviewer'sghCLI needs. It also takes the Claude permission mode, while a review must run under the same fixed settings as the shared runtime.The
acp-client,governance,resource-protectionandselspecs and the Windows install guide (windows-install.md) describe the per-task client.The app's own repository carries the same change: commit
0429f42f2528a8e8dfa9bbf2370872276f2a90b2of KiroCrewCaptain/kirocrew-app-code-review-sage (its pull request 1), merged to itsmain. There the four host names are looked up by name, and a host without any of them keeps the kiro-cli fallback.Backwards compatibility
Compatible: kiro, KAS and Codex hosts run exactly as before. A host on another client backend that ran reviews on kiro-cli now runs them on its configured backend. An LTS build that refused such a review now runs it on the backend its policy allows.
Removes nothing: no key, record, route or public function is removed. The kiro-cli fallback and its warning stay for a backend no per-task client can run.
Tests
test_claude_runs_each_review_on_a_claude_client: withagent.acp_backend=claude, no kiro-cli runtime spawns. The review runs on a claude provider built withsandbox_mode="auto",memory_mode="temporary"and the app root. Its PID is shielded during the turn, and the provider is shut down and unshielded after it.test_a_claude_client_takes_the_configured_review_effort: a pinned model getsreview.effortkeyed on it, the unpinned default carries it unkeyed, and an empty effort passes nothing.test_a_client_that_cannot_start_is_shut_down_and_never_shielded: a sandbox refusal at start becomesReviewRuntimeUnavailable. The provider is shut down, and nothing is shielded or counted.test_shutdown_stops_a_client_still_running:ReviewPool.shutdown()stops a provider mid-turn, exactly once.test_a_backend_served_neither_way_falls_back_to_kiro_and_warns_once: the claude fallback test, narrowed to a backend no client can run, keeps the single warning.test_review_pool_lts_floor.py):test_a_client_backend_the_policy_allows_runs_on_it. The three refusal tests now model a backend served neither way.test_followup.py's pool stub returns the runtime with its backend, which is what the follow-up decision reads.test_pid_reader_ratchet.pycounts the per-task client's PID read as an owner-marked site, since the pool spawns that process and ends it.run_scoped_tests.py --surface backend, 4 workers): 3380 passed.test_review_pool.py::TestReviewBackendandtest_review_pool_lts_floor.py: 20/20 green at-n0; 10/10 green at-n 4 --dist loadgroup --max-worker-restart=2besidetest_followup.pyandtest_review_driver.py; their 22 ids shuffled with seed 1625, all passed.Manual verification
Not run here, and required before relying on it: one real review on a host with
claude-agent-acpsigned in andghauthenticated. This host has noclaude-agent-acp. Unit coverage pins the pool's wiring, approval and teardown, not the reviewer's output quality on another harness.Related Issues
Part of #22196
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)