{"record":{"id":"c11c0236ac5f2a74","repo":"Hmbown/CodeWhale","slug":"fleet-field-must-be-one-printable-line-no-longer","errorCode":null,"errorMessage":"fleet {field} must be one printable line no longer than {MAX_FLEET_NAME_BYTES} bytes","messagePattern":"fleet (.+?) must be one printable line no longer than (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":224,"sourceCode":"\nfn validate_fleet_identity(field: &str, value: &str) -> Result<()> {\n    if value.is_empty() {\n        bail!(\"fleet {field} cannot be empty\");\n    }\n    if value.len() > MAX_FLEET_ID_BYTES || !value.chars().all(is_worker_token_char) {\n        bail!(\n            \"fleet {field} must be a simple ASCII token no longer than {MAX_FLEET_ID_BYTES} bytes\"\n        );\n    }\n    Ok(())\n}\n\nfn validate_fleet_name(field: &str, value: &str) -> Result<()> {\n    if value.trim().is_empty() {\n        bail!(\"fleet {field} cannot be empty\");\n    }\n    if value.len() > MAX_FLEET_NAME_BYTES || value.chars().any(char::is_control) {\n        bail!(\n            \"fleet {field} must be one printable line no longer than {MAX_FLEET_NAME_BYTES} bytes\"\n        );\n    }\n    Ok(())\n}\n\nfn validate_worker_profile(task_id: &str, worker: Option<&FleetTaskWorkerProfile>) -> Result<()> {\n    let Some(worker) = worker else {\n        return Ok(());\n    };\n    validate_worker_selector(\n        task_id,\n        \"worker.agent_profile\",\n        worker.agent_profile.as_deref(),\n    )?;\n    validate_worker_token(task_id, \"worker.loadout\", worker.loadout.as_deref())?;\n    validate_worker_token(task_id, \"worker.model_class\", worker.model_class.as_deref())?;\n    validate_worker_model(task_id, worker.model.as_deref())?;","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L206-L242","documentation":"Fleet names must be a single printable line no longer than MAX_FLEET_NAME_BYTES. validate_fleet_name rejects values that exceed the byte limit or contain any control character (which includes newlines). This ensures names render as one line in UIs and logs.","triggerScenarios":"validate_task_spec_document reaches validate_fleet_name with a name over MAX_FLEET_NAME_BYTES bytes or containing control chars such as \\n, \\r, or \\t.","commonSituations":"Multi-line paste into a name field; trailing newline from shell substitution like $(cat name.txt); very long descriptive names.","solutions":["Remove control characters/newlines so the name is one printable line","Shorten the name to at most MAX_FLEET_NAME_BYTES bytes","Trim the value before storing it (e.g. value.trim() in shell or .trim() in code)"],"exampleFix":"# before\nname: \"Prod\\nFleet\"\n# after\nname: \"Prod Fleet\"","handlingStrategy":"validation","validationCode":"fn fleet_name_format_ok(v: &str) -> bool { v.len() <= MAX_FLEET_NAME_BYTES && !v.chars().any(char::is_control) }","typeGuard":"fn as_fleet_name(v: &str) -> Option<&str> { fleet_name_format_ok(v).then_some(v) }","tryCatchPattern":"if let Err(e) = validate_fleet_name(\"name\", value) { if e.to_string().contains(\"printable line\") { value = value.lines().next().unwrap_or(\"\").trim(); } }","preventionTips":["Trim shell substitutions: name=\"$(cat f.txt | tr -d '\\n')\"","Take only the first line when accepting multi-line input","Keep names short; details belong in descriptions"],"tags":["validation","format","fleet"],"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"}