Hmbown/CodeWhale · error
child wall-time budget exhausted; continuation cannot reset…
Error message
child wall-time budget exhausted; continuation cannot reset its deadline
What it means
A continuation inherits the source's wall-clock deadline; the effective deadline is the narrower of the runtime profile's limit, the source's remaining deadline, and the requested one. If that effective deadline is already in the past (deadline_ms <= now_ms), the continuation is refused — it cannot restart the clock on an expired budget.
Solutions
- Spawn a fresh child with a new wall-time budget instead of continuing the expired one.
- Increase `wall_deadline_ms` in the worker profile so remaining time stays positive.
- Create the continuation promptly after interrupting, before the deadline elapses.
- If resuming persisted work, check the source's remaining deadline before attempting continuation.
Example fix
// before
let child = continue_agent(source)?; // Err if source deadline expired
// after
let remaining_ms = source_deadline.saturating_sub(now_ms);
let child = if remaining_ms > 0 {
continue_agent(source)?
} else {
spawn_fresh_agent(source.task, wall_deadline = fresh_deadline)?
}; Defensive patterns
Strategy: validation
Validate before calling
let effective = narrow_optional_limit(profile.wall_deadline_ms, source_deadline)
.map_or(requested_deadline, |d| d.min(requested_deadline));
if effective <= now_ms() { spawn_fresh_child(task); } else { continue_child(source)?; } Try / catch
match continue_child(source) {
Err(e) if e.to_string().contains("wall-time budget exhausted") => {
spawn_fresh_child_with_new_deadline(source.task)
}
other => other?,
} Prevention
- Compute remaining wall time before requesting a continuation
- Create continuations promptly after interrupting the source
- Set worker profile wall_deadline_ms with headroom for the task
- Fall back to a fresh child when the inherited deadline has expired
When it happens
Trigger: Continuing a child when `narrow_optional_limit(profile.wall_deadline_ms, source_deadline).min(requested_deadline)` resolves to <= current time — i.e. the source's wall-time window expired before the continuation was created.
Common situations: A child interrupted near its deadline and resumed too late; long queueing before the continuation request; `wall_deadline_ms` configured too tight for the task; system clock jump or long pause between interrupt and resume.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- child step budget exhausted; continuation cannot reset its…
- child wall-time budget exhausted
- child wall-time budget exhausted
- first timed-out API attempt should reach the test server
- Sub-agent depth limit reached
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/fc1ef00b2bf5d3f3.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/tools/subagent/mod.rs:6940
.map(Duration::from_secs)
.unwrap_or(MAX_CHILD_WALL_TIME),
)
.min(MAX_CHILD_WALL_TIME);
let now_ms = epoch_millis_now();
let requested_deadline =
now_ms.saturating_add(u64::try_from(wall_time.as_millis()).unwrap_or(u64::MAX));
let source_deadline = options
.resume_from_agent_id
.as_deref()
.and_then(|id| self.worker_records.get(id))
.and_then(|record| record.spec.runtime_profile.wall_deadline_ms);
let deadline_ms =
narrow_optional_limit(runtime.worker_profile.wall_deadline_ms, source_deadline)
.map_or(requested_deadline, |deadline| {
deadline.min(requested_deadline)
});
if deadline_ms <= now_ms {
return Err(anyhow!(
"child wall-time budget exhausted; continuation cannot reset its deadline"
));
}
let wall_time = Duration::from_millis(deadline_ms - now_ms);
let continuation_from = if options.checkpoint_continuation {
let source = options
.resume_from_agent_id
.as_deref()
.ok_or_else(|| anyhow!("Checkpoint continuation requires a source agent"))?;
let source =
self.resolve_agent_ref_for_session(&runtime.context.state_namespace, source)?;
if self.resume_targets.contains_key(&source) {
return Err(anyhow!(
"Source already has a continuation; address it with followup"
));
}
Some(source)
} else {View on GitHub (pinned to 73e0f67d83)