Skip to content

Comments

feat: Add Google Gemini CLI as experimental agentic engine#16894

Merged
pelikhan merged 10 commits intomainfrom
copilot/recreate-gemini-agentic-support
Feb 19, 2026
Merged

feat: Add Google Gemini CLI as experimental agentic engine#16894
pelikhan merged 10 commits intomainfrom
copilot/recreate-gemini-agentic-support

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

  • Add Gemini constants to pkg/constants/constants.go (port 10003, version 0.29.0, env vars)
  • Update JSON schema to include "gemini" as valid engine value
  • Create pkg/workflow/gemini_engine.go - core engine implementation
  • Create pkg/workflow/gemini_logs.go - JSON log parsing with deduplication
  • Create pkg/workflow/gemini_mcp.go - MCP configuration rendering
  • Update pkg/workflow/domains.go - add GeminiDefaultDomains and helper function
  • Register Gemini engine in pkg/workflow/agentic_engine.go
  • Update pkg/workflow/agentic_engine_test.go - check expected engine IDs (not brittle count)
  • Create pkg/workflow/gemini_engine_test.go - unit tests with exact prompt format assertion
  • Update pkg/cli/completions_test.go - include gemini in expected engines
  • Add smoke-gemini.md agentic workflow
  • Remove ubuntu.com from ClaudeDefaultDomains (was breaking CI golden tests)
  • Regenerate WASM golden files without ubuntu.com
  • Add gemini to TestWasmGolden_AllEngines
  • Fix cmd/gh-aw/main_entry_test.go: add gemini test case, use dynamic error prefix check
  • Rebuild binary and recompile workflows

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 19, 2026 18:12
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Recreates Gemini engine support from PR #16595:
- Add Gemini constants (port 10003, version 0.29.0, env vars)
- Update JSON schema to include 'gemini' as valid engine
- Create gemini_engine.go with installation and execution steps
- Create gemini_logs.go for JSON log parsing
- Create gemini_mcp.go for MCP configuration
- Add GeminiDefaultDomains and helper function to domains.go
- Register Gemini engine in engine registry
- Update engine count tests to expect 4 engines
- Add comprehensive unit tests

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Recreate Gemini custom agentic engine support feat: Add Google Gemini CLI as experimental agentic engine Feb 19, 2026
Copilot AI requested a review from pelikhan February 19, 2026 18:27
@pelikhan pelikhan marked this pull request as ready for review February 19, 2026 18:46
Copilot AI review requested due to automatic review settings February 19, 2026 18:46
@pelikhan
Copy link
Contributor

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Google Gemini CLI as an experimental fourth built-in agentic engine, integrating it into engine registry, schema validation, firewall domain allowlists, and MCP configuration rendering.

Changes:

  • Introduces GeminiEngine implementation plus MCP config rendering and log-metrics parsing.
  • Wires gemini into engine registration, CLI completion tests, and workflow schema engine enums.
  • Expands allowed-domain defaults (Gemini domains + adds ubuntu.com to Claude defaults) and propagates domain list updates into compiled workflow lockfiles.

Reviewed changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/workflow/gemini_engine.go Implements Gemini engine install/exec steps and firewall wrapping.
pkg/workflow/gemini_engine_test.go Adds unit tests for Gemini engine installation/execution behavior.
pkg/workflow/gemini_logs.go Parses Gemini JSON output to extract token usage and tool-call metrics.
pkg/workflow/gemini_mcp.go Renders MCP server config for Gemini using shared JSON renderer.
pkg/workflow/domains.go Adds Gemini default domains + helper; adds ubuntu.com to Claude defaults.
pkg/constants/constants.go Adds Gemini LLM gateway port, model env vars, and default Gemini CLI version.
pkg/workflow/agentic_engine.go Registers the Gemini engine in the engine registry.
pkg/workflow/agentic_engine_test.go Updates built-in engine count expectation for registry tests.
pkg/parser/schemas/main_workflow_schema.json Adds gemini to engine enums (string + object variants) and updates descriptions.
pkg/cli/completions_test.go Updates engine-name completion tests to include gemini.
.github/workflows/typist.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/test-create-pr-error-handling.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/step-name-alignment.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/static-analysis-report.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/smoke-claude.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/sergo.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/semantic-function-refactor.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/scout.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/schema-consistency-checker.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/safe-output-health.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/prompt-clustering-analysis.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/lockfile-stats.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/instructions-janitor.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/go-pattern-detector.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/go-logger.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/go-fan.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/github-mcp-tools-report.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/github-mcp-structural-analysis.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/example-workflow-analyzer.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/developer-docs-consolidator.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-team-evolution-insights.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-security-red-team.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-safe-outputs-conformance.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-safe-output-optimizer.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-doc-updater.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-code-metrics.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/daily-choice-test.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/copilot-session-insights.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/copilot-agent-analysis.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/commit-changes-analyzer.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/cloclo.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/claude-code-user-docs-review.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/blog-auditor.lock.yml Updates allowed domain list to include ubuntu.com.
.github/workflows/audit-workflows.lock.yml Updates allowed domain list to include ubuntu.com.
Comments suppressed due to low confidence (1)

