aaif-goose/goose · error · anyhow::Error
ACP agent rejected session/set_config_option for '{}': {err}
Error message
ACP agent rejected session/set_config_option for '{}': {err} What it means
After a session is created or loaded, goose replays config.session_config_options via session/set_config_option RPCs. This error means the agent answered that RPC with an error for the named config id — the option is unknown, the value is rejected, or the agent considers the state invalid. It fires per option, naming the exact config_id that was refused.
Source
Thrown at crates/goose/src/acp/provider.rs:1436
Ok(())
}
async fn apply_session_config_options(
config: &AcpProviderConfig,
cx: &ConnectionTo<Agent>,
session_id: SessionId,
) -> Result<()> {
for (config_id, value) in &config.session_config_options {
let value_id = agent_client_protocol::schema::v1::SessionConfigValueId::new(value.clone());
cx.send_request(SetSessionConfigOptionRequest::new(
session_id.clone(),
config_id.clone(),
value_id,
))
.block_task()
.await
.map_err(|err| {
anyhow::anyhow!(
"ACP agent rejected {} for '{}': {err}",
AGENT_METHOD_NAMES.session_set_config_option,
config_id
)
})?;
}
Ok(())
}
async fn apply_session_mode(
config: &AcpProviderConfig,
goose_mode: &Arc<Mutex<GooseMode>>,
cx: &ConnectionTo<Agent>,
session: NewSessionResponse,
) -> Result<NewSessionResponse> {
let current_mode = goose_mode.lock().ok().map(|mode| *mode);
let candidates = initial_mode_candidates(config, current_mode);
View on GitHub (pinned to 3810898a74)
Solutions
- Read the agent's config_options from its session/new response (or docs) and delete options it does not advertise
- Correct the value for the named option to one of the agent's allowed choices
- After upgrading an agent, reconcile your session_config_options with the new capability set
Example fix
# before session_config_options: legacyMode: true # agent no longer knows this option # after session_config_options: nestedMode: auto # an option the agent advertises
Defensive patterns
Strategy: validation
Validate before calling
let advertised: HashSet<_> = session
.config_options
.iter()
.flat_map(|o| o.options.iter().map(|o| o.property_id.0.clone()))
.collect();
let accepted: Vec<_> = config.session_config_options
.iter()
.filter(|(id, _)| advertised.contains(id))
.cloned()
.collect(); Try / catch
match apply_session_config_options(&config, &cx, sid).await {
Err(e) if e.to_string().contains("set_config_option") => {
tracing::warn!(%e, "agent rejected a config option; trim session_config_options to advertised ids");
// continue with defaults rather than aborting the session
}
r => r?,
} Prevention
- Only set config option ids the agent returned in config_options
- Re-check advertised options after upgrading the agent
When it happens
Trigger: config.session_config_options contains an entry like ('nestedMode', 'auto') but the agent's NewSessionResponse.config_options does not list that option id, or lists it with different allowed values; sending a value the agent validates and refuses.
Common situations: Hand-writing session_config_options copied from a different agent's docs; an agent upgrade renames or removes a config option while goose config still sets the old id.
Related errors
- Requested mode(s) [{}] not offered by agent. Available modes
- ACP agent does not support session/load
- {e}
- ACP agent rejected session/set_mode: {err}
- ACP URL is not available
AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16).
Data as JSON: /api/errors/afc310b7d2c59a87.
Report an issue: GitHub.