Skip to content

feat(staged): remove automatic code review feature - #931

Merged
matt2e merged 3 commits into
mainfrom
remove-auto-review
Aug 26, 2026
Merged

feat(staged): remove automatic code review feature#931
matt2e merged 3 commits into
mainfrom
remove-auto-review

Conversation

@matt2e

@matt2e matt2e commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Staged no longer starts code reviews on its own. This removes both triggers — the background review after each commit session completes, and the review kicked off when adding a project or repo from a PR — along with everything that existed only to support them.

Reviews started manually via the Review button are unchanged.

Changes

Backend — drops the trigger/cancel/adopt plumbing (trigger_auto_review, maybe_trigger_auto_review_for_new_repo, find_fresh_auto_review, set_review_auto), the pending_auto_review_branch_id session config, the isAutoReview session-status flag, and the queue special-casing that let auto reviews bypass the branch session queue.

Store — removes the reviews.is_auto flag and the auto-review-only session_provider column mapping. Migration 0026 deletes background-created auto reviews (adopted ones were already flipped to is_auto = 0) and drops the column.

Frontend — removes the "Auto start code reviews" setting, auto-review adoption/cancellation in BranchCard, the DiffModal annotation polling, and the isAuto/isAutoReview filters across timeline, queueing, and session-status handling.

Two follow-up refactors clean up what the removal left behind: blocks_queue on BranchSessionSchedule (auto reviews were the only non-blocking session kind, so every guard was unconditionally taken) and the branch_id return from run_post_completion_hooks (only the auto-review trigger consumed it).

Verification

cargo check/clippy/fmt clean; cargo test 741 passed; svelte-check + tsc clean; vitest 682 passed; prettier clean.

matt2e and others added 3 commits August 26, 2026 15:03
Staged no longer starts code reviews on its own. This removes both
triggers — the background review after each commit session completes and
the review kicked off when adding a project or repo from a PR — along
with everything that existed only to support them:

- backend: trigger/cancel/adopt plumbing (trigger_auto_review,
  maybe_trigger_auto_review_for_new_repo, find_fresh_auto_review,
  set_review_auto), the pending_auto_review_branch_id session config,
  the isAutoReview session-status flag, and the queue special-casing
  that let auto reviews bypass the branch session queue
- store: the reviews.is_auto flag and the auto-review-only
  session_provider column mapping; migration 0026 deletes
  background-created auto reviews (adopted ones were already flipped
  to is_auto = 0) and drops the column
- frontend: the "Auto start code reviews" setting, auto-review
  adoption/cancellation in BranchCard, the DiffModal annotation
  polling, and the isAuto/isAutoReview filters across timeline,
  queueing, and session-status handling

Reviews started manually via the Review button are unchanged.

Verified: cargo check/clippy/fmt and cargo test (741 passed);
svelte-check + tsc clean; vitest (682 passed); prettier clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
`run_post_completion_hooks` returned the `branch_id` of a newly detected
commit solely so the caller could feed it to the auto-review trigger.
With auto review gone, the production call site discards the value and
only tests read it, leaving a return nothing traces back to a caller.

Collapse it to `()` and have the mid-rebase tests assert on the store row
they actually care about — the rebase session's pending commit still
being `sha IS NULL` — via a new `assert_pending_unclaimed` helper, which
`rebase_stopped_on_a_conflict_leaves_the_rows_alone` was already
asserting inline.

Verified: cargo fmt/clippy clean (only pre-existing warnings in
test_utils and store/tests.rs); cargo test 741 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Auto reviews were the only branch session that could run without
blocking the branch queue. With them gone, `blocks_queue` is `true` at
every `BranchSessionSchedule` construction site, so all four
`if schedule.blocks_queue` guards are unconditionally taken and the
field reads as if a non-blocking session kind still existed.

Drop the field and inline the guards. `has_queued_user_branch_session`
loses its `user` qualifier for the same reason — the distinction it drew
was user-started sessions versus background auto reviews — and collapses
to an `is_some()` check on the resolved schedule.

Also move the test-only `build_full_prompt` wrapper into `mod tests`, so
its status is obvious from where it lives rather than from a `#[cfg(test)]`
attribute on a production-shaped signature, and give its doc comment the
verb it was missing.

Verified: cargo fmt/clippy clean (only pre-existing warnings in
test_utils and store/tests.rs); cargo test 741 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e merged commit f2ddbc8 into main Aug 26, 2026
3 checks passed
@matt2e
matt2e deleted the remove-auto-review branch August 26, 2026 06:35
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.

1 participant