pkg/workflow/gemini_logs.go:77

  • GeminiEngine.ParseLogMetrics introduces new log-parsing behavior but there are no unit tests validating token extraction and tool-call counting from the Gemini JSON shape ({response, stats}). Add tests similar to pkg/workflow/codex_logs_test.go to cover: (1) models/input+output token summing, (2) tools call-count extraction, and (3) handling of non-JSON noise in the log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 149 to 156
stepContent := strings.Join(steps[0], "\n")

assert.Contains(t, stepContent, "name: Run Gemini", "Should have correct step name")
assert.Contains(t, stepContent, "id: agentic_execution", "Should have agentic_execution ID")
assert.Contains(t, stepContent, "gemini", "Should invoke gemini command")
assert.Contains(t, stepContent, "--output-format json", "Should use JSON output format")
assert.Contains(t, stepContent, "--prompt", "Should include prompt argument")
assert.Contains(t, stepContent, "/tmp/test.log", "Should include log file")
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The execution-step test only asserts that --prompt is present; it doesn’t validate the exact quoting/shape of the prompt argument. Add an assertion that the rendered command passes the prompt content without introducing extra literal quote characters (to prevent regressions in prompt construction).

Copilot uses AI. Check for mistakes.
Comment on lines 12 to 16
// Test that built-in engines are registered
supportedEngines := registry.GetSupportedEngines()
if len(supportedEngines) != 3 {
t.Errorf("Expected 3 supported engines, got %d", len(supportedEngines))
if len(supportedEngines) != 4 {
t.Errorf("Expected 4 supported engines, got %d", len(supportedEngines))
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This test asserts an exact engine count (len(supportedEngines) != 4), which will fail whenever a new built-in engine is added (even if everything else is correct). Prefer asserting that the expected engine IDs are present (and optionally that the count is >= the expected minimum) to make the test less brittle.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot add a smoke-gemini agentic workflow that uses the gemini agentic engine

@pelikhan
Copy link
Contributor

Copilot AI and others added 2 commits February 19, 2026 18:55
…aultDomains, add gemini to AllEngines test

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 19, 2026

@copilot merge main, fix build https://github.com/github/gh-aw/actions/runs/22195338313/job/64194036529?pr=16894

Merged main and fixed the build in c023fa2. The failure was caused by adding ubuntu.com to ClaudeDefaultDomains which invalidated the WASM golden files — regenerated them with -update and added gemini to TestWasmGolden_AllEngines.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw util (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw rt (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha w/js/**/*.json&#39; --ignore-path ../../../.prettierignore cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha x55To0DC_ (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c --jq .object.sha (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v5 --jq .object.sha h ../../../.prettierignore (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha w/js/**/*.json&#39; --ignore-path ../../../.prettierignore cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha --get-regexp cfg odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node (http block)
  • https://api.github.com/repos/anchore/sbom-action/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/git/ref/tags/v0 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/metadata-action/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v5 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/setup-buildx-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha ./cmd/gh-aw cfg 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha .egg ame $name) { hasDiscussionsEnabled } } (http block)

If you need me to access, download, or install something from one of these locations, you can either:

…dd smoke-gemini workflow, improve tests

- Remove ubuntu.com from ClaudeDefaultDomains (was causing CI golden test failures)
- Regenerate WASM golden files without ubuntu.com
- Add smoke-gemini.md agentic workflow for Gemini engine smoke testing
- Fix ParseLogMetrics to use map-based deduplication for tool calls
- Make TestEngineRegistry less brittle (check for expected IDs instead of exact count)
- Add exact prompt format assertion to gemini execution test

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 19, 2026

@copilot add a smoke-gemini agentic workflow that uses the gemini agentic engine

Added .github/workflows/smoke-gemini.md in c68f598. It validates GitHub MCP, file writing, bash tool, and build tests using the gemini engine.

@copilot fix tests https://github.com/github/gh-aw/actions/runs/22195338313/job/64194036342

Fixed in c68f598 — removed ubuntu.com from ClaudeDefaultDomains and regenerated the WASM golden files that were failing due to that addition.

@pelikhan
Copy link
Contributor

… add gemini test case

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 19, 2026

@copilot fix tests in https://github.com/github/gh-aw/actions/runs/22196313477/job/64197426081?pr=16894

Fixed in 54ed88f. TestValidateEngine in cmd/gh-aw/main_entry_test.go had a hardcoded error message expecting only 3 engines ('claude', 'codex', or 'copilot'). Updated to check only the stable prefix "invalid engine value '%s'. Must be" and added a valid gemini engine test case.

@pelikhan pelikhan merged commit 3064a1a into main Feb 19, 2026
56 checks passed
@pelikhan pelikhan deleted the copilot/recreate-gemini-agentic-support branch February 19, 2026 20:16
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.

3 participants