{"record":{"id":"afc310b7d2c59a87","repo":"aaif-goose/goose","slug":"acp-agent-rejected-session-set-config-option-for","errorCode":null,"errorMessage":"ACP agent rejected session/set_config_option for '{}': {err}","messagePattern":"ACP agent rejected session/set_config_option for '(.+?)': (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/goose/src/acp/provider.rs","lineNumber":1436,"sourceCode":"    Ok(())\n}\n\nasync fn apply_session_config_options(\n    config: &AcpProviderConfig,\n    cx: &ConnectionTo<Agent>,\n    session_id: SessionId,\n) -> Result<()> {\n    for (config_id, value) in &config.session_config_options {\n        let value_id = agent_client_protocol::schema::v1::SessionConfigValueId::new(value.clone());\n        cx.send_request(SetSessionConfigOptionRequest::new(\n            session_id.clone(),\n            config_id.clone(),\n            value_id,\n        ))\n        .block_task()\n        .await\n        .map_err(|err| {\n            anyhow::anyhow!(\n                \"ACP agent rejected {} for '{}': {err}\",\n                AGENT_METHOD_NAMES.session_set_config_option,\n                config_id\n            )\n        })?;\n    }\n    Ok(())\n}\n\nasync fn apply_session_mode(\n    config: &AcpProviderConfig,\n    goose_mode: &Arc<Mutex<GooseMode>>,\n    cx: &ConnectionTo<Agent>,\n    session: NewSessionResponse,\n) -> Result<NewSessionResponse> {\n    let current_mode = goose_mode.lock().ok().map(|mode| *mode);\n    let candidates = initial_mode_candidates(config, current_mode);\n","sourceCodeStart":1418,"sourceCodeEnd":1454,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/acp/provider.rs#L1418-L1454","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nsession_config_options:\n  legacyMode: true      # agent no longer knows this option\n\n# after\nsession_config_options:\n  nestedMode: auto      # an option the agent advertises","handlingStrategy":"validation","validationCode":"let advertised: HashSet<_> = session\n    .config_options\n    .iter()\n    .flat_map(|o| o.options.iter().map(|o| o.property_id.0.clone()))\n    .collect();\nlet accepted: Vec<_> = config.session_config_options\n    .iter()\n    .filter(|(id, _)| advertised.contains(id))\n    .cloned()\n    .collect();","typeGuard":null,"tryCatchPattern":"match apply_session_config_options(&config, &cx, sid).await {\n    Err(e) if e.to_string().contains(\"set_config_option\") => {\n        tracing::warn!(%e, \"agent rejected a config option; trim session_config_options to advertised ids\");\n        // continue with defaults rather than aborting the session\n    }\n    r => r?,\n}","preventionTips":["Only set config option ids the agent returned in config_options","Re-check advertised options after upgrading the agent"],"tags":["acp","session","config","capability"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}