fix(auto-review): persist pending git action so review cards can't strand - #613
Open
TyroneNel wants to merge 1 commit into
Open
fix(auto-review): persist pending git action so review cards can't strand#613TyroneNel wants to merge 1 commit into
TyroneNel wants to merge 1 commit into
Conversation
|
PR author is not in the allowed authors list. |
This was referenced Aug 24, 2026
…rand The auto-review arming state lived only in a React ref, so a reload, unmount, or project switch between triggering a commit and it landing lost the only record that a git action was requested. The card then sat in review with zero changed files forever (cline#365). Persist a pendingGitAction field on the board card when auto-review triggers a git action, complete it on evidence (HEAD moved past the commit recorded at arming time) instead of absence (changedFiles == 0), guard against double-triggering across tabs, and clear it after a staleness timeout. Refs cline#365
TyroneNel
force-pushed
the
fix/persist-pending-git-action
branch
from
August 24, 2026 14:46
2504d46 to
5f72f1e
Compare
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.
A card's armed auto-review state lives in browser memory. Reload the tab, close it, or switch project between sending the commit prompt and the commit landing, and the only record that a git action was requested is gone. The commit can succeed and the card still sits in review until someone trashes it by hand.
Fixes #365.
The fix
One optional additive field on the board card,
pendingGitAction. Existingboard.jsonfiles parse unchanged; there is no migration.headCommitat that moment.headCommitAtRequest.changedFiles === 0with an unchanged HEAD does not advance the card.pendingGitActionis non-null and recent. The state is on the card, so this is a cross-tab lock.The staleness constant and helper live in
src/core/task-board-mutations.ts, notapi-contract.ts. web-ui consumes the contract type-only; a value import would pull zod into the SPA bundle.This is the base of a stack. #615 builds on it and moves the actor from the browser into the runtime. This PR is complete on its own: it fixes #365 whether or not #615 lands.
Tests
New tests in
web-ui/src/hooks/use-review-auto-actions.test.tsx(remount survival / #365 regression, no-advance on clean tree with unchanged HEAD, second action refused, legacy board hydration, staleness) and schema parse tests intest/runtime/api-validation.test.ts.Revert-and-rerun proof that the new tests fail without the source change:
npm run check,npm run build,npm run web:typecheckandnpm run web:testpass.