fix(acp): forward Pi model selection to the adapter (#10707)
This commit is contained in:
@@ -58,6 +58,19 @@ impl ProviderDef for PiAcpProvider {
|
||||
let config = Config::global();
|
||||
let resolved_command = SearchPaths::builder().with_npm().resolve(PI_ACP_BINARY)?;
|
||||
let goose_mode = config.get_goose_mode().unwrap_or(GooseMode::Auto);
|
||||
let model = config
|
||||
.get_goose_model()
|
||||
.unwrap_or_else(|_| ACP_CURRENT_MODEL.to_string());
|
||||
|
||||
// pi-acp advertises a "model" config option (MODEL_CONFIG_ID = "model")
|
||||
// and applies it via setSessionModel → proc.setModel(provider, id).
|
||||
// Wire it up so model selection from goose config or Buzz's set_model
|
||||
// actually reaches the Pi Droid session instead of being silently dropped.
|
||||
let session_config_options = if model == ACP_CURRENT_MODEL {
|
||||
vec![]
|
||||
} else {
|
||||
vec![("model".to_string(), model)]
|
||||
};
|
||||
|
||||
let mode_mapping = HashMap::from([
|
||||
(GooseMode::Auto, vec!["auto".to_string()]),
|
||||
@@ -74,8 +87,8 @@ impl ProviderDef for PiAcpProvider {
|
||||
work_dir: working_dir,
|
||||
mcp_servers: extension_configs_to_mcp_servers(&extensions),
|
||||
session_mode_id: mode_mapping[&goose_mode].first().cloned(),
|
||||
session_config_options: vec![],
|
||||
model_config_option_id: None,
|
||||
session_config_options,
|
||||
model_config_option_id: Some("model".to_string()),
|
||||
mode_mapping,
|
||||
notification_callback: None,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user