Skip to content

perf(anthropic): avoid redundant response normalization - #946

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/anthropic-trace-perf-ec20b0d9
Oct 16, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/anthropic-trace-perf-ec20b0d9

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Avoid repeated object conversion while normalizing managed-agent event trees, while preserving tuple traversal for attachment materialization.
  • Pass managed-agent results directly to span logging and inspect content block types before converting server-tool blocks.
  • Keep input attachment processing and parsed_output normalization unchanged.

Logged shape

Managed-agent result output now uses core serialization, which calls model_dump(exclude_none=True). Fields with None values are omitted from logged output.

Validation

  • uv run nox -s 'test_anthropic(latest)' -- --vcr-record=none -k 'test_managed_agents_input_materializes_attachments_inside_tuples or test_anthropic_beta_agents_create or test_anthropic_beta_sessions_events_send_and_stream or test_anthropic_messages_sync_server_tool_spans' (4 passed; VCR replay only)
  • Commit hooks: Ruff format/check, stale cassette check, and codespell passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T00:12:02.288433Z a0bdc03 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8208d54d8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread py/src/braintrust/integrations/anthropic/tracing.py
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 0d547fc into main Oct 16, 2026
98 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/anthropic-trace-perf-ec20b0d9 branch October 16, 2026 00:16
@AbhiPrasad

Copy link
Copy Markdown
Member Author

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