Hmbown/CodeWhale · error
fleet must be one printable line no longer than bytes
Error message
fleet {field} must be one printable line no longer than {MAX_FLEET_NAME_BYTES} bytes What it means
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.
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)
Example fix
# before name: "Prod\nFleet" # after name: "Prod Fleet"
Defensive patterns
Strategy: validation
Validate before calling
fn fleet_name_format_ok(v: &str) -> bool { v.len() <= MAX_FLEET_NAME_BYTES && !v.chars().any(char::is_control) } Type guard
fn as_fleet_name(v: &str) -> Option<&str> { fleet_name_format_ok(v).then_some(v) } Try / catch
if let Err(e) = validate_fleet_name("name", value) { if e.to_string().contains("printable line") { value = value.lines().next().unwrap_or("").trim(); } } Prevention
- 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
When it happens
Trigger: 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.
Common situations: Multi-line paste into a name field; trailing newline from shell substitution like $(cat name.txt); very long descriptive names.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- fleet must be a simple ASCII token no longer than bytes
- fleet task must be a simple token, not a path or…
- fleet task must be one printable selector no longer than…
- agent profile cannot be empty
- agent profile must be a simple token
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/c11c0236ac5f2a74.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/fleet/task_spec.rs:224
fn validate_fleet_identity(field: &str, value: &str) -> Result<()> {
if value.is_empty() {
bail!("fleet {field} cannot be empty");
}
if value.len() > MAX_FLEET_ID_BYTES || !value.chars().all(is_worker_token_char) {
bail!(
"fleet {field} must be a simple ASCII token no longer than {MAX_FLEET_ID_BYTES} bytes"
);
}
Ok(())
}
fn validate_fleet_name(field: &str, value: &str) -> Result<()> {
if value.trim().is_empty() {
bail!("fleet {field} cannot be empty");
}
if value.len() > MAX_FLEET_NAME_BYTES || value.chars().any(char::is_control) {
bail!(
"fleet {field} must be one printable line no longer than {MAX_FLEET_NAME_BYTES} bytes"
);
}
Ok(())
}
fn validate_worker_profile(task_id: &str, worker: Option<&FleetTaskWorkerProfile>) -> Result<()> {
let Some(worker) = worker else {
return Ok(());
};
validate_worker_selector(
task_id,
"worker.agent_profile",
worker.agent_profile.as_deref(),
)?;
validate_worker_token(task_id, "worker.loadout", worker.loadout.as_deref())?;
validate_worker_token(task_id, "worker.model_class", worker.model_class.as_deref())?;
validate_worker_model(task_id, worker.model.as_deref())?;View on GitHub (pinned to 73e0f67d83)