Skip to content

feat: gemini cli agent#46

Closed
matejpekar wants to merge 1 commit into
mainfrom
gemini-cli
Closed

feat: gemini cli agent#46
matejpekar wants to merge 1 commit into
mainfrom
gemini-cli

Conversation

@matejpekar
Copy link
Copy Markdown
Member

@matejpekar matejpekar commented Mar 19, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Automated pull request reviews powered by Gemini CLI
    • Intelligent issue triage with automatic label assignment
    • New GitHub workflow dispatch system enabling automated command execution via comments
    • Scheduled background triage operations
  • Chores

    • Updated development artifact and credential file management

@matejpekar matejpekar requested review from a team March 19, 2026 10:50
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hi @matejpekar, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces GitHub Actions automation powered by Gemini CLI, adding five command configurations and six workflow files to enable automated PR reviews, issue triage, and plan execution. The changes integrate Gemini with MCP servers for GitHub operations and include a dispatch workflow that routes commands to appropriate automation workflows.

Changes

Cohort / File(s) Summary
Gemini Command Configurations
.github/commands/gemini-invoke.toml, gemini-plan-execute.toml, gemini-review.toml, gemini-scheduled-triage.toml, gemini-triage.toml
Added five TOML files defining Gemini CLI prompts with detailed constraints, personas, and control-flow instructions. Each specifies tool usage policies, security requirements (treating inputs as untrusted, preventing command substitution), and standardized output formatting (JSON, conventional commits, or labeled arrays).
Dispatch Workflow
.github/workflows/gemini-dispatch.yml
New workflow that listens to PR and issue events; conditionally parses event context and determines command type (review, triage, invoke, plan-execute, fallthrough); gates subsequent job execution based on computed command and handles authentication via optional GitHub App token minting.
Reusable Core Workflows
.github/workflows/gemini-review.yml, gemini-triage.yml, gemini-invoke.yml, gemini-plan-execute.yml
Four reusable workflows (callable via workflow_call) that execute Gemini CLI with tailored configurations for their respective tasks. Each conditionally mints GitHub App tokens, passes context-derived environment variables, and configures MCP server tooling and telemetry.
Scheduled Triage Workflow
.github/workflows/gemini-scheduled-triage.yml
New hourly-triggered workflow with two jobs: triage fetches repository labels and open issues, runs Gemini analysis, and outputs triaged issues; label applies computed labels to issues via GitHub API with optional app token authentication.
Configuration
.gitignore
Extended to ignore .gemini/ directory (Gemini state/outputs) and gha-creds-*.json files (GitHub Actions credentials).

Sequence Diagram(s)

sequenceDiagram
    participant Event as GitHub Event<br/>(PR/Issue)
    participant Dispatch as Dispatch<br/>Workflow
    participant Router as Command<br/>Router
    participant Review as Review<br/>Workflow
    participant Triage as Triage<br/>Workflow
    participant Invoke as Invoke<br/>Workflow
    participant Gemini as Gemini CLI<br/>+ MCP
    participant GitHub as GitHub API

    Event->>Dispatch: PR/Issue opened,<br/>comment `@gemini-cli`
    Dispatch->>Dispatch: Parse event type,<br/>extract command
    Dispatch->>Router: Determine command<br/>(review/triage/invoke)
    
    alt Review Command
        Router->>Review: Trigger with context
        Review->>Review: Mint GitHub App token
        Review->>Gemini: Run review prompt<br/>with PR diff
        Gemini->>GitHub: Submit pending review
    else Triage Command
        Router->>Triage: Trigger with context
        Triage->>Triage: Fetch available labels
        Triage->>Gemini: Run triage prompt<br/>with issue content
        Gemini->>Triage: Output selected labels
        Triage->>GitHub: Apply labels to issue
    else Invoke Command
        Router->>Invoke: Trigger with context
        Invoke->>Gemini: Run invoke prompt<br/>with additional context
        Gemini->>GitHub: Perform operations<br/>via MCP tools
    end
    
    Dispatch->>GitHub: Post acknowledgment comment
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The review requires evaluating intricate prompt logic with security constraints, understanding authentication flows across multiple workflows, assessing MCP server configurations, analyzing the dispatch routing logic, and verifying environment variable threading through coordinated workflows. The heterogeneous nature of changes (five distinct command configs plus six workflow types with different purposes) and dense conditional logic demand separate reasoning for each cohort.

