{"record":{"id":"592f2a06d9b32cb6","repo":"Hmbown/CodeWhale","slug":"unknown-sandbox-policy-other","errorCode":null,"errorMessage":"Unknown sandbox policy: {other}","messagePattern":"Unknown sandbox policy: (.+?)","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":10630,"sourceCode":"    writable_root: Vec<PathBuf>,\n    exclude_tmpdir: bool,\n    exclude_slash_tmp: bool,\n) -> Result<crate::sandbox::SandboxPolicy> {\n    use crate::sandbox::SandboxPolicy;\n\n    match policy {\n        \"danger-full-access\" => Ok(SandboxPolicy::DangerFullAccess),\n        \"read-only\" => Ok(SandboxPolicy::ReadOnly),\n        \"external-sandbox\" => Ok(SandboxPolicy::ExternalSandbox {\n            network_access: network,\n        }),\n        \"workspace-write\" => Ok(SandboxPolicy::WorkspaceWrite {\n            writable_roots: writable_root,\n            network_access: network,\n            exclude_tmpdir,\n            exclude_slash_tmp,\n        }),\n        other => bail!(\"Unknown sandbox policy: {other}\"),\n    }\n}\n\n/// Screen the interactive TUI starts on.\n///\n/// `tui.alternate_screen` is the existing knob and keeps its existing\n/// vocabulary: `auto`/`always` stay on the alternate screen (the default),\n/// while `never` now selects the full-height inline viewport instead of being\n/// parsed and ignored. `/inline` and `/fullscreen` move it at runtime.\nfn startup_screen_mode(_cli: &Cli, config: &Config) -> ScreenMode {\n    config\n        .tui\n        .as_ref()\n        .and_then(|tui| tui.alternate_screen.as_deref())\n        .and_then(ScreenMode::parse)\n        .unwrap_or_default()\n}\n","sourceCodeStart":10612,"sourceCodeEnd":10648,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L10612-L10648","documentation":"`parse_sandbox_policy` matches the policy string against known variants (e.g. \"workspace-write\") and bails for anything unrecognized. It is an enum-by-string parse: only exact known policy names are accepted.","triggerScenarios":"Passing an unrecognized value to the sandbox policy option (e.g. a misspelled or unsupported policy string) so the `other => bail!` arm is hit.","commonSituations":"Typos like \"workpace-write\", copy-pasting a policy name from another tool (Docker/AppArmor names), or using a policy that exists in a different tool but not here.","solutions":["Use one of the supported policy strings, e.g. \"workspace-write\".","Check the option's help/docs for the exact accepted names (matching is exact, case-sensitive).","If a new policy mode is genuinely needed, extend parse_sandbox_policy with a new variant rather than passing an arbitrary string."],"exampleFix":"// before\ncodewhale run --sandbox-policy workspace_Write\n// after\ncodewhale run --sandbox-policy workspace-write","handlingStrategy":"validation","validationCode":"const POLICIES: &[&str] = &[\"workspace-write\" /* plus documented names */];\nif !POLICIES.contains(&policy.as_str()) { panic!(\"unknown sandbox policy: {policy}\"); }\n","typeGuard":null,"tryCatchPattern":"match parse_sandbox_policy(input) {\n    Ok(policy) => apply(policy),\n    Err(e) => eprintln!(\"{e:#}; supported: workspace-write\"),\n}\n","preventionTips":["Copy policy names from the tool's help output, not from other tools' docs.","Treat policy strings as exact, case-sensitive enum names.","Centralize policy constants in scripts instead of inlining ad-hoc strings."],"tags":["cli","sandbox","invalid-argument","enum"],"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"}