Skip to content

feat(tracing): infer error ownership from tracebacks - #496

Draft
jshaikScale wants to merge 9 commits into
mainfrom
javed/error-category-producers
Draft

feat(tracing): infer error ownership from tracebacks#496
jshaikScale wants to merge 9 commits into
mainfrom
javed/error-category-producers

Conversation

@jshaikScale

@jshaikScale jshaikScale commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • automatically infer application vs platform ownership from the innermost relevant traceback frame
  • preserve authoritative precedence: explicit category → canonical categorized error → stack inference → known boundary → scoped mapping → unknown
  • expose immutable module-prefix and normalized file-root ownership rules that are deterministic and testable without mutable global state
  • forward safe classifier provenance to SGP while preserving the existing type, message, and category error fields

Ownership behavior

  • Agentex calling user/agent code that raises → application
  • user code calling Agentex internals that raise → platform
  • ignored third-party/framework frames defer to the nearest relevant owned caller
  • conflicting, empty, relative, archive/obfuscated, or otherwise unresolvable stacks → unknown
  • sync, async, and ADK context managers classify from the original exception traceback and re-raise the original exception unchanged

The classifier never uses exception messages, exception class names, source lines, raw paths, or stack text as inference signals. Telemetry contains only the stable category source, classifier version, and deterministic non-sensitive rule ID.

Tests

  • 198 passed, 2 skipped — full relevant tracing, ADK, and processor suite
  • Ruff lint: passed
  • Ruff format check: passed
  • Pyright: 0 errors, 0 warnings, 0 informations
  • focused mypy: Success: no issues found in 2 source files
  • git diff --check: passed

Limitations and follow-up

  • zip, obfuscated, relative, or otherwise unresolvable frames safely remain unknown unless explicit module ownership is configured
  • applications installed beneath shared site-package roots should configure application module prefixes or file roots
  • non-Agentex producers still require coordinated adoption in the shared scale-gp-beta SDK/repository

jshaikScale and others added 9 commits August 3, 2026 13:23
Capture ADK failures and preserve producer ownership metadata so SGP can distinguish application, platform, and unknown errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Provide typed application and platform error classes with documented ownership boundaries instead of relying on arbitrary exception attributes.

Co-authored-by: Cursor <cursoragent@cursor.com>
#485)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Require the released tracing SDK types so Agentex no longer maintains a duplicate ownership taxonomy that can drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
…r span (#484)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Preserve the newer fail-open observability handling while retaining error category metadata and updated expectations.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add configurable frame ownership rules and safe provenance so uncategorized span failures can be attributed without inspecting exception text.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use a stable mapping rule identifier instead of emitting custom exception type names in tracing metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants