Skip to content

fix: OTel operation and attempt events lose the original exception.type - #812

Merged
zhongkechen merged 7 commits into
aws:mainfrom
nandanadileep:oss-harness/issue-804
Oct 27, 2026
Merged

zhongkechen merged 7 commits into
aws:mainfrom
nandanadileep:oss-harness/issue-804

Conversation

@nandanadileep

@nandanadileep nandanadileep commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #804.

Preserve the checkpointed exception.type, exception.message, and stack trace on OpenTelemetry operation and attempt events in both execution and invocation views. Record a plain Exception(message) with explicit saved attributes, avoiding imports and application exception constructors during telemetry recording or replay. This also supports ExceptionGroup and BaseExceptionGroup, whose constructors require more than a message.

Shared regression tests cover built-in and unknown exception types, exception groups, constructor side effects, and replayed metadata. The execution view continues to suppress duplicate replayed operation spans.

Validation on Python 3.13.14:

  • hatch run dev-otel:test -q --tb=short: 796 passed, including integration tests.
  • hatch run dev-otel:typecheck: passed (44 source files).
  • hatch fmt --check from the OTel package: passed.
  • git diff --check: passed.

AI-assisted contribution: OpenCode using Autoloops authored the initial patch; Codex implemented the review follow-up and ran the local checks above. No human review is claimed.

@nandanadileep
nandanadileep temporarily deployed to ai-pr-review-runtime October 22, 2026 22:37 — with GitHub Actions Inactive

@zhongkechen zhongkechen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two cases worth covering in the shared tests: exception groups and custom exception constructors.

cursoragent and others added 2 commits October 27, 2026 04:20
Add a regression for exception_from_error_object when error.type
is missing or empty and the message is empty, including the
plugin-level span event.

Co-authored-by: Nandana Dileep <nandanadileep@users.noreply.github.com>

@zhongkechen zhongkechen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message was too long (>= 50). Squash merge will fix it.

@zhongkechen
zhongkechen merged commit d7ae955 into aws:main Oct 27, 2026
11 of 12 checks passed
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.

[Bug]: OTel operation and attempt events lose the original exception.type

3 participants