Poem

🐰 A swift dispatch, commands routed with care,
Gemini reviews and triages with flair!
MCP tools dance through the automation flow,
Issues labeled, PRs judged—watch the system go! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: gemini cli agent' directly relates to the main change: adding Gemini CLI agent automation workflows and configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gemini-cli
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use your project's `pylint` configuration to improve the quality of Python code reviews.

Add a pylint configuration file to your project to customize how CodeRabbit runs pylint.

@gemini-code-assist
Copy link
Copy Markdown

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 integrates a suite of Gemini CLI agents into the GitHub Actions workflow, establishing a framework for advanced AI-driven automation. These agents are designed to handle distinct phases of software development, from initial task analysis and planning to code review and issue management, all while adhering to strict security and operational guidelines. The overall goal is to automate and streamline various development tasks, making the workflow more efficient and robust.

Highlights

  • Introduced Gemini CLI Agents: New TOML configurations were added to define various Gemini CLI agents for GitHub Actions, enabling advanced AI-driven automation.
  • Defined Agent Roles: Specific agents were configured for distinct roles including task invocation, plan execution, comprehensive code review, and both scheduled and individual issue triaging.
  • Enhanced Security Protocols: Each agent configuration includes critical constraints and security protocols to ensure safe and controlled operation within the GitHub Actions environment.
  • Updated Git Ignore: The .gitignore file was modified to exclude Gemini-specific configuration and credential files, improving repository hygiene and security.
Ignored Files
  • Ignored by pattern: .github/workflows/** (6)
    • .github/workflows/gemini-dispatch.yml
    • .github/workflows/gemini-invoke.yml
    • .github/workflows/gemini-plan-execute.yml
    • .github/workflows/gemini-review.yml
    • .github/workflows/gemini-scheduled-triage.yml
    • .github/workflows/gemini-triage.yml
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 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 counter productive. 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.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 I'm sorry @matejpekar, but I was unable to process your request. Please see the logs for more details.

Copy link
Copy Markdown

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

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 a series of configuration files for a new Gemini CLI agent, defining its behavior through detailed prompts for various tasks like planning, execution, code review, and issue triage. My review focuses on improving the clarity, consistency, and correctness of these prompts to ensure the agent behaves as expected. I've identified a few areas with duplicate instructions, ambiguous placeholders, and grammatical errors that could be improved.

Comment on lines +61 to +62
1. **Analyze Intent**: Determine the user's goal (bug fix, feature, etc.). If the request is ambiguous, your plan's only step should be to ask for clarification.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a duplicated step in the "Plan of Action". The first step "Analyze Intent" is listed twice with slightly different wording, and the numbering is incorrect (1. followed by 1. again). This could confuse the agent. To improve clarity and correctness, the duplicated step should be removed.


Before taking any action, you must locate the latest plan of action in the issue comments.

1. **Search for Plan**: Use `issue_read` and `issue_read.get_comments` to find a latest plan titled with "AI Assistant: Plan of Action".
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There's a minor grammatical error in the prompt. Using "the" instead of "a" would make the instruction clearer for the agent, as it should be looking for the single most recent plan.

1. **Search for Plan**: Use `issue_read` and `issue_read.get_comments` to find the latest plan titled with "AI Assistant: Plan of Action".

Comment on lines +72 to +73
6. **Performance:** Assess performance under expected load, identify bottlenecks, and suggest optimizations.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The review criteria list contains redundant items. "Efficiency" (item 3) and "Performance" (item 6) cover very similar concepts. This duplication could be confusing for the agent. It's better to have a single, clear criterion. I suggest removing the "Performance" item to avoid ambiguity.

4. Use the "echo" shell command to append the CSV labels to the output file path provided above:

```
echo "SELECTED_LABELS=[APPROPRIATE_LABELS_AS_CSV]" >> "[filepath_for_env]"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The placeholder "[filepath_for_env]" in the example shell command is ambiguous. To ensure the agent correctly identifies the output file, it's better to use the exact variable name "$GITHUB_ENV" which is provided in the "Input Data" section. This makes the instruction more explicit and less prone to misinterpretation.

    echo "SELECTED_LABELS=[APPROPRIATE_LABELS_AS_CSV]" >> "$GITHUB_ENV"

@matejpekar matejpekar closed this Mar 19, 2026
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