{"record":{"id":"fc1ef00b2bf5d3f3","repo":"Hmbown/CodeWhale","slug":"child-wall-time-budget-exhausted-continuation-cannot-reset","errorCode":null,"errorMessage":"child wall-time budget exhausted; continuation cannot reset its deadline","messagePattern":"child wall-time budget exhausted; continuation cannot reset its deadline","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/mod.rs","lineNumber":6940,"sourceCode":"                    .map(Duration::from_secs)\n                    .unwrap_or(MAX_CHILD_WALL_TIME),\n            )\n            .min(MAX_CHILD_WALL_TIME);\n        let now_ms = epoch_millis_now();\n        let requested_deadline =\n            now_ms.saturating_add(u64::try_from(wall_time.as_millis()).unwrap_or(u64::MAX));\n        let source_deadline = options\n            .resume_from_agent_id\n            .as_deref()\n            .and_then(|id| self.worker_records.get(id))\n            .and_then(|record| record.spec.runtime_profile.wall_deadline_ms);\n        let deadline_ms =\n            narrow_optional_limit(runtime.worker_profile.wall_deadline_ms, source_deadline)\n                .map_or(requested_deadline, |deadline| {\n                    deadline.min(requested_deadline)\n                });\n        if deadline_ms <= now_ms {\n            return Err(anyhow!(\n                \"child wall-time budget exhausted; continuation cannot reset its deadline\"\n            ));\n        }\n        let wall_time = Duration::from_millis(deadline_ms - now_ms);\n        let continuation_from = if options.checkpoint_continuation {\n            let source = options\n                .resume_from_agent_id\n                .as_deref()\n                .ok_or_else(|| anyhow!(\"Checkpoint continuation requires a source agent\"))?;\n            let source =\n                self.resolve_agent_ref_for_session(&runtime.context.state_namespace, source)?;\n            if self.resume_targets.contains_key(&source) {\n                return Err(anyhow!(\n                    \"Source already has a continuation; address it with followup\"\n                ));\n            }\n            Some(source)\n        } else {","sourceCodeStart":6922,"sourceCodeEnd":6958,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/subagent/mod.rs#L6922-L6958","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nlet child = continue_agent(source)?; // Err if source deadline expired\n\n// after\nlet remaining_ms = source_deadline.saturating_sub(now_ms);\nlet child = if remaining_ms > 0 {\n    continue_agent(source)?\n} else {\n    spawn_fresh_agent(source.task, wall_deadline = fresh_deadline)?\n};","handlingStrategy":"validation","validationCode":"let effective = narrow_optional_limit(profile.wall_deadline_ms, source_deadline)\n    .map_or(requested_deadline, |d| d.min(requested_deadline));\nif effective <= now_ms() { spawn_fresh_child(task); } else { continue_child(source)?; }","typeGuard":null,"tryCatchPattern":"match continue_child(source) {\n    Err(e) if e.to_string().contains(\"wall-time budget exhausted\") => {\n        spawn_fresh_child_with_new_deadline(source.task)\n    }\n    other => other?,\n}","preventionTips":["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"],"tags":["subagent","timeout","deadline","continuation"],"backgroundTag":"request-timeout","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}