fix(acp): resolve provider default model instead of leaking sentinel "current" - #10305
Merged
Merged
Conversation
…current When switching providers via set_config_option, the ACP server unconditionally defaulted the model to ACP_CURRENT_MODEL (current) when no explicit model was provided. This sentinel is only valid for ACP providers (claude-acp, codex-acp, etc.) where the agent manages its own model — for non-ACP providers like databricks_v2 it leaks the literal string current to the AI Gateway, causing a 404. Fix: resolve the default model from the new provider's registry entry. For ACP providers this is still current (no behavior change); for other providers it resolves to the actual default model. Also adds a defense-in-depth guard in restore_provider_from_session for sessions already saved with the sentinel on a non-ACP provider, so existing affected users are fixed on next session restore without needing to toggle models manually. Fixes BOT-1172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
ACP_CURRENT_MODELsentinel value"current"leaks unresolved to the Databricks AI Gateway (and other non-ACP providers), causing a 404 "Resource not found" error on every new session for affected users. This is the most-reported issue in the #berd-internal-beta Slack channel over the past week (7+ users hit it between June 29 – July 7).Linear ticket: BOT-1172
The error users see
Every new session fails. Existing sessions work fine. The workaround users found is toggling the model to a different one and back — but this is manual and doesn't fix the root cause.
Root cause
PR #9953 ("provider refactor: don't require a model config to create a provider", merged June 23) removed the sentinel resolution from
AcpProvider::connect()and replaced it withapply_model_if_changed()— which explicitly skips when the model is"current"(early return). So the sentinel never gets resolved for non-ACP providers.The primary leak point is
update_providerincrates/goose/src/acp/server.rs. When a user switches providers viaset_config_option("provider", ...)without an explicit model,is_changing_provideris true and the default model is hardcoded toACP_CURRENT_MODEL:This sentinel is only valid for ACP providers (claude-acp, codex-acp, etc.) where the agent manages its own model selection. For non-ACP providers like
databricks_v2, the literal string"current"gets sent to the gateway → 404.Changes
1. Primary fix —
crates/goose/src/acp/server.rs(update_provider)Resolve the default model from the new provider's registry entry instead of hardcoding the sentinel. For ACP providers,
entry.metadata().default_modelis"current"(no behavior change). For non-ACP providers, it resolves to the actual default model (e.g.databricks-gpt-5-5).2. Defense-in-depth —
crates/goose/src/agents/agent.rs(restore_provider_from_session)For sessions already saved with the sentinel on a non-ACP provider, resolve the default model from the registry on session restore. This fixes existing affected users on next app restart without needing to toggle models manually.
Why this affects so many users right now
The sentinel is the default model for any fresh install or after config resets. The Goose → Berd rename/reconfiguration reset many users' configs, which is why reports started June 29 (a few days after the June 23 merge) and are still coming in.
Validation
cargo check -p goose— cleancargo clippy -p goose -- -D warnings— no warningscargo test -p goose -- providers— 334 passed (4 pre-existing JWT/crypto failures unrelated to this change)