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

@nicohrubecnicohrubec 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-actionsBot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.59 kB--
@sentry/browser - with treeshaking flags26.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 flags75.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/react29.38 kB--
@sentry/react (incl. Tracing)48.51 kB--
@sentry/vue33.03 kB--
@sentry/vue (incl. Tracing)48.11 kB--
@sentry/svelte27.61 kB--
CDN Bundle30 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 - uncompressed89.35 kB--
CDN Bundle (incl. Tracing) - uncompressed145.92 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed94.05 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed149.89 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed218.59 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed264.93 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed268.89 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed278.63 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed282.58 kB--
@sentry/nextjs (client)50.95 kB--
@sentry/sveltekit (client)46.65 kB--
@sentry/core/server78.37 kB+0.08%+59 B 🔺
@sentry/core/browser64.72 kB+0.09%+55 B 🔺
@sentry/node-core63.17 kB+0.01%+1 B 🔺
@sentry/node123.16 kB+0.01%+2 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)69.95 kB--
@sentry/node/light50.7 kB+0.01%+1 B 🔺
@sentry/node - without tracing74.22 kB+0.01%+1 B 🔺
@sentry/aws-serverless85.01 kB+0.01%+2 B 🔺
@sentry/cloudflare (withSentry) - minified181.52 kB--
@sentry/cloudflare (withSentry)449.12 kB--

View base workflow run

@nicohrubec
nicohrubecforce-pushed the nh/anthropic-orchestrion branch from 1d6fd6c to 0d7ee88CompareJuly 2, 2026 06:49
@nicohrubec
nicohrubec changed the base branch from develop to nh/anthropic-stream-stop-reasonJuly 2, 2026 06:50
@nicohrubec
nicohrubecforce-pushed the nh/anthropic-orchestrion branch from 0d7ee88 to bea02b1CompareJuly 2, 2026 07:57
Comment threadpackages/server-utils/src/integrations/tracing-channel/anthropic.ts Outdated
@nicohrubec
nicohrubecforce-pushed the nh/anthropic-orchestrion branch 2 times, most recently from 93f01d8 to 0d7e903CompareJuly 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 ownerJuly 2, 2026 09:14
@nicohrubec
nicohrubec requested review from JPeer264, andreiborza and mydea and removed request for a teamJuly 2, 2026 09:14
@nicohrubec
nicohrubecforce-pushed the nh/anthropic-stream-stop-reason branch from e4dc3e2 to 67c5f63CompareJuly 2, 2026 10:28
Base automatically changed from nh/anthropic-stream-stop-reason to developJuly 2, 2026 11:10
@nicohrubec
nicohrubecforce-pushed the nh/anthropic-orchestrion branch from 0d7e903 to b21fbd0CompareJuly 2, 2026 11:17
Comment threadpackages/node/src/sdk/experimentalUseDiagnosticsChannelInjection.ts Outdated
@nicohrubec
nicohrubecforce-pushed the nh/anthropic-orchestrion branch 2 times, most recently from 77de8ea to 3f1e52cCompareJuly 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
nicohrubecforce-pushed the nh/anthropic-orchestrion branch from 3f1e52c to e56fd89CompareJuly 2, 2026 15:59

@JPeer264JPeer264 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 threadpackages/server-utils/src/integrations/tracing-channel/anthropic.ts Outdated
…strion
# Conflicts:
#	packages/server-utils/src/orchestrion/index.ts
nicohrubecand 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>

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

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

@nicohrubec@logaretm@JPeer264@andreiborza