{"record":{"id":"161b4801c1e22697","repo":"Hmbown/CodeWhale","slug":"fleet-task-task-id-worker-model-must-be-a-visibl","errorCode":null,"errorMessage":"fleet task {task_id} worker.model must be a visible model id without whitespace or secrets","messagePattern":"fleet task (.+?) worker\\.model must be a visible model id without whitespace or secrets","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":296,"sourceCode":"\nfn is_worker_token_char(ch: char) -> bool {\n    ch.is_ascii_alphanumeric() || matches!(ch, '-' | '_' | '.')\n}\n\nfn validate_worker_model(task_id: &str, value: Option<&str>) -> Result<()> {\n    let Some(value) = value else {\n        return Ok(());\n    };\n    let trimmed = value.trim();\n    if trimmed.is_empty() {\n        bail!(\"fleet task {task_id} worker.model cannot be empty\");\n    }\n    if trimmed != value\n        || !trimmed\n            .chars()\n            .all(|ch| ch.is_ascii_graphic() && !matches!(ch, '=' | '\\'' | '\"'))\n    {\n        bail!(\n            \"fleet task {task_id} worker.model must be a visible model id without whitespace or secrets\"\n        );\n    }\n    Ok(())\n}\n\n#[allow(clippy::too_many_arguments)]\npub fn write_fleet_artifact_ref(\n    workspace: &Path,\n    run_id: &FleetRunId,\n    task_id: &str,\n    worker_id: &str,\n    kind: FleetArtifactKind,\n    filename: &str,\n    contents: &[u8],\n    mime_type: Option<&str>,\n) -> Result<FleetArtifactRef> {\n    let rel_path = PathBuf::from(\".codewhale\")","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L278-L314","documentation":"worker.model must be a visible model id: every character ASCII-graphic and free of whitespace, with '=', single quotes, and double quotes disallowed. validate_worker_model rejects values that could smuggle secrets, break quoting, or contain invisible characters. The error text warns against embedding whitespace or secrets in the model id.","triggerScenarios":"validate_worker_profile sees a model value with spaces, control characters, '=', or quote characters, or with leading/trailing whitespace (trimmed != value).","commonSituations":"Pasting 'model = \"gpt-4o\"' including quotes; including an API key or whitespace in the model string; trailing newline from shell substitution.","solutions":["Set worker.model to a bare ASCII model id like 'claude-sonnet-4' or 'gpt-4o'","Remove '=', quotes, and all whitespace/control characters from the value","Trim the value; never place credentials in the model field (use the token field for secrets)"],"exampleFix":"// before\nmodel: Some(\"gpt-4o key=sk-abc\")\n// after\nmodel: Some(\"gpt-4o\") // put secrets in the token field","handlingStrategy":"validation","validationCode":"fn model_format_ok(v: &str) -> bool { let t = v.trim(); t == v && !t.is_empty() && t.chars().all(|c| c.is_ascii_graphic() && !matches!(c, '=' | '\\'' | '\"')) }","typeGuard":"fn as_model_id(v: &str) -> Option<&str> { model_format_ok(v).then_some(v) }","tryCatchPattern":"if let Err(e) = validate_worker_model(task_id, value) { if e.to_string().contains(\"visible model id\") { eprintln!(\"strip whitespace/quotes/= from model id: {e}\"); } }","preventionTips":["Paste only the bare model id, never a key=value string","Never embed secrets in model fields","Trim shell-expanded values before assignment"],"tags":["validation","format","model"],"backgroundTag":"invalid-argument-format","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"}