Problem
When spawns fail, there is no record of the system state at spawn time. The existing OTel stack has agent spawn spans but no context-size attributes.
From
Telemetry + Procedures reviews of #21. Phase 3 in revised plan.
Proposed
Add captureSpawnContext() function (separate from runDoctor()) that records as span attributes on squad.lifecycle.spawnAgent:
decisions_md_bytes: decisions.md size
charter_bytes: agent charter size
history_bytes: agent history size
context_tokens_actual: from model response usage field
context_utilization_pct: actual / model window
spawn_model: resolved model name
routing_rationale: why this agent was chosen
NOT markdown in orchestration logs — structured OTel attributes.
Owner
Telemetry (Observability) + EECOM (Core Dev)
Problem
When spawns fail, there is no record of the system state at spawn time. The existing OTel stack has agent spawn spans but no context-size attributes.
From
Telemetry + Procedures reviews of #21. Phase 3 in revised plan.
Proposed
Add
captureSpawnContext()function (separate fromrunDoctor()) that records as span attributes onsquad.lifecycle.spawnAgent:decisions_md_bytes: decisions.md sizecharter_bytes: agent charter sizehistory_bytes: agent history sizecontext_tokens_actual: from model response usage fieldcontext_utilization_pct: actual / model windowspawn_model: resolved model namerouting_rationale: why this agent was chosenNOT markdown in orchestration logs — structured OTel attributes.
Owner
Telemetry (Observability) + EECOM (Core Dev)