Skip to content

[codex] Map AI failure spans to error taxonomy#525

Merged
rickcrawford merged 1 commit into
mainfrom
codex/wor-1215-ai-error-span-status
Jun 18, 2026
Merged

[codex] Map AI failure spans to error taxonomy#525
rickcrawford merged 1 commit into
mainfrom
codex/wor-1215-ai-error-span-status

Conversation

@rickcrawford

Copy link
Copy Markdown
Contributor

Summary

  • Map AI request span failures to the low-cardinality error taxonomy from WOR-1215: guardrail_blocked, rate_limited, content_filter, budget_exceeded, upstream_5xx, and timeout.
  • Record ERROR status and error.type on the actual ai.request span for rate limits, guardrails, budget preflight failures, provider status failures, streaming read failures, and all-provider transport failures.
  • Align observability docs and regenerated docs/llms-full.txt with the taxonomy.

Root cause

Some AI failure paths recorded on tracing::Span::current() even though the ai.request span was not entered, and provider response failures were not consistently classified for span status/error attributes.

Validation

  • cargo test -p sbproxy-core ai_error_classification_tests --locked
  • cargo test -p sbproxy-ai record_error_marks_span_failed --locked
  • cargo test -p sbproxy-ai error_type_constants_cover_ai_failure_taxonomy --locked
  • cargo test -p sbproxy-core --locked
  • cargo test -p sbproxy-ai --locked
  • cargo fmt --all --check
  • git diff --check
  • ./scripts/regen-llms-full.sh --check
  • cargo test -p sbproxy-e2e --test otlp_span_arrival_e2e --locked
  • cargo test -p sbproxy-e2e --test otlp_span_arrival_http_e2e --locked

No new libraries were added; NOTICE did not need changes.

Linear: WOR-1215

@rickcrawford rickcrawford force-pushed the codex/wor-1215-ai-error-span-status branch from 5d87657 to 13ba130 Compare June 18, 2026 10:42
@rickcrawford rickcrawford force-pushed the codex/wor-1215-ai-error-span-status branch from 13ba130 to 212e828 Compare June 18, 2026 10:46
@rickcrawford rickcrawford merged commit b9b3224 into main Jun 18, 2026
9 checks passed
@rickcrawford rickcrawford deleted the codex/wor-1215-ai-error-span-status branch June 18, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant