Skip to content

fix(tracing): attach errors to non-streaming agent spans - #4075

Closed
workeainc wants to merge 1 commit into
openai:mainfrom
workeainc:codex/issue-4070-agent-span-error
Closed

fix(tracing): attach errors to non-streaming agent spans#4075
workeainc wants to merge 1 commit into
openai:mainfrom
workeainc:codex/issue-4070-agent-span-error

Conversation

@workeainc

Copy link
Copy Markdown

Summary

  • attach generic run errors to the active agent span in non-streaming runs
  • keep max-turn and guardrail-specific span behavior unchanged
  • add async and sync regression coverage

Closes #4070

Validation

  • uv run pytest tests/test_tracing_errors.py tests/test_tracing_errors_streamed.py -q (20 passed)
  • make format
  • make lint
  • make typecheck (blocked by existing optional-dependency/type issues in sandbox, LiteLLM, NumPy, SQLAlchemy, and AnyLLM modules)

AI Usage

AI assistance was used to inspect the issue, propose the focused change, and review the patch. The final implementation and validation were performed in this checkout.

Signed-off-by: Admin <admin@Admins-Mac-mini.local>
@seratch

seratch commented Jul 31, 2026

Copy link
Copy Markdown
Member

This overlaps completely with #4070 and #4073, and #4073 is the stronger implementation path because it centralizes the shared exclusion policy and includes broader parity, redaction, and error-preservation coverage.

This version imports a private helper from run_loop into the public runtime entrypoint while duplicating the rest of the tracing policy in run.py. It also has the same exception-formatting risk and less boundary coverage. To avoid maintaining two competing fixes, I am going to close this PR in favor of completing the focused changes in #4073.

@seratch seratch closed this Jul 31, 2026
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.

Non-streaming runs never attach a generic run error to the agent span

2 participants