Releases: derailed-dash/gemini-review-action
Release list
v1.6.3: Prompt Hardening & Sweeping Claims Guard
What's Changed in v1.6.3
🛡️ Prompt Hardening Against Unverified Sweeping Claims
-
No Unverified Universal Affirmations: Explicitly instructs Gemini to avoid making sweeping, universal, or exhaustive assertions (such as "all actions/dependencies are pinned to SHAs" or "all endpoints validate input") in prose fields (
summaryandgeneral_feedback) unless verified across every occurrence in the diff (#43, #45). -
Zero-Cost & Zero-Latency Quality Guard: Fixes unanchored praise directly at the prompt/instruction level, eliminating false-positive compliments without introducing the latency penalty or
$2\times$ token cost multiplier of a multi-pass verification critic loop. -
Synchronised Fallback & Test Coverage: Updated both
gemini-review.tomland the default fallback base prompt inload_system_instruction, backed by unit test coverage.
📜 Rolled-In Highlights from Previous Releases
v1.6.2: Vertex AI Billing Cost Attribution & Commit Status De-duplication
- Vertex AI Billing Labels: Automatically attaches
component=gemini-review-actionandrepo=owner_repolabels to Vertex AI API requests for direct Cloud Billing cost attribution and export aggregation. - GitHub API Exponential Backoff & Retry: Adds automatic retries for transient GitHub 5xx server errors and network resets.
- Accurate Commit Status Signals: Eliminates duplicate Commit Status API calls during standard
pull_requestruns while preserving updates for slash-command/gemini-reviewretries. - Pricing Refinements: Zero-rate cache read pricing support and storage caveats for token-based cache pricing models.
v1.6.1: Cost Estimation Telemetry & Fork PR Security
- Dollar Cost Reporting: Automatically calculates and reports estimated review costs directly in the tokenomics summary table based on published rates, cached input discounts, and promotional pricing.
- Fork PR Security Workflow: Gracefully skips automatic PR runs from external forks where secrets are inaccessible, guiding maintainers to trigger reviews securely via
/gemini-review. - No Silent Drops: Validates that GitHub accepted review payloads and fails loudly in CI if delivery fails.
v1.6.0: Dynamic Context Selection in Sparse Mode
- AI-Powered Dynamic Context Selection: When repository size exceeds the sparse threshold (1.5 MB), Gemini dynamically evaluates candidate files and selects up to 8 of the most relevant modules (callers, dependencies, tests, utilities) to include in full context.
- Core Safeguard Budget: Guaranteed inclusion of core config and documentation files (
README.md,pyproject.toml,package.json, etc.).
v1.5.2: Default Model Upgrade to Gemini 3.7 Flash
- Upgraded default model across reviews and issue triaging to
gemini-3.7-flash.
v1.5.1: Code Suggestion Sanitisation & Auto-Indentation
- Sanitised inline code suggestion formatting by stripping outer fences, line-number prefixes, and auto-aligning indentation to match target code nesting.
v1.5.0: Multi-Axis Code Quality Review Directives
- Enhanced review prompt directives with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.
Full Changelog: v1.6.2...v1.6.3
v1.6.2: Vertex AI Billing Labels, Network & API Retries, Commit Status De-duplication
🌟 What's New in v1.6.2
🏷️ Cloud Billing Label Attribution on Vertex AI
- Cost Attribution in GCP Billing: Automatically attaches Google Cloud Billing request labels (
component: gemini-review-action,repo: <owner_repo>) on Vertex AI runs so that review costs can be grouped and analysed directly in GCP Cloud Billing exports (#38 by @SaschaHeyer). - Customisable Labels: Supports custom key-value pairs via the
billing_labelsinput (GEMINI_BILLING_LABELS="team=platform,cost_centre=dev"), automatically sanitising keys and values to comply with GCP label regex and length requirements.
🔄 Resilient Delivery & Network Error Retries
- Transient API Retry Logic: Introduces
post_with_retryto automatically retry review submissions on transient GitHub API hiccups (HTTP5xxserver errors and429rate limits) with tight exponential backoff (1s, 3s) (#36 by @SaschaHeyer). - Network Exception Handling: Catches connection resets and socket timeouts (
requests.exceptions.RequestException), ensuring momentary network flaps do not drop reviews or waste token spend. - Fast Failure on Client Errors: Fails fast on permanent client errors (
403,422) without pointless retries.
🎯 Accurate Commit Status Signals & De-duplication
- Eliminate Duplicate Status Checks: Suppresses redundant Commit Status API calls during standard
pull_requestworkflow runs where GitHub Actions already tracks and reports check runs natively (#44). - Clean Retry Checks: Preserves explicit commit status updates for manual slash-command re-runs (
/gemini-reviewonissue_commentevents) so that PR checkmarks update cleanly on retry. - Dynamic Workflow Context: Dynamically derives commit status context names from
GITHUB_WORKFLOW.
💵 Token Pricing & Cache Valuation Refinements
- Zero-Rate Cache Reads: Accurately honours
cache_read = 0.0for providers with free cache reads rather than falling back to default multipliers (#37 by @SaschaHeyer). - Refined Storage Caveats: Improves context-cache storage caveats for token-based cache pricing models like Gemini 3.7 Flash.
📊 Action Usage Tracking & Best Practice Documentation
- Usage Telemetry Badge: Added workflow and endpoint badge tracking public action usage and active consumer count (#39).
- Security Guidance: Recommends full commit SHA pinning and adds caveats regarding workflow-level concurrency cancellation (#41 by @SaschaHeyer).
📜 Rolled-In Highlights from Previous Releases
v1.6.1: Cost Estimation Telemetry & Fork PR Security
- Dollar Cost Reporting: Automatically calculates and reports estimated review costs directly in the tokenomics summary table based on official published rates, cached input discounts, and time-boxed promotional pricing.
- Fork PR Workflow Security: Skips automatic
pull_requesttriggers from external forks where secrets are inaccessible, routing maintainers to trigger reviews securely via/gemini-review. - No Silent Drops: Verifies that GitHub accepted review payloads and fails loudly in CI if delivery fails completely.
v1.6.0: Dynamic Context Selection in Sparse Mode
- AI-Powered Dynamic Context Selection: When repository size exceeds the sparse threshold (1.5 MB), Gemini dynamically evaluates candidate repository files and selects up to 8 of the most relevant modules (callers, dependencies, tests, utilities) to include in full context.
- Core Safeguard Budget: Guaranteed inclusion of core config and documentation files (
README.md,pyproject.toml,package.json, etc.).
v1.5.2: Default Model Upgrade to Gemini 3.7 Flash
- Upgraded default model across reviews and issue triaging to
gemini-3.7-flash.
v1.5.1: Code Suggestion Sanitisation & Auto-Indentation
- Sanitised inline code suggestion formatting by stripping outer fences, line-number prefixes, and auto-aligning indentation to match target code nesting.
v1.5.0: Multi-Axis Code Quality Review Directives
- Enhanced review prompt directives with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.
v1.4.5: Line Range Accuracy & Discussion Tracking
- Multi-line suggestion targeting, automatic PR comment history and conversation thread tracking, and suppression of redundant re-reviews on inline fixes.
Full Changelog: v1.6.1...v1.6.2
v1.6.1: Cost Estimation Telemetry, Fork PR Security & Resilient Error Handling
🌟 What's New in v1.6.1
💰 Automated Cost Estimation & Pricing Telemetry
- Dollar Cost Reporting: Automatically calculates and reports estimated review costs directly in the tokenomics summary table based on official published rates, cached input discounts, and time-boxed promotional pricing (#33 by @SaschaHeyer).
- Decoupled Pricing Module: Clean
pricing.pyarchitecture supporting custom token rates via environment variables (GEMINI_RATE_INPUT,GEMINI_RATE_OUTPUT) orgemini-review.toml. - Accurate Input Billing: Properly bills prior PR comment history tokens at full input rates rather than silently dropping them.
- Gemini 3.7 Flash Cache Read Pricing: Introduces support for Gemini 3.7 Flash cache read pricing multipliers (
DEFAULT_CACHE_READ_MULTIPLIER = 0.1).
🛡️ Fork PR Workflow Security & Slash Command Routing
- Skipping Fork PR Failures: Restricts automatic
pull_requestworkflow triggers to internal repository branches, cleanly skipping fork PRs where repository secrets are inaccessible by GitHub design (#34). - Slash Command Execution (
/gemini-review): Repository maintainers can securely trigger reviews on external fork PRs by commenting/gemini-review, ensuring safe execution with full access toGEMINI_API_KEY. - PR Template: Added
.github/pull_request_template.mdwith contributor checklists and maintainer slash-command guidance. - Contribution Guide: Updated
CONTRIBUTING.mdwith comprehensive workflow lifecycle guidance and linking to exemplar PRs.
⚡ Resilient Error Handling & Visible Failure Signals
- No More Silent Drops:
post_reviewnow verifies if review comments were accepted by GitHub API. If posting fails completely, it raises aRuntimeErrorand sets the commit status tofailure, alerting maintainers immediately in CI.
📜 Rolled-In Highlights from Previous Releases
v1.6.0: Dynamic Context Selection in Sparse Mode
- AI-Powered Dynamic Context Selection: When repository size exceeds the sparse threshold (1.5 MB), Gemini dynamically evaluates candidate repository files and selects up to 8 of the most relevant modules (callers, dependencies, tests, utilities) to include in full context.
- Core Safeguard Budget: Guaranteed inclusion of core config and documentation files (
README.md,pyproject.toml,package.json, etc.).
v1.5.2: Default Model Upgrade to Gemini 3.7 Flash
- Upgraded default model across reviews and issue triaging to
gemini-3.7-flash.
v1.5.1: Code Suggestion Sanitisation & Auto-Indentation
- Sanitised inline code suggestion formatting by stripping outer fences, line-number prefixes, and auto-aligning indentation to match target code nesting.
v1.5.0: Multi-Axis Code Quality Review Directives
- Enhanced review prompt directives with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.
v1.4.5: Line Range Accuracy & Discussion Tracking
- Multi-line suggestion targeting, automatic PR comment history and conversation thread tracking, and suppression of redundant re-reviews on inline fixes.
Full Changelog: v1.6.0...v1.6.1
v1.6.0 - Dynamic Context Selection in Sparse Mode
What's Changed
- feat(context): add dynamic codebase context selection in sparse mode … by @derailed-dash in #32
Full Changelog: v1.5.2...v1.6.0
Release v1.5.2: Upgrade default model to Gemini 3.7 Flash
Changes in v1.5.2
- Upgrade default model to
gemini-3.7-flashacross PR reviews and Issue Triage workflows.
v1.5.1: Code Suggestion Sanitisation & Automatic Indentation Alignment
🚀 What's New in v1.5.1
This point release fixes inline code suggestion formatting issues by automatically sanitising line-number prefixes, stripping outer markdown block fences, and dynamically auto-aligning indentation levels across all code depth nesting.
✏️ Code Suggestion Sanitisation & Line-Number Prefix Stripping
- Line-Number Prefix Filtering: Added
sanitize_code_suggestion()to automatically strip line-number prefixes (e.g.,105 |,105 + |,L105:) from inline code suggestions before posting to GitHub. - Strict Regex Matching: Differentiates pipe-delimited plain number prefixes (
105 |) from valid Python dictionary keys ({105: "foo"}) or switch labels (case 105:), preserving valid code structures. - Markdown Block Fence Clean-Up: Automatically strips outer markdown fences (
```or```suggestion) if emitted by Gemini insidecode_suggestion.
📐 Automatic Indentation Alignment across All Nesting Depths
-
Dynamic Target Indentation Matching: Added
_auto_align_suggestion_indentation()to measure the exact leading indentation (spaces or tabs) of target source lines in the repository file. -
Under-Indentation Delta Calculation: Automatically calculates indentation offsets (
$$\text{delta} = \text{target_indent} - \text{first_s_indent}$$ ) and prepends proper leading whitespace to suggestions starting with 0 or partial indentation. - Supports All Indentation Depths: Correctly aligns suggestions across any nesting level (2, 4, 8, 12, 16+ spaces or tabs) while preserving relative multi-line block indentation.
📋 System Instruction & Schema Rules
- Prompt Reinforcement: Updated
suggestion_instructioninprompts.pyto explicitly direct Gemini to avoid line numbers, line prefixes, or code block fences. - Schema Documentation: Updated
InlineComment.code_suggestiondescription inschemas.pyfor stricter structural formatting guidance.
🧪 Test Suite & Quality Assurance
- Added unit tests for
sanitize_code_suggestionand multi-level indentation alignment (test_auto_align_suggestion_indentation_deep_nesting,test_auto_align_suggestion_indentation_tabs). - 75 total unit tests passing cleanly.
- Verified with
codespellandruff.
v1.5.0: Multi-Axis Code Quality Review Directives & Documentation
🌟 What's New in v1.5.0
This release introduces comprehensive multi-axis code quality directives into starter-examples/gemini-review.toml, enhancing Gemini's review capabilities with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.
🎯 Multi-Axis Quality Review Directives
- Five-Axis Quality Axes: Systematic technical review criteria across Correctness & Verification, Readability & Simplicity, Architecture & System Design, Security & Data Hardening, and Performance & Efficiency.
- Constructive Structural Remedies: Directives instructing Gemini to propose named restructurings (e.g. replacing conditional chains with typed dispatchers, collapsing duplicate branches, separating orchestration from business logic).
- Review Philosophy ("Lead with Leverage"): Introduced Code Health Improvement standards and prioritization rules (correctness, security, and structural regressions first; cosmetic nits last).
- Dependency & Refactoring Discipline: Added strict guidance against niche dependencies, changelog and lockfile diff reviews, and rules for identifying dead code artifacts.
- Common Rationalisations: Instructed Gemini to actively reject superficial excuses ("it works so it's good enough", "relocating code made it cleaner").
📚 Documentation & Process Updates
- Refined multiline prompt formatting and line-wrapping across TOML example templates.
- Updated release procedures and GitHub Marketplace metadata synchronization guidelines in README.md and docs/architecture.md.
v1.4.5: Line Range Accuracy, Re-Review Suppression & Input Parameter Standards
🚀 What's New in v1.4.5
This release introduces accurate inline code suggestion line range targeting, suppresses redundant re-review loops on inline fixes, establishes clear Action input parameter standards, and consolidates all 1.4.x features and bug fixes.
✏️ Line Range Accuracy & Inline Fix Duplication Fix (v1.4.5)
- Inline Suggestion Range Auto-Correction: Added
_auto_correct_suggestion_rangetofilter_review_comments. Whencode_suggestioncontains multi-line original code andstart_linewas omitted (None), the action inspects file diff lines using contiguous sequential matching and automatically setsstart_lineandlinerange bounds. - Eliminate Duplicated Code Blocks: Prevents GitHub's inline "Commit suggestion" button from replacing single lines with multi-line blocks that duplicate surrounding code.
- System Instruction Guidance: Updated
InlineCommentschema docstrings and system instructions to explicitly mandate[start_line..line]range bounds whenever multi-line original code is included in suggestions.
🔕 Re-Review Suppression on Inline Suggestion Commits (v1.4.5)
- Ignore GitHub UI Suggestion Commits: Added
is_inline_suggestion_commit()to detect commits created when developers click "Commit suggestion" in GitHub UI (web-flow/noreply@github.comcommitter with suggestion commit patterns). - Graceful Skip: On
pull_request: synchronizeevents, if the commit was created by accepting an inline suggestion,gemini_pr_review.pylogs a skip notice and exits gracefully (sys.exit(0)), preventing noisy and unneeded immediate re-review passes. - Configurable Input: Controlled via
skip_inline_suggestions: 'true'inaction.ymlinputs andGEMINI_SKIP_INLINE_SUGGESTIONSenv var (default:'true').
⚙️ Action Input Parameter Standards & AGENTS.md Rule (v1.4.5)
- Workflow Input Parameter Architecture: Operational configuration parameters (such as
skip_inline_suggestions,include_comment_history,language,persona,timeout) MUST be configured via action input parameters inaction.yml, workflow.ymlfiles, and environment variables (GEMINI_*). - TOML Prompt Scope:
gemini-review.tomlis strictly reserved for prompt text templates and custom prompt overrides. - Project Guidance: Documented parameter vs TOML configuration rules in
AGENTS.md.
🔄 Automatic PR Status Check Updates & Permissions (v1.4.3 & v1.4.4)
- Commit Statuses API Integration: Added
post_commit_statustogemini_review/github.py. Posts a commit status check update (state='success',context="Dazbo's Gemini Code Review / review (pull_request)") to GitHub upon review completion. - Required Workflow Permissions: Updated workflows to require
statuses: writeandchecks: writepermissions.
🐛 Defensive Response Parsing & Exception Guarding (v1.4.2)
- Safely Handle Null/Empty Gemini API Responses: Fixed unhandled
TypeErrorwhenresponse.textisNone. - Property Getter Exception Guarding: Wrapped property accesses on
response.text,candidates,function_calls, andprompt_feedbackintry...exceptblocks inextract_response_text_or_raise. - Candidate Diagnostic Logging: Logs candidate
finish_reason,finish_message, safety ratings, and function call attempts tosys.stderrwhen text output is missing.
🧠 Holistic Engineering Review Scope (v1.4.2)
- Comprehensive Evaluation: Expanded system instructions and persona guidance to evaluate documentation updates (
.mdfiles, READMEs, architecture records) alongside source code. - Expanded PR Summary Budget: Target PR summary budget set to 3–6 sentences.
🧪 Rick Sanchez Persona & Context Cache Isolation (v1.4.1)
- Rick Sanchez Persona (
rick): Added Rick Sanchez from Rick and Morty as a selectable reviewer persona overlay (persona: 'rick'). - Persona Context Cache Isolation: Appended active persona suffix to Gemini context cache key (
repo-cache-{repo}-{model}-{persona}) to guarantee persona cache separation.
🧪 Test Coverage & Quality
- Added unit tests for
is_inline_suggestion_commit,_auto_correct_suggestion_range,post_commit_status, property getter exceptions, and persona cache isolation (70 total unit tests passing). - Fully formatted and validated with
ruffandcodespell.
v1.4.1 - Rick Sanchez Persona & Context Cache Isolation
Release v1.4.1 - Rick Sanchez Persona & Context Cache Isolation
🧪 What's New:
- Rick Sanchez Persona (
rick): Added Rick Sanchez from Rick and Morty as a selectable reviewer persona overlay (persona: 'rick').- Tone & Style: Hyper-intelligent, cynical multiverse genius (
*burp*, "*Wubba Lubba Dub-Dub**Rick Sanchez Persona (rick) **: Added Rick Sanchez from Rick and Morty as a selectable reviewer persona overlay (persona: 'rick') .", "Jerry-tier code"). - Engineering Standards: Demands galaxy-brain engineering perfection, treating sloppy bugs or missing error handling as pathetic Jerry-level amateur work.
- Tone & Style: Hyper-intelligent, cynical multiverse genius (
- Persona Context Cache Isolation: Appended active persona suffix to Gemini context cache key (
repo-cache-{repo}-{model}-{persona}) to guarantee that switching personas immediately invalidates old cached system instructions. - Unit Tests & Docs: Full test coverage in
tests/test_pr_review.py(62 tests passing) including persona cache invalidation tests and updated documentation withassets/rick-review.png.
v1.3.5: Model-Validated Context Caching & Resilience Fallback
What's Changed
- Model-Validated Context Caching: Prevents
INVALID_ARGUMENT400 errors when switching Gemini models (e.g. fromgemini-3.5-flashtogemini-3.6-flash). Context cache display names are now model-scoped (repo-cache-{repo}-{model}) and existing server cache handles are validated against the requested model before reuse. - Resilient Generation Fallback: If calling
generate_contentwith a cached content handle fails for any reason, the action logs a warning and automatically falls back to direct context generation without interrupting the CI pipeline. - Vertex AI / Publisher Prefix Normalisation: Enhanced
_normalize_model_name()to handle Vertex AI / Agent Platform resource strings (publishers/google/models/...). - Dogfooding Workflows: Upgraded repository GitHub Actions workflow configurations to
gemini-3.6-flash.
Full Changelog: v1.3.4...v1.3.5