{"record":{"id":"05160b5a4da683be","repo":"Hmbown/CodeWhale","slug":"fleet-task-task-id-field-must-be-a-simple-toke","errorCode":null,"errorMessage":"fleet task {task_id} {field} must be a simple token, not a path or provider/model id","messagePattern":"fleet task (.+?) (.+?) must be a simple token, not a path or provider/model id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":272,"sourceCode":"    if trimmed != value || value.len() > MAX_FLEET_NAME_BYTES || value.chars().any(char::is_control)\n    {\n        bail!(\n            \"fleet task {task_id} {field} must be one printable selector no longer than {MAX_FLEET_NAME_BYTES} bytes\"\n        );\n    }\n    Ok(())\n}\n\nfn validate_worker_token(task_id: &str, field: &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} {field} cannot be empty\");\n    }\n    if trimmed != value || !trimmed.chars().all(is_worker_token_char) {\n        bail!(\n            \"fleet task {task_id} {field} must be a simple token, not a path or provider/model id\"\n        );\n    }\n    Ok(())\n}\n\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    }","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L254-L290","documentation":"Worker tokens must be simple tokens: no leading/trailing whitespace and only characters accepted by is_worker_token_char. validate_worker_token explicitly rejects paths and provider/model ids (which contain '/' or ':'), since tokens are opaque identifiers, not references.","triggerScenarios":"validate_worker_profile sees a token with surrounding whitespace, or containing characters like '/', ':', '.', spaces that violate the token charset.","commonSituations":"Putting 'openai/gpt-4o' or '~/.config/creds' into a token field; pasting a value with a trailing newline; shell expansion introducing slashes.","solutions":["Use only simple token characters (no '/', ':', whitespace, paths)","Trim the value before storing it","Move path or provider/model id values to the appropriate fields (worker.model for model ids) instead of a token field"],"exampleFix":"// before\ntoken: Some(\"providers/openai\")\n// after\ntoken: Some(\"openai-prod-key\")","handlingStrategy":"validation","validationCode":"fn token_format_ok(v: &str) -> bool { let t = v.trim(); t == v && !t.is_empty() && t.chars().all(is_worker_token_char) }","typeGuard":"fn as_worker_token(v: &str) -> Option<&str> { token_format_ok(v).then_some(v) }","tryCatchPattern":"if let Err(e) = validate_worker_token(task_id, \"token\", value) { if e.to_string().contains(\"simple token\") { eprintln!(\"token must not be a path or model id: {e}\"); } }","preventionTips":["Never place paths or provider/model ids in token fields","Trim pasted values before storing","Restrict input widgets to the token charset"],"tags":["validation","format","fleet"],"backgroundTag":"invalid-identifier-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"}