{"record":{"id":"08e8f3b2fb8979fa","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-permission-postu","errorCode":null,"errorMessage":"Failed to update setting: invalid permission posture '{value}'. Expected: ask, auto-review, or full-access.","messagePattern":"Failed to update setting: invalid permission posture '(.+?)'\\. Expected: ask, auto-review, or full-access\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1756,"sourceCode":"                anyhow::bail!(\n                    \"Model defaults belong to config.toml. Use /model and choose Remember as my default, or /config model <id> --save.\"\n                );\n            }\n            \"reasoning_effort\" | \"effort\" => {\n                self.reasoning_effort = normalize_reasoning_effort_setting(value)?;\n            }\n            \"permission_posture\" | \"permissions\" => {\n                self.permission_posture = normalize_permission_posture(value);\n                if self.permission_posture.is_none() {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid permission posture '{value}'. Expected: ask, auto-review, or full-access.\"\n                    );\n                }\n            }\n            \"sandbox_mode\" | \"sandbox\" | \"filesystem_sandbox\" => {\n                self.sandbox_mode = normalize_sandbox_mode(value);\n                if self.sandbox_mode.is_none() {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid sandbox_mode '{value}'. Expected: read-only, workspace-write, danger-full-access, or external-sandbox.\"\n                    );\n                }\n            }\n            _ => {\n                anyhow::bail!(\"Failed to update setting: unknown setting '{key}'.\");\n            }\n        }\n        if let Some(canonical) = canonical {\n            self.provenance\n                .insert(canonical.to_string(), Layer::SessionOverride);\n        }\n        Ok(())\n    }\n\n    /// Apply a named settings preset (#3478).\n    ///\n    /// Presets are the first bundled-settings mechanism: a single name applies a","sourceCodeStart":1738,"sourceCodeEnd":1774,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L1738-L1774","documentation":"Settings::set normalizes the `permission_posture`/`permissions` value via normalize_permission_posture; when it returns None the setter bails. Accepted values are ask, auto-review, and full-access. The posture drives how agent tool calls are gated, so an unknown value is refused rather than silently downgraded.","triggerScenarios":"Settings::set(\"permission_posture\", v) or set(\"permissions\", v) where the normalizer yields None — e.g. `permissions yolo`, `permissions full`, `permissions Full-Access` if normalization is case-sensitive.","commonSituations":"Users migrating from the old `yolo` mode, abbreviating (`auto`, `autoapprove`), or hand-writing the value in config scripts with wrong hyphenation/casing.","solutions":["Use exactly ask, auto-review, or full-access.","Check normalize_permission_posture in settings.rs for accepted aliases/casing.","If you intended legacy yolo behavior, that maps to full-access posture (plus sandbox choices)."],"exampleFix":"// before\nsettings.set(\"permission_posture\", \"yolo\")?;\n// after\nsettings.set(\"permission_posture\", \"full-access\")?;","handlingStrategy":"validation","validationCode":"fn valid_posture(v: &str) -> bool {\n    matches!(v.trim().to_ascii_lowercase().as_str(), \"ask\" | \"auto-review\" | \"full-access\")\n}","typeGuard":null,"tryCatchPattern":"match settings.set(\"permission_posture\", value) {\n    Err(e) if e.to_string().contains(\"invalid permission posture\") => eprintln!(\"expected ask, auto-review, or full-access\"),\n    r => r?,\n}","preventionTips":["Use the exact hyphenated spellings auto-review and full-access.","Map legacy yolo to full-access in migration code.","Present only the three options in wrapper UIs."],"tags":["rust","configuration","validation","security"],"backgroundTag":"invalid-enum-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}