Hmbown/CodeWhale · error

Fleet worker {} persisted launch spec does not match the exa

Error message

Fleet worker {} persisted launch spec does not match the exact task lease and attempt

What it means

After excluding prompts, every identity field of the registered spec (routes, permissions, workspace, scope, attempt fields) must equal a fresh derivation from the exact leased task. Inequality means the durable launch spec corresponds to a different lease/attempt or configuration than the one being validated, so the relaunch is rejected to prevent running with stale or foreign settings.

Source

Thrown at crates/tui/src/fleet/manager.rs:2332

            registered.worker_id
        );
    }

    // Coordination may append a bounded decision projection to the prompt.
    // Every identity, route, permission, workspace, scope, and attempt field
    // must otherwise match a fresh derivation from this exact leased task.
    let mut registered_identity = registered.clone();
    let mut expected_identity = expected.clone();
    registered_identity.objective.clear();
    expected_identity.objective.clear();
    if let Some(manifest) = registered_identity.launch_manifest.as_mut() {
        manifest.prompt.clear();
    }
    if let Some(manifest) = expected_identity.launch_manifest.as_mut() {
        manifest.prompt.clear();
    }
    if registered_identity != expected_identity {
        bail!(
            "Fleet worker {} persisted launch spec does not match the exact task lease and attempt",
            registered.worker_id
        );
    }
    Ok(())
}

fn registered_prompt_matches_expected(registered: &str, expected: &str) -> bool {
    const HEADER: &str = "Accepted coordination decisions relevant to this child (bounded):\n";
    if registered == expected {
        return true;
    }
    let Some(projection) = registered
        .strip_prefix(expected)
        .and_then(|suffix| suffix.strip_prefix("\n\n"))
    else {
        return false;
    };

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Cancel the affected worker's task and let a new lease+spec pair be created under current config
  2. Keep fleet configuration constant for the lifetime of a run; apply changes to new runs
  3. Restore ledger and coordination state together, never separately
  4. Reproducible on fresh runs with stable config: file a bug with both spec dumps
Defensive patterns

Strategy: fallback

Try / catch

match validate_registered_launch_spec(&record.spec, &expected) {
    Ok(()) => Ok(()),
    Err(err) if err.to_string().contains("does not match the exact task lease and attempt") => {
        // stale spec for another lease/attempt: re-lease the task
        Err(err)
    }
    Err(err) => Err(err),
}

Prevention

When it happens

Trigger: Relaunching a worker whose registered spec was prepared for a previous attempt or a different task lease; configuration (model route, permissions, workspace) changed between registration and relaunch; ledger/coordination records restored from different points in time.

Common situations: Changing fleet exec config or profile settings and then restarting workers created under the old settings; resuming after a crash where only one of ledger/coordination state was flushed.

Related errors


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