{"record":{"id":"2ba669a2777f00a0","repo":"Hmbown/CodeWhale","slug":"invalid-sandbox-mode-mode-expected-read-only","errorCode":null,"errorMessage":"Invalid sandbox_mode '{mode}': expected read-only, workspace-write, danger-full-access, or external-sandbox.","messagePattern":"Invalid sandbox_mode '(.+?)': expected read-only, workspace-write, danger-full-access, or external-sandbox\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":5183,"sourceCode":"            ) {\n                anyhow::bail!(\n                    \"Invalid approval_policy '{policy}': expected on-request, untrusted, never, auto, or suggest.\"\n                );\n            }\n        }\n        if let Some(v) = self.verbosity.as_deref() {\n            let normalized = v.trim().to_ascii_lowercase();\n            if !matches!(normalized.as_str(), \"normal\" | \"concise\") {\n                anyhow::bail!(\"Invalid verbosity '{v}': expected normal or concise.\");\n            }\n        }\n        if let Some(mode) = self.sandbox_mode.as_deref() {\n            let normalized = mode.trim().to_ascii_lowercase();\n            if !matches!(\n                normalized.as_str(),\n                \"read-only\" | \"workspace-write\" | \"danger-full-access\" | \"external-sandbox\"\n            ) {\n                anyhow::bail!(\n                    \"Invalid sandbox_mode '{mode}': expected read-only, workspace-write, danger-full-access, or external-sandbox.\"\n                );\n            }\n        }\n        if let Some(tui) = &self.tui\n            && let Some(mode) = tui.alternate_screen.as_deref()\n        {\n            let mode = mode.to_ascii_lowercase();\n            if !matches!(mode.as_str(), \"auto\" | \"always\" | \"never\") {\n                anyhow::bail!(\n                    \"Invalid tui.alternate_screen '{mode}': expected auto, always, or never.\"\n                );\n            }\n        }\n        if let Some(transcript) = &self.transcript\n            && let Err(detail) = transcript.prose_measure_columns()\n        {\n            anyhow::bail!(\"Invalid transcript.prose_measure: {detail}.\");","sourceCodeStart":5165,"sourceCodeEnd":5201,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L5165-L5201","documentation":"The `sandbox_mode` config field must be one of `read-only`, `workspace-write`, `danger-full-access`, or `external-sandbox` after trimming and lowercasing. The validator rejects any other value to keep sandbox posture deterministic at load time.","triggerScenarios":"`Config::validate` encounters a `sandbox_mode` value that does not match the four accepted literals.","commonSituations":"Copying a sandbox mode name from Codex or another agent CLI (e.g. `workspace-write-docker`); typos like `danger_full_access`; inventing modes such as `none` or `off`.","solutions":["Set `sandbox_mode` to one of: read-only, workspace-write, danger-full-access, external-sandbox.","Fix underscore vs hyphen: the validator lowercases but does not normalize separators.","Remove the key to fall back to the default sandbox mode."],"exampleFix":"// before (config.toml)\nsandbox_mode = \"danger_full_access\"\n\n// after\nsandbox_mode = \"danger-full-access\"","handlingStrategy":"validation","validationCode":"const SANDBOX_MODES: [&str; 4] = [\"read-only\", \"workspace-write\", \"danger-full-access\", \"external-sandbox\"];\nassert!(SANDBOX_MODES.contains(&sandbox_mode.trim().to_ascii_lowercase().as_str()), \"bad sandbox_mode: {sandbox_mode}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use hyphens, not underscores, in sandbox mode names.","Omit the key to use the default sandbox posture.","Never set danger-full-access casually; prefer read-only or workspace-write."],"tags":["config","validation","sandbox"],"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"}