Skip to content

fix(acp): forward Pi model selection to the adapter - #10707

Merged
alexhancock merged 1 commit into
aaif-goose:mainfrom
fatwang2:fix/pi-acp-model-passthrough
Jul 27, 2026
Merged

fix(acp): forward Pi model selection to the adapter#10707
alexhancock merged 1 commit into
aaif-goose:mainfrom
fatwang2:fix/pi-acp-model-passthrough

Conversation

@fatwang2

Copy link
Copy Markdown
Contributor

Problem

The Pi (ACP) provider's model selection was display-only. goose read the adapter-advertised model config option to populate the picker, but whatever you selected never reached pi-acp — it kept using the Pi Droid session's default model. The UI (or Buzz's set_model) showed one model while a different one served the session.

Root cause

pi_acp.rs built its AcpProviderConfig with model_config_option_id: None. The generic ACP provider only pushes a model choice to the agent (via session/set_config_option) when that id is Some; with None, apply_model_if_changed short-circuits and sends nothing.

Fix

I verified against the installed adapter (pi-acp) that it advertises the model as a config option with id "model" (MODEL_CONFIG_ID), and its setSessionConfigOption handler applies the value via setSessionModel → proc.setModel(provider, id) (with provider/id parsing for prefixed IDs). So the adapter fully supports model changes over ACP.

Wire the picker's selection through by setting model_config_option_id: Some("model"), mirroring the Copilot provider — the only one that previously wired this up. Also populate session_config_options at session creation when a concrete model is configured, so resumed or switched sessions use the requested model instead of the agent default.

This is the same pattern as #10675 (which fixes the equivalent issue for the Claude Code ACP provider).

Testing

cargo check -p goose-providers passes. The apply_model_if_changed behavior is already covered by generic tests in acp/provider.rs (apply_model_if_changed_sends_set_config_option_on_change, apply_model_if_changed_skips_when_model_unchanged, apply_model_if_changed_noop_without_option_id, apply_model_if_changed_skips_sentinel_model); this is a one-line config change with no new branching to test (Copilot's identical config is likewise untested at the provider level).

Note: cargo check -p goose (full crate) could not be run locally due to a macOS 27 / sqlx_macros proc-macro dylib compatibility issue ("mis-aligned LINKEDIT string pool"), but the goose-providers crate that contains this change compiles cleanly.

The Pi ACP provider's model selection was display-only. goose read the
adapter-advertised model config option to populate the picker, but
whatever you selected never reached pi-acp — it kept using the Pi
Droid session's default model. The UI showed one model while a
different one served the session.

Root cause: pi_acp.rs built its AcpProviderConfig with
model_config_option_id: None. The generic ACP provider only pushes a
model choice to the agent (via session/set_config_option) when that id
is Some; with None, apply_model_if_changed short-circuits and sends
nothing.

Fix: pi-acp advertises a "model" config option (MODEL_CONFIG_ID) and
applies it via setSessionModel → proc.setModel(provider, id). Wire the
selection through by setting model_config_option_id: Some("model"),
mirroring the Copilot provider — the only one that previously wired
this up. Also populate session_config_options at session creation when
a concrete model is configured, so resumed or switched sessions use the
requested model instead of the agent default.

cargo check -p goose-providers passes. The apply_model_if_changed
behavior is already covered by generic tests in acp/provider.rs; this
is a config change with no new branching to test (Copilot's identical
config is likewise untested at the provider level).
@alexhancock
alexhancock merged commit a5f8835 into aaif-goose:main Jul 27, 2026
24 checks passed
lifeizhou-ap added a commit that referenced this pull request Jul 28, 2026
* main: (28 commits)
  chore(deps): bump postcss from 8.5.10 to 8.5.23 in /documentation (#10721)
  chore(deps-dev): bump js-yaml from 4.2.0 to 4.3.0 in /documentation (#10735)
  chore(deps): bump fast-uri from 3.1.2 to 3.1.4 in /documentation (#10647)
  chore(deps): bump svgo from 3.3.3 to 3.3.4 in /documentation (#10646)
  chore(deps): bump docker/login-action from 4.4.0 to 4.5.1 (#10670)
  chore(deps): bump ossf/scorecard-action from 2.4.3 to 2.4.4 (#10671)
  chore(deps): bump pypa/gh-action-pypi-publish from 1.14.0 to 1.14.1 (#10674)
  fix(providers): update DeepSeek model names to v4 API (#10729)
  fix(acp): forward Claude Code model picker selection to the adapter (#10675)
  fix(acp): forward Pi model selection to the adapter (#10707)
  fix(config): preserve enabled flag when migrating platform extensions (#10690)
  fix(acp): pass session working_dir to on_call_tool (#10689)
  fix(security): preserve adversary tool arguments (#10529)
  fix(local-inference): keep XML snippets inside JSON as data (#10606)
  fix: sync generated chat title in header (#10578)
  feat: tab completion and switch provider for `model` (#10585)
  fix(telegram): prompt for tool approval in gateway sessions (#10613)
  fix: keep CLI provider prompts out of process arguments (#10547)
  fix(providers): ignore stale inventory for static model lists (#10591)
  fix(ui): Refine dark theme message surfaces for consistent, compliant dark mode UX. (#10693)
  ...
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.

2 participants