Skip to content

feat(server-utils): Migrate Anthropic integration to orchestrion#21902

Merged
nicohrubec merged 5 commits into
developfrom
nh/anthropic-orchestrion
Jul 3, 2026
Merged

feat(server-utils): Migrate Anthropic integration to orchestrion#21902
nicohrubec merged 5 commits into
developfrom
nh/anthropic-orchestrion

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Jul 1, 2026

Copy link
Copy Markdown
Member

Adds an orchestrion (diagnostics-channel injection) based Anthropic integration to server-utils, covering all APIs (messages, completions, models, beta messages) and both streaming and non-streaming mode. Leaves the core integration intact and only exports the utils the orchestrion integration needs.

Closes #20911

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.24 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.01 kB - -
@sentry/browser (incl. Tracing, Replay) 85.49 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.1 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.19 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.84 kB - -
@sentry/browser (incl. Feedback) 44.76 kB - -
@sentry/browser (incl. sendFeedback) 32.38 kB - -
@sentry/browser (incl. FeedbackAsync) 37.51 kB - -
@sentry/browser (incl. Metrics) 28.67 kB - -
@sentry/browser (incl. Logs) 28.91 kB - -
@sentry/browser (incl. Metrics & Logs) 29.59 kB - -
@sentry/react 29.38 kB - -
@sentry/react (incl. Tracing) 48.51 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.11 kB - -
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.22 kB - -
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.53 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.77 kB - -
CDN Bundle (incl. Tracing, Replay) 85.68 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.97 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.5 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.77 kB - -
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.92 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.89 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.59 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.89 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.58 kB - -
@sentry/nextjs (client) 50.95 kB - -
@sentry/sveltekit (client) 46.65 kB - -
@sentry/core/server 78.37 kB +0.08% +59 B 🔺
@sentry/core/browser 64.72 kB +0.09% +55 B 🔺
@sentry/node-core 63.17 kB +0.01% +1 B 🔺
@sentry/node 123.16 kB +0.01% +2 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.7 kB +0.01% +1 B 🔺
@sentry/node - without tracing 74.22 kB +0.01% +1 B 🔺
@sentry/aws-serverless 85.01 kB +0.01% +2 B 🔺
@sentry/cloudflare (withSentry) - minified 181.52 kB - -
@sentry/cloudflare (withSentry) 449.12 kB - -

View base workflow run

@nicohrubec nicohrubec force-pushed the nh/anthropic-orchestrion branch from 1d6fd6c to 0d7ee88 Compare July 2, 2026 06:49
@nicohrubec nicohrubec changed the base branch from develop to nh/anthropic-stream-stop-reason July 2, 2026 06:50
@nicohrubec nicohrubec force-pushed the nh/anthropic-orchestrion branch from 0d7ee88 to bea02b1 Compare July 2, 2026 07:57
Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts Outdated
@nicohrubec nicohrubec force-pushed the nh/anthropic-orchestrion branch 2 times, most recently from 93f01d8 to 0d7e903 Compare July 2, 2026 09:14
@nicohrubec nicohrubec marked this pull request as ready for review July 2, 2026 09:14
@nicohrubec nicohrubec requested a review from a team as a code owner July 2, 2026 09:14
@nicohrubec nicohrubec requested review from JPeer264, andreiborza and mydea and removed request for a team July 2, 2026 09:14
Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts
Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts
@nicohrubec nicohrubec force-pushed the nh/anthropic-stream-stop-reason branch from e4dc3e2 to 67c5f63 Compare July 2, 2026 10:28
Base automatically changed from nh/anthropic-stream-stop-reason to develop July 2, 2026 11:10
@nicohrubec nicohrubec force-pushed the nh/anthropic-orchestrion branch from 0d7e903 to b21fbd0 Compare July 2, 2026 11:17
Comment thread packages/node/src/sdk/experimentalUseDiagnosticsChannelInjection.ts Outdated
Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts
@nicohrubec nicohrubec force-pushed the nh/anthropic-orchestrion branch 2 times, most recently from 77de8ea to 3f1e52c Compare July 2, 2026 15:52
Adds an orchestrion based Anthropic integration to server-utils, covering all
the APIs (messages, completions, models, beta messages) and both streaming and
non-streaming mode. Leaves the core integration intact and only exports the
necessary utils that are needed for the orchestrion integration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec nicohrubec force-pushed the nh/anthropic-orchestrion branch from 3f1e52c to e56fd89 Compare July 2, 2026 15:59
Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Tests are failing, seems like the origin is wrong asserted

Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts Outdated
…strion

# Conflicts:
#	packages/server-utils/src/orchestrion/index.ts
nicohrubec and others added 2 commits July 3, 2026 08:33
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pic integration

Let errors bubble to the global handlers instead of capturing them as unhandled
at the instrumentation level, matching the DB/cache channel subscribers. The
default-integration tests branch their error-event expectation since the OTel
path still captures it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d58409e. Configure here.

Comment thread packages/server-utils/src/integrations/tracing-channel/anthropic.ts
…strion

# Conflicts:
#	packages/server-utils/src/orchestrion/channels.ts
#	packages/server-utils/src/orchestrion/index.ts
@nicohrubec nicohrubec merged commit 35c5bf6 into develop Jul 3, 2026
576 of 580 checks passed
@nicohrubec nicohrubec deleted the nh/anthropic-orchestrion branch July 3, 2026 08:44
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.

Rewrite SentryAnthropicAiInstrumentation to orchestrion

4 participants