Skip to content

fix(timeout): preserve OpenTelemetry context in deadline tasks - #1149

Merged
mikehostetler merged 1 commit into
agentjido:mainfrom
gi11es:fix/sym-6882-otel-context
Oct 24, 2026
Merged

mikehostetler merged 1 commit into
agentjido:mainfrom
gi11es:fix/sym-6882-otel-context

Conversation

@gi11es

@gi11es gi11es commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

A finite total_timeout runs the request in a task that loses the caller’s process-local OpenTelemetry context. Capture that context before spawning the task and attach it before running the request, preserving parent trace selection and baggage. OpenTelemetry remains optional at runtime.

Regression tests use the real context API through a test-only dependency and cover finite/unlimited budgets, an empty context, and isolation of task changes across successive requests.

Type of Change

  • Bug fix (non-breaking)

Breaking Changes

None.

Testing

  • mix test: 5,416 passed, 11 skipped, 240 excluded by default.
  • mix quality: formatting, warnings-as-errors compilation, Credo, Dialyzer passed.
  • Two focused regressions fail before the fix; all nine focused tests pass after it, including three additional seeded runs.
  • Finite and unlimited requests succeed with OpenTelemetry absent in a separate dev run.

Checklist

  • Code follows project style guidelines.
  • Documentation reviewed; no public API or configuration change.
  • Added regression tests.
  • Default test suite passes.
  • One conventional commit.
  • CHANGELOG.md unchanged.

Related Issues

Closes #1148.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@mikehostetler
mikehostetler merged commit fd61c12 into agentjido:main Oct 24, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Finite total_timeout drops the caller’s OpenTelemetry context

2 participants