Hmbown/CodeWhale · error
Fleet worker has no registered launch spec
Error message
Fleet worker {worker_id} has no registered launch spec What it means
prepare_registered_restart_generation requires the worker to already have a registered record in SubAgentManager coordination state, because restart consumes and advances the worker's durable launch manifest. When get_worker_record(worker_id) returns None the worker was never registered with coordination (e.g. it launched before coordination was enabled) and restart cannot proceed safely.
Solutions
- Start the worker through the current manager path so it registers a launch spec before restart
- Re-enqueue the task instead of restarting an unregistered worker
- Clear the stale lease (stop/cancel task) and let the scheduler lease a fresh worker
- Check for a reset of SubAgentManager state while ledger tasks remain leased
Example fix
// before
let report = manager.restart_worker(worker_id)?;
// after
if !manager.worker_registered(worker_id) {
manager.stop_worker(worker_id)?; // drop stale lease
manager.start_run(&run_id)?; // fresh lease registers a launch spec
} else {
let report = manager.restart_worker(worker_id)?;
} Defensive patterns
Strategy: validation
Validate before calling
fn can_restart(manager: &FleetManager, worker_id: &str) -> bool {
manager.worker_registered(worker_id)
} Try / catch
match manager.restart_worker(worker_id) {
Err(e) if e.to_string().contains("no registered launch spec") => {
// fall back: cancel stale lease and let scheduler lease a fresh worker
manager.stop_worker(worker_id)?; manager.start_run(&run_id)?
}
other => other.map(|_| ())?,
} Prevention
- Always launch fleet workers through the current manager so coordination registration happens
- After upgrading versions, clear leases held by pre-upgrade processes
- Avoid resetting SubAgentManager while ledger tasks are still leased
When it happens
Trigger: Calling restart_worker(worker_id) or resume_run where the leased worker has no SubAgentManager record — workers launched by an older process or before registration wiring existed, or the SubAgentManager was reset while the ledger still has tasks.
Common situations: Upgrading codewhale across versions where coordination registration was introduced; restarting a worker from a previous session whose in-memory coordination records are gone; running with sub_agent_manager set to None previously.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- fleet task ' ' coordination contracts must be one non-empty…
- fleet task ' ' metadata.coordination_contracts accepts at…
- Fleet task ' ' metadata.coordination_contracts accepts at…
- fleet task ' ' metadata.coordination_contracts must be an…
- fleet task ' ' metadata.coordination_contracts must contain…
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/068373befb0f241f.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/fleet/manager.rs:1184
worker_runtime::apply_exec_hardening(
worker_runtime::fleet_task_to_worker_spec_with_profiles(
worker_id,
&task.entry.run_id.0,
task_spec,
&worker_spec,
self.run_model(),
&cwd,
&self.workspace,
roster.members(),
None,
)?,
&self.exec_config,
),
task.entry.attempts,
);
let record = coordination
.get_worker_record(worker_id)
.ok_or_else(|| anyhow!("Fleet worker {worker_id} has no registered launch spec"))?;
let current_generation = task.entry.attempts.max(1);
let next_generation = current_generation
.checked_add(1)
.ok_or_else(|| anyhow!("Fleet worker {worker_id} exhausted launch generations"))?;
let registered_generation = record
.spec
.launch_manifest
.as_ref()
.map(|manifest| manifest.generation)
.ok_or_else(|| anyhow!("Fleet worker {worker_id} has no persisted launch manifest"))?;
match registered_generation {
generation if generation == current_generation => {
validate_registered_launch_spec(&record.spec, &expected_current)?;
coordination
.advance_registered_worker_generation(bind_fleet_launch_attempt(
record.spec,
next_generation,View on GitHub (pinned to 73e0f67d83)