Hmbown/CodeWhale · error
fleet task tag cannot be empty
Error message
fleet task {task_id} tag cannot be empty What it means
Fleet task spec validation rejects a tag entry that is empty or whitespace-only. Tags identify/classify tasks, and an empty tag carries no information and breaks downstream lookups. validate_tags iterates every tag in the task's tag list and fails fast on the first blank one.
Solutions
- Remove empty or whitespace-only entries from the task's tags array before validation.
- Trim user-supplied tag input and skip blank values at spec-construction time.
- Add a UI/editor check that refuses saving a spec with blank tags.
Example fix
// before "tags": ["gpu", ""] // after "tags": ["gpu"]
Defensive patterns
Strategy: validation
Validate before calling
fn has_no_blank_tags(tags: &[String]) -> bool { tags.iter().all(|t| !t.trim().is_empty()) } Type guard
fn valid_tag(t: &str) -> bool { !t.trim().is_empty() } Prevention
- Trim and filter tag input at spec construction
- Deduplicate and drop blank entries before saving specs
- Validate specs in the UI before persisting
When it happens
Trigger: Calling validate_task_spec_document (via validate_tags) with a FleetTaskSpec whose tags array contains "" or a whitespace-only string like " ".
Common situations: Hand-edited JSON/YAML task specs with a trailing comma leaving an empty entry; programmatic tag construction where a split/join on an empty label produced ""; copy-pasted specs with placeholder tags never filled in.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- agent profile provider cannot be empty
- agent profile provider must be a simple provider id
- duplicate fleet task id
- duplicate fleet worker id
- fleet cannot be empty
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/7e8c5a7e478ae99c.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/fleet/task_spec.rs:449
Ok(receipt)
}
pub fn record_verification_receipt(
ledger: &FleetLedger,
workspace: &Path,
input: &FleetTaskVerificationInput,
verification: FleetTaskVerification,
) -> Result<FleetReceipt> {
let receipt = prepare_verification_receipt(workspace, input, verification)?;
ledger.record_receipt(receipt.clone())?;
Ok(receipt)
}
fn validate_tags(task_id: &str, tags: &[String]) -> Result<()> {
let mut seen = BTreeSet::new();
for tag in tags {
if tag.trim().is_empty() {
bail!("fleet task {task_id} tag cannot be empty");
}
if !seen.insert(tag) {
bail!("fleet task {task_id} has duplicate tag {tag}");
}
}
Ok(())
}
fn validate_workspace_requirements(task: &FleetTaskSpec) -> Result<()> {
let Some(workspace) = &task.workspace else {
return Ok(());
};
let env = workspace.environment.as_ref();
for name in env
.into_iter()
.flat_map(|env| env.required.iter().chain(env.allowlist.iter()))
{
if name.trim().is_empty() {View on GitHub (pinned to 73e0f67d83)