Hmbown/CodeWhale · error

fleet task '{}' coordination contracts must be one non-empty

Error message

fleet task '{}' coordination contracts must be one non-empty line of at most 128 characters

What it means

A coordination contract string failed the content rules: after trimming it must be non-empty, at most 128 characters, and contain no NUL/CR/LF — i.e. one single line. Contracts become part of the task's coordination surface, so control characters and oversized blobs are refused. Note the stored value is the trimmed string, and exact duplicates are silently deduplicated.

Source

Thrown at crates/tui/src/fleet/worker_runtime.rs:407

        bail!(
            "fleet task '{}' metadata.coordination_contracts accepts at most 16 entries",
            task_spec.id
        );
    }
    let mut contracts = Vec::new();
    for value in values {
        let Some(value) = value.as_str() else {
            bail!(
                "fleet task '{}' metadata.coordination_contracts must contain only strings",
                task_spec.id
            );
        };
        let value = value.trim();
        if value.is_empty()
            || value.chars().count() > 128
            || value.chars().any(|ch| matches!(ch, '\0' | '\r' | '\n'))
        {
            bail!(
                "fleet task '{}' coordination contracts must be one non-empty line of at most 128 characters",
                task_spec.id
            );
        }
        if !contracts.iter().any(|contract| contract == value) {
            contracts.push(value.to_string());
        }
    }
    Ok(contracts)
}

/// Mint a [`FleetResolvedRoute`] snapshot for a fleet task (#3154).
///
/// This calls the existing hermetic resolver bridge
/// ([`resolve_route_candidate`]) so the persisted route reflects the same
/// resolution semantics the runtime would use, then records only non-sensitive
/// shape (provider id/kind, model ids, protocol) combined with the already
/// computed effective role/loadout/model-class intent. `source` is

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Trim the entry and make sure it is a single line under 128 characters.
  2. Replace multi-line descriptions with a short slug (e.g. "ledger-append") and keep details elsewhere.
  3. Remove empty/blank placeholder entries from the list.

Example fix

# before
[metadata]
coordination_contracts = ["", "a very long contract description that goes on ... (>128 chars)"]

# after
[metadata]
coordination_contracts = ["ledger-append"]
Defensive patterns

Strategy: validation

Validate before calling

fn contract_content_ok(s: &str) -> bool {
    let t = s.trim();
    !t.is_empty()
        && t.chars().count() <= 128
        && !t.chars().any(|c| matches!(c, '\0' | '\r' | '\n'))
}

Prevention

When it happens

Trigger: An entry that is "" or whitespace-only; a contract longer than 128 chars; a multi-line string (embedded newline) pasted into the array; a trailing '\r' from Windows line endings inside a quoted value.

Common situations: Pasting descriptions instead of short contract names; templates inserting blank elements between real ones; CRLF files leaking carriage returns into values.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/00bb67e78b6eb4f8. Report an issue: GitHub.