Hmbown/CodeWhale · error · anyhow::Error
failed to record sub-agent verification approval: {err}
Error message
failed to record sub-agent verification approval: {err} What it means
Raised when record_operation_approval fails while attaching the root Operate verification lease to a depth-1 sub-agent (the operate-verification:{agent_id} reference). The sub-agent's own registration succeeded, but the provenance record of the approved verification could not be written; the spawn is aborted to avoid an agent running with unrecorded verification provenance.
Source
Thrown at crates/tui/src/tools/subagent/mod.rs:2897
"agent",
format!("agent:{agent_id}:spawn"),
),
)
.map_err(|err| anyhow!("failed to register sub-agent work: {err}"))?;
// A root Operate verification lease is provenance, not delegated
// authority. Nested workers cannot inherit this bit.
if runtime.accept_verification && runtime.spawn_depth == 1 {
let reference = format!("operate-verification:{agent_id}");
if let Err(err) = lifecycle.work.record_operation_approval(
&lifecycle.session_id,
&lifecycle.external,
&reference,
"agent",
&format!("agent:{agent_id}:approval"),
) {
let _ = lifecycle.reconcile_state(OwnerState::Failed, 1, None);
return Err(anyhow!(
"failed to record sub-agent verification approval: {err}"
));
}
}
Ok(Some(lifecycle))
}
fn reconcile_record(&self, record: &AgentWorkerRecord) -> Result<bool, String> {
let Some(snapshot) = agent_worker_owner_snapshot(record) else {
return Ok(false);
};
self.work.reconcile_operation(&self.session_id, snapshot)
}
fn reconcile_state(
&self,
state: OwnerState,
seq: u64,View on GitHub (pinned to 0c42157ee5)
Solutions
- Check the inner {err} from the work registry (usually a shut-down session or storage failure)
- Ensure the parent's Operate approval is still valid before spawning verification-capable children
- Retry the spawn once the work registry accepts approvals again
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at crates/tui/src/tools/subagent/mod.rs:2897 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/bf9a04673654edd2.
Report an issue: GitHub.