{"record":{"id":"daabe118add8ca78","repo":"Hmbown/CodeWhale","slug":"config-set-does-not-support-nested-key-key-edit-field-in-the","errorCode":null,"errorMessage":"`config set` does not support nested key `{key}`; edit `{field}` in the [{table}] table of config.toml instead (use a TOML value of the documented type). No value was changed.","messagePattern":"`config set` does not support nested key `(.+?)`; edit `(.+?)` in the \\[(.+?)\\] table of config\\.toml instead \\(use a TOML value of the documented type\\)\\. No value was changed\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/lib.rs","lineNumber":2993,"sourceCode":"            \"telemetry\" => {\n                self.telemetry = Some(parse_bool(value)?);\n            }\n            // Scheme rules (HTTPS, or loopback HTTP) are enforced where a\n            // batch would actually be sent, not here: a user must be able to\n            // stage a value before the machinery that reads it exists.\n            \"telemetry_endpoint\" => self.telemetry_endpoint = Some(value.to_string()),\n            \"approval_policy\" => self.approval_policy = Some(value.to_string()),\n            \"sandbox_mode\" => self.sandbox_mode = Some(value.to_string()),\n            \"hook_sinks.unix_socket_path\" => {\n                self.hook_sinks\n                    .get_or_insert_with(HookSinksToml::default)\n                    .unix_socket_path = Some(PathBuf::from(value));\n            }\n            // The MCP stdio dispatcher persists this established literal key\n            // as JSON text; it is not a nested TOML setting.\n            _ if key.contains('.') && key != \"mcp.server_definitions\" => {\n                let (table, field) = key.rsplit_once('.').expect(\"dotted key\");\n                bail!(\n                    \"`config set` does not support nested key `{key}`; edit `{field}` in the [{table}] table of config.toml instead (use a TOML value of the documented type). No value was changed.\"\n                );\n            }\n            _ => {\n                self.extras\n                    .insert(key.to_string(), toml::Value::String(value.to_string()));\n            }\n        }\n        Ok(())\n    }\n\n    pub fn unset_value(&mut self, key: &str) -> Result<()> {\n        if notifications::in_namespace(key) {\n            let setting = notifications::NotificationSetting::required(key)?;\n            return notifications::edit_extras(&mut self.extras, setting, None);\n        }\n        if let Some((provider_id, model)) = parse_model_context_window_key(key) {\n            self.unset_model_context_window(provider_id, model);","sourceCodeStart":2975,"sourceCodeEnd":3011,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/config/src/lib.rs#L2975-L3011","documentation":"`config set` only supports flat, scalar keys. Any dotted key other than the specially-handled mcp.server_definitions is treated as nested TOML and rejected, telling the user which table and field to edit by hand in config.toml. Nothing is written when this fires.","triggerScenarios":"`codewhale config set <table>.<field> <value>` for any nested setting except mcp.server_definitions — e.g. `config set notifications.slack.webhook_url https://...` or `config set mcp.foo.bar 1`.","commonSituations":"Scripting nested configuration; assuming `config set` mirrors every config.toml key; trying to set a table-valued or deeply nested option from the CLI.","solutions":["Edit config.toml directly: set `field` inside the `[table]` section with a correctly typed TOML value","Use the dedicated subcommand for nested features where one exists (e.g. MCP server management)","For mcp.server_definitions specifically, pass JSON text — it is persisted as a literal string, not TOML nesting"],"exampleFix":"// before\ncodewhale config set notifications.slack.webhook_url https://hooks.example/T123\n// after\n# edit config.toml:\n[notifications.slack]\nwebhook_url = \"https://hooks.example/T123\"","handlingStrategy":"validation","validationCode":"if key.contains('.') && key != \"mcp.server_definitions\" {\n    let (table, field) = key.rsplit_once('.').unwrap();\n    return Err(format!(\"edit `{field}` in the [{table}] table of config.toml directly\"));\n}","typeGuard":null,"tryCatchPattern":"match config.set(key, value) {\n    Err(e) if e.to_string().contains(\"does not support nested key\") => {\n        eprintln!(\"{e}\"); // guidance names the exact table/field to edit\n    }\n    other => other?,\n}","preventionTips":["Restrict CLI setters to flat keys","Edit nested settings in config.toml with a correctly typed TOML value","Special-case mcp.server_definitions as JSON text","Warn users in tooling before they attempt dotted keys"],"tags":["config","cli","toml"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}