release: v0.6.6 — review retry resilience - #15
Merged
Conversation
Wrap /gemini:review and /gemini:adversarial-review in runGeminiReviewResilient, which re-runs a READ-ONLY review up to 3x when the result is transient (empty / `Invalid stream` / malformed-tool-call / 5xx / 429 / unavailable, with no parseable findings). Reviews that return structured findings or real prose are never retried (read-only reviews are idempotent); agy is never retried (its transcript-recovery + fail-fast timeout handle its distinct failure mode). This composes with the existing GA-fallback (model-not-found) retry rather than replacing it. New: isTransientReviewFailure helper, fixture scenario review-transient-then-clean, and a regression test. 186/186 tests pass; verify-contracts + version metadata 0.6.6. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…text backstop
isTransientReviewFailure previously matched one regex (transient envelope +
loose transport words) against stdout AND stderr combined, so a real review
whose prose merely discussed an HTTP status code ("returns a 500", "rate
limit", "unavailable") with no parseable JSON could be misclassified as a
transient flake and retried up to 3x. Split the signal by channel:
- ENVELOPE phrases (invalid stream / malformed tool call / empty|no response)
are specific enough to trust on EITHER stream (some builds emit on stdout
with exit 0, others on stderr).
- TRANSPORT words (unavailable / rate limit / 5xx / 429 / econnreset / ...)
are trusted ONLY on stderr, where the model review text never lands - so
prose in stdout can no longer false-trigger.
Backstop in runGeminiReviewResilient: identical non-empty review text across
attempts is deterministic output that merely tripped the heuristic, not a
flake - keep it instead of burning the remaining retries on the same result.
Also drops the now-redundant status-gated branch (the unconditional regex
test fully subsumed it). Adds 5 unit tests for the classifier. 191/191 pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Transient gemini review failures (empty /
Invalid stream/ malformed-tool-call, or transport-level 5xx/429/unavailable) previously surfaced as a parse error and forced a manual re-run (observed needing 2–3 attempts for the same input). This wraps the review path inrunGeminiReviewResilient, which retries a read-only review up to 3× when the result is transient with no parseable findings.Changes
lib/gemini.mjs:isTransientReviewFailure+runGeminiReviewResilientgemini-companion.mjs:executeReviewRun→ resilient wrappertests/fixtures/fake-gemini.cjs:review-transient-then-cleanscenariotests/runtime.test.mjs: regression testCHANGELOG.md+ version bump → 0.6.6Verification
npm test→ 186/186 pass (incl. the new retry test)node scripts/bump-version.mjs --check→ matches 0.6.6node scripts/verify-contracts.mjs→ passed at v0.6.6🤖 Generated with Claude Code