Skip to content

feat(pr-generator-agent): implement Antigravity agent runner and prompt templates …#28434

Open
joneba-google wants to merge 2 commits into
google-gemini:mainfrom
JonE01:pr-generator-prompts
Open

feat(pr-generator-agent): implement Antigravity agent runner and prompt templates …#28434
joneba-google wants to merge 2 commits into
google-gemini:mainfrom
JonE01:pr-generator-prompts

Conversation

@joneba-google

@joneba-google joneba-google commented Jul 17, 2026

Copy link
Copy Markdown

Overview

This PR introduces the system prompt markdown templates for the Gemini CLI SSR Code Generation Pipeline. These prompts guide the headless Antigravity AI agents through the iterative code generation, quality assurance, and feedback refinement lifecycle.
──────

Summary of Changes

1. Automated Bug Fixer Prompt (bug_fixer_prompt.md)

• Configures the Coding Agent role for initial bug resolution and test-driven implementation.
• Enforces strict execution rules: mandatory file edits using sandbox editing tools (replace_file_content / write_file) and prohibits ending turns after passive file viewing.
• Outlines the structured four-phase workflow: specification ingestion from firestore_doc.json, code patch application, targeted test execution (e.g., Vitest/Jest), and local verification.

2. Code Evaluator Prompt (code_evaluator_prompt.md)

• Configures the Evaluator Agent acting as the quality gatekeeper before PR submission.
• Evaluates code changes (changes.diff) across correctness, ReDoS/security risks, readability standards, and test coverage against the original issue spec.
• Instructs the agent to inspect pre-generated ESLint reports (linter_output.txt) and output a structured verdict to verdict.json (APPROVED vs NEEDS_REVISION).
• Defines formatting rules for pr_details.md (generating standardized commit messages and PR descriptions) or pr_feedback.md (actionable feedback on failure).

3. Code Revision Prompt (code_revision_prompt.md)

• Configures the Revision Agent for subsequent loop iterations when an initial patch is rejected.
• Guides the agent to ingest evaluator feedback from pr_feedback.md, cross-reference the original issue spec, and address identified correctness, security, or linting defects.
• Implements a strict turn budget (maximum 3 turns) and prohibits exploratory Git overhead to optimize execution speed.

@joneba-google
joneba-google requested a review from a team as a code owner July 17, 2026 18:55
@github-actions github-actions Bot added the size/l A large sized PR label Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 476
  • Additions: +476
  • Deletions: -0
  • Files changed: 4

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the foundational infrastructure for the Gemini CLI Issue-to-PR pipeline. By introducing modular system prompts and a robust execution runner, the changes enable automated, iterative code generation and validation, significantly streamlining the workflow from issue identification to pull request submission.

Highlights

  • Agent Prompt Templates: Introduced three specialized system prompt templates (bug_fixer, code_evaluator, and code_revision) to guide the Antigravity AI agents through the code generation and quality assurance lifecycle.
  • Agent Runner Implementation: Implemented the AgentRunner Python class to handle asynchronous agent execution, workspace context management, and automated tool call approvals.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces system prompts for automated bug fixing, code evaluation, and code revision agents, alongside a Python runner (agent_runner.py) utilizing the Google Antigravity SDK to manage these agents. The review feedback highlights critical security and concurrency concerns in the runner implementation. Specifically, there are risks of Remote Code Execution (RCE) due to unrestricted tool auto-approval and permissive policies, a path traversal vulnerability in _load_prompt_file, and concurrency issues arising from process-wide directory changes (os.chdir) that must be serialized using an asynchronous lock. Additionally, the module docstring should be updated to accurately reflect these serialization controls.

Comment thread tools/caretaker-agent/cloudrun/pr-generator/workflow/agent_runner.py Outdated
Comment thread tools/caretaker-agent/cloudrun/pr-generator/workflow/agent_runner.py Outdated
Comment thread tools/caretaker-agent/cloudrun/pr-generator/workflow/agent_runner.py Outdated
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Jul 17, 2026
@joneba-google joneba-google changed the title feat(agent): implement Antigravity agent runner and prompt templates … feat(pr-generator-agent): implement Antigravity agent runner and prompt templates … Jul 17, 2026
…obal, restricted tool calls, sanitized prompt file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant