Skip to content

feat: add gemini-acp provider, update docs on subscription models + improvements to codex#8000

Merged
michaelneale merged 10 commits intomainfrom
micn/gemini-acp-provider
Mar 19, 2026
Merged

feat: add gemini-acp provider, update docs on subscription models + improvements to codex#8000
michaelneale merged 10 commits intomainfrom
micn/gemini-acp-provider

Conversation

@michaelneale
Copy link
Copy Markdown
Collaborator

@michaelneale michaelneale commented Mar 19, 2026

Summary

Add an ACP provider for Google's Gemini CLI. Gemini CLI supports ACP natively via its --acp flag, so no shim is needed (unlike claude-acp and codex-acp which use @zed-industries shims).

Also fixes up codex for 5.3, and deprecates old CLI ones, documents. blog etc.

Changes

  • crates/goose/src/providers/gemini_acp.rs — New provider that spawns gemini --acp over stdio, using the shared AcpProvider infrastructure
  • crates/goose/src/providers/mod.rs — Register the module
  • crates/goose/src/providers/init.rs — Register in provider registry

How it works

Same pattern as claude_acp.rs and codex_acp.rs:

  • Resolves the gemini binary via SearchPaths::builder().with_npm()
  • Passes --acp arg to enable ACP mode
  • Maps Goose modes to Gemini's approval modes:
    Goose Mode Gemini Mode
    auto yolo
    approve default
    smart-approve auto_edit
    chat plan

Testing

Tested end-to-end alongside the other two ACP providers:

# All three respond correctly
GOOSE_PROVIDER=claude-acp GOOSE_MODEL=default goose run -t "say hello" --no-profile     #
GOOSE_PROVIDER=codex-acp GOOSE_MODEL=gpt-5.2-codex goose run -t "say hello" --no-profile #
GOOSE_PROVIDER=gemini-acp GOOSE_MODEL=default goose run -t "say hello" --no-profile      #

# Tool use (listing files) also works
GOOSE_PROVIDER=gemini-acp GOOSE_MODEL=default goose run -t "list files" --no-profile     #

Prerequisites

Install Gemini CLI: npm install -g @google/gemini-cli
Auth: run gemini once to authenticate via browser

Add ACP provider for Google's Gemini CLI, which supports ACP natively
via the --acp flag. This follows the same pattern as claude-acp and
codex-acp, using the shared AcpProvider infrastructure.

The provider spawns 'gemini --acp' over stdio and maps Goose modes to
Gemini's approval modes (yolo, default, auto_edit, plan).

Signed-off-by: Michael Neale <michael.neale@gmail.com>
* origin/main:
  fix(openai): use Responses API for gpt-5.4 (#7982)
  Remove lead/worker provider (#7989)
  chore(release): release version 1.28.0 (#7991)
  Fix empty tool results from resource content (e.g. auto visualiser) (#7866)
  Separate SSE streaming from POST work submission (#7834)
  fix: include token usage in Databricks streaming responses (#7959)
  Optimize tool summarization (#7938)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 246bf157b8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/providers/gemini_acp.rs Outdated
env_remove: vec![],
work_dir: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
mcp_servers: extension_configs_to_mcp_servers(&extensions),
session_mode_id: Some(map_goose_mode(goose_mode)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Derive the initial ACP mode from the session, not global config

This freezes session_mode_id from Config::get_goose_mode() at provider construction time. That breaks the common path where Goose changes the mode before the first prompt (ExecutionManager::get_or_create_session and Agent::restore_provider_from_session both call update_mode() pre-session): AcpProvider::update_mode() only updates its in-memory GooseMode, but session/new later still uses the stale session_mode_id. A new or resumed gemini-acp session opened in Chat/Approve/SmartApprove can therefore start its first turn in whatever global mode was active at startup (often yolo), which is a real approval/safety regression.

Useful? React with 👍 / 👎.

Comment on lines +52 to +55
let provider_config = AcpProviderConfig {
command: resolved_command,
args: vec!["--acp".to_string()],
env: vec![],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass Goose's selected Gemini model into the ACP subprocess

Unlike the existing gemini-cli provider, this ACP provider never threads model.model_name into Gemini: it always spawns gemini --acp, and AcpProvider::stream() ignores _model_config when creating the session. As a result, any non-default model selected in Goose (for example flash/pro) is silently ignored and Gemini falls back to its own default model, even though Gemini CLI's current reference documents --model/-m for model selection (https://geminicli.com/docs/cli/cli-reference/).

Useful? React with 👍 / 👎.

- Add gemini-acp to ACP providers table in providers.md
- Add Gemini ACP setup, config, and usage to acp-providers.md
- Mark claude-code, codex, and gemini-cli as deprecated in provider
  descriptions (source code and docs), pointing to ACP alternatives
- Add deprecation banner to cli-providers.md
- Add subscription usage tip to acp-providers.md
- Include ACP provider testing guide

Signed-off-by: Michael Neale <michael.neale@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-19 02:37 UTC

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1eda89a2e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +72 to +75
GooseMode::Auto => "yolo".to_string(),
GooseMode::Approve => "default".to_string(),
GooseMode::SmartApprove => "auto_edit".to_string(),
GooseMode::Chat => "plan".to_string(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve Gemini ACP mode IDs after the first turn

This mapping is only used during session/new. After a gemini-acp session exists, Agent::update_goose_mode() goes through AcpProvider::update_mode(), which sends mode.to_string().to_lowercase() (auto, approve, smart-approve, chat) in session/set_mode (crates/goose/src/acp/provider.rs:288-304). Gemini's mode IDs here are yolo, default, auto_edit, and plan, so any mid-session mode change will either be rejected by the agent or leave the old approval policy active. That is a real safety/usability regression for users who switch from Auto to Approve/Chat after the session has started.

Useful? React with 👍 / 👎.

Comment on lines +41 to +43
let resolved_command = SearchPaths::builder()
.with_npm()
.resolve(GEMINI_ACP_BINARY)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Respect the configured Gemini command for ACP startup

Unlike GeminiCliProvider::from_env() (crates/goose/src/providers/gemini_cli.rs:50-53), this always resolves the literal gemini binary and the new provider exposes no GEMINI_CLI_COMMAND config key in metadata(). In environments that already depend on a custom Gemini wrapper/path (for example desktop installs where Goose can only reach Gemini through a configured command), the deprecated gemini-cli provider still works but gemini-acp cannot be created, so migration to the new provider fails even with an otherwise valid setup.

Useful? React with 👍 / 👎.

Comment thread documentation/docs/getting-started/providers.md Outdated
Signed-off-by: Michael Neale <michael.neale@gmail.com>
Copy link
Copy Markdown
Collaborator

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

change looks good, I think we can decide to not deprecate and instead remove in another PR or remove in this. ether way is fine by me.

only main suggestion is to plumb it into crates/goose/tests/providers.rs and give it a run to make sure most things work.

Finally, the bot comments about looking up the provider's default mode etc, I would punt them for now. This affects all ACP providers and not terribly critical to do here,

Comment thread ACP_PROVIDER_TESTING_GUIDE.md Outdated
./target/debug/goose run -t "say hello and nothing else" --no-profile

# Gemini ACP
GOOSE_PROVIDER=gemini-acp GOOSE_MODEL=default \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe add a link to crates/goose/tests/providers.rs because we have more comprehensive there.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah I will get rid of this doc - was just for me

Comment thread ACP_PROVIDER_TESTING_GUIDE.md Outdated
### Debug logging

```bash
RUST_LOG=debug GOOSE_PROVIDER=gemini-acp GOOSE_MODEL=default \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in worst case RUST_BACKTRACE=full RUST_LOG=debug,sacp=trace and also maybe note the location of the logs.

e.g. something I'm working on now I did this

$ GOOSE_PROVIDER=claude-acp GOOSE_MODEL=default RUST_LOG=debug,sacp=trace target/release/goose run -t "say hello"
# After goose exits:
$ grep -h 'session/close' ~/.local/state/goose/logs/cli/*/*.log
# Expect: outgoing session/close request and successful response

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 154898bddf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/providers/gemini_acp.rs Outdated
@michaelneale michaelneale changed the title feat: add gemini-acp provider feat: add gemini-acp provider, update docs on subscription models + improvements to codex Mar 19, 2026
…e for gpt-5.3-codex

gpt-5.3-codex was flaky with tool calling — it would often respond
conversationally instead of making tool calls. Adding a brief preamble
to the instructions (use your tools, keep going, don't guess) fixes
this reliably.

Also adds gpt-5.4 (omni model) to the known models list.

Signed-off-by: Michael Neale <michael.neale@gmail.com>
…ide from repo

Change default from gpt-5.1-codex to gpt-5.3-codex as the recommended
model for new chatgpt_codex setups. Remove ACP_PROVIDER_TESTING_GUIDE.md
from tracked files (kept locally).

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4cd6c4d0e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/providers/gemini_acp.rs
Comment thread crates/goose/src/providers/chatgpt_codex.rs
… improve gemini-acp

- Remove deprecated claude-code, codex, gemini-cli from providers.md
  table (Angie's feedback). They remain in code with deprecated
  descriptions for existing users.
- gemini-acp: pass --model flag when model != 'default' so non-default
  model selection works (codex bot P2 feedback).
- gemini-acp: respect GEMINI_CLI_COMMAND config for custom gemini paths,
  matching the deprecated gemini-cli provider (codex bot P2 feedback).
- Add gemini-acp to crates/goose/tests/providers.rs (Adrian's feedback).

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: Michael Neale <michael.neale@gmail.com>
@michaelneale michaelneale added this pull request to the merge queue Mar 19, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 881d5081aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +56 to +60
let provider_config = AcpProviderConfig {
command: resolved_command,
args,
env: vec![],
env_remove: vec![],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve PATH enrichment when spawning Gemini ACP

In desktop installs where the app inherits a minimal PATH, the new provider can resolve the gemini wrapper but still fail to launch it. GeminiCliProvider::build_command() explicitly injects SearchPaths::builder().with_npm().path() before spawning for this reason, while spawn_acp_process() only inherits config.env; with env left empty here, npm/Homebrew locations (and the node interpreter used by many npm shims) are no longer added. That makes gemini-acp unusable in environments where the deprecated gemini-cli provider still works.

Useful? React with 👍 / 👎.

Comment on lines +48 to +50
pub const CHATGPT_CODEX_DEFAULT_MODEL: &str = "gpt-5.3-codex";
pub const CHATGPT_CODEX_KNOWN_MODELS: &[&str] = &[
"gpt-5.4",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the ChatGPT Codex UI default aligned with the provider default

The desktop model switcher does not use default_model; it asks the backend for recommended models, then SwitchModelModal::findPreferredModel() falls back to the first returned entry when no regex matches. fetch_recommended_models() sorts ChatGPT models by release date, and the canonical registry dates gpt-5.4 after gpt-5.3-codex, so adding gpt-5.4 here makes the UI preselect gpt-5.4 whenever a user switches to chatgpt_codex. That silently diverges from the declared default gpt-5.3-codex and bypasses the new GPT-5.3-specific prompt tuning in create_codex_request().

Useful? React with 👍 / 👎.

Merged via the queue into main with commit 5be96c1 Mar 19, 2026
24 checks passed
@michaelneale michaelneale deleted the micn/gemini-acp-provider branch March 19, 2026 02:32
lifeizhou-ap added a commit that referenced this pull request Mar 20, 2026
* main: (22 commits)
  feat: add gemini-acp provider, update docs on subscription models + improvements to codex (#8000)
  fix(openai): use Responses API for gpt-5.4 (#7982)
  Remove lead/worker provider (#7989)
  chore(release): release version 1.28.0 (#7991)
  Fix empty tool results from resource content (e.g. auto visualiser) (#7866)
  Separate SSE streaming from POST work submission (#7834)
  fix: include token usage in Databricks streaming responses (#7959)
  Optimize tool summarization (#7938)
  fix: overwrite the deprecated googledrive extension config (#7974)
  refactor: remove unnecessary Arc<Mutex> from tool execution pipeline (#7979)
  Revert message flush & test (#7966)
  docs: add Remote Access section with Telegram Gateway documentation (#7955)
  fix: update webmcp blog post metadata image URL (#7967)
  fix: clean up OAuth token cache on provider deletion (#7908)
  fix: hard-coded tool call id in code mode callback (#7939)
  Fix SSE parsers to accept optional space after data: prefix (#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (#7961)
  Add WebMCP for Beginners blog post (#7957)
  Fix download manager (#7933)
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (#7626)
  ...
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…mprovements to codex (aaif-goose#8000)

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: esnyder <elijah.snyder1@gmail.com>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…mprovements to codex (aaif-goose#8000)

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: esnyder <elijah.snyder1@gmail.com>
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