mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why Spawn failures can share an error kind and message despite different causes, such as execution and residency capacity limits. Telemetry needs enough detail to distinguish these failures without using error messages or correlation IDs as metric labels. ## What changed - Add `AgentErrorContext` annotations for capacity limits, registry rejections, runtime availability, and spawn stages. Preserve the first annotation so outer stages retain the more precise failure origin. - Add bounded `detail` and `error_kind` labels to spawn failure metrics, using `unknown` when no context is available. - Emit spawn failure trace events with these classifications and the call and turn IDs for both multi-agent versions. ## Testing Add tests for distinct capacity and registry failure contexts, preservation of manager, fork, and shutdown errors, and metric aggregation across different error messages and correlation IDs. Verify that annotations preserve existing error kinds and user-visible messages. GitOrigin-RevId: 5bbe3d32f6ce408622f38e559fddeab05b8ccb65