GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(server-utils): Enable pi-ai by default & use it for Flue & pi-durable by mydea · Pull Request #25940 · getsentry/sentry-javascript

Conversation

@mydea

@mydea mydea commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Why: Flue and pi-durable both send their model calls through pi-ai, and each had its own chat-span code (Flue's turn observations, pi-durable's models proxy). With piAiIntegration (#25937) enabled by default, pi-ai becomes the single source of gen_ai.chat spans, and ~1.1k lines of duplicated span code go away. Flue now hands its conversation id to the pi-ai span through the scope.

Stack: #25932 → #25937 → this. #25935 must be merged before #25937 and this: without it, instrumenting pi-ai makes the Cloudflare Flue worker crash at startup. Supersedes #25869.

How to review: The first commit is the switch. The second adds a one-time warning when Flue runs but pi-ai was not instrumented; it's separate so it can be dropped or split off. The next three scope the provider skip to pi-ai's own requests, make that warning runtime-specific, and keep the Flue and pi-durable recording options working on chat spans. The last two are cleanups: the active pi-ai span replaces the nesting counter, which also catches nested calls made after an await, and stale comments go.

Unsure about:

  • Chat spans change origin from auto.ai.flue / auto.ai.pi_durable to auto.ai.pi_ai.
  • Flue's chat spans now need the runtime hook or bundler plugin; a manual-only instrument(createFlueInstrumentation()) keeps agent and tool spans but loses chat spans, hence the warning. Setups following our docs are unaffected.
  • flue.turn.purpose (compaction vs. agent turn) is dropped, since pi-ai cannot see it. A possible follow-up is to record compaction the way feat(attributes): Add gen_ai conversation compaction conventions sentry-conventions#723 proposes, once it merges: Flue emits compaction_start (with a manual/threshold/overflow reason) and compaction observations, so it could open a gen_ai.compact span with the summarizing gen_ai.chat nested under it.
  • pi-durable records model calls only for a models object created with pi-ai's createModels().

Release note:

  • feat(server-utils): Add pi-ai integration

    The new piAiIntegration traces requests sent with pi-ai (@earendil-works/pi-ai >= 0.80) as gen_ai.chat spans, through createModels() or the standalone stream/complete functions. It is enabled by default and needs the Sentry runtime hook or bundler plugin.

    Requests pi-ai sends are reported once, as its gen_ai.chat span; direct calls to openai, @anthropic-ai/sdk, @google/genai, @mistralai/mistralai or Workers AI keep their own spans.

    Flue and pi-durable send their model calls through pi-ai, so their gen_ai.chat spans now come from this integration:

    • Their origin changes from auto.ai.flue / auto.ai.pi_durable to auto.ai.pi_ai. Agent and tool spans keep their origin.
    • Flue apps that only call instrument(Sentry.createFlueInstrumentation()) need the runtime hook (--import) or bundler plugin for gen_ai.chat spans. Without it, the SDK logs a warning on the first model call.
    • The flue.turn.purpose attribute is no longer set.
    • recordInputs and recordOutputs on createFlueInstrumentation() and piDurableIntegration() keep applying to their gen_ai.chat spans.
    • pi-durable records model calls only for a models object created with pi-ai's createModels().

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mydea
mydea added this pull request to stack #25938 October 30, 2026 11:04
@github-actions

github-actions Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 730225f (PR test merge using develop at 66d86c2)

Against: 27bc7cb (develop) · base run #65789

⚠️ Baseline mismatch: 6 develop commit(s) in the PR build are missing from the baseline; 2 develop commit(s) in the baseline are missing from the PR build. Their size changes also affect this comparison. Compare commits. Rebase your PR onto the latest develop to compare against an up-to-date baseline.

Path Size % Change Change
@sentry/browser 30.04 kB - -
@sentry/browser - with treeshaking flags 28.23 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.14 kB - -
@sentry/browser (incl. Tracing) 52.21 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.17 kB - -
@sentry/browser (incl. Tracing, Replay) 92.75 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.5 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.1 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.52 kB - -
@sentry/browser (incl. Feedback) 47.66 kB - -
@sentry/browser (incl. sendFeedback) 30.61 kB - -
@sentry/browser (incl. FeedbackAsync) 35.63 kB - -
@sentry/browser (incl. Metrics) 31.36 kB - -
@sentry/browser (incl. Logs) 31.63 kB - -
@sentry/browser (incl. Metrics & Logs) 32.29 kB - -
@sentry/react 32.04 kB - -
@sentry/react (incl. Tracing) 54.84 kB - -
@sentry/vue 38.2 kB - -
@sentry/vue (incl. Tracing) 55.12 kB - -
@sentry/svelte 30.06 kB - -
@sentry/remix (Remix 3 client bundle) 57.93 kB - -
CDN Bundle 31.8 kB - -
CDN Bundle (incl. Tracing) 52.55 kB - -
CDN Bundle (incl. Logs, Metrics) 34.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.1 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.62 kB - -
CDN Bundle (incl. Tracing, Replay) 90.6 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.61 kB - -
CDN Bundle - uncompressed 92.67 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.11 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.01 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 231.09 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.89 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 294.68 kB - -
@sentry/nextjs (client) 58.23 kB - -
@sentry/sveltekit (client) 53.24 kB - -
@sentry/core/server 44.52 kB -0.02% -8 B 🔽
@sentry/core/browser 13.99 kB - -
@sentry/node 149.46 kB +0.17% +250 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.3 kB +0.17% +136 B 🔺
@sentry/node - without tracing 88.37 kB +0.13% +113 B 🔺
@sentry/node - without channel injection 138.42 kB +0.18% +239 B 🔺
@sentry/aws-serverless 97.28 kB +0.17% +163 B 🔺
@sentry/cloudflare (withSentry) - minified 204.33 kB +0.07% +140 B 🔺
@sentry/cloudflare (withSentry) 474.29 kB +0.09% +405 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 229.63 kB +0.07% +138 B 🔺

View base workflow run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 5 not successful, 52 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Failing after 3m Details
❌ CI: Optional E2E Tests / E2E nextjs-16-cacheComponents (cloudflare) Test (optional) Failing after 10m Details
❌ CI: Optional E2E Tests / E2E node-eve Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Failing after 2m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 52s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 52s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 56s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 33s Details
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mydea
mydea force-pushed the feat/pi-ai-integration-default branch from 7f58fd6 to 91831f6 Compare October 30, 2026 12:53
@mydea
mydea force-pushed the feat/pi-ai-integration-default branch from 91831f6 to c5e394f Compare October 30, 2026 12:54
@mydea mydea mentioned this pull request Oct 30, 2026
test(e2e): Point together-ai 1.x at OpenRouter's base URL in gen-ai-libraries #25947
Merged
@mydea
mydea marked this pull request as ready for review October 30, 2026 13:21
@mydea
mydea requested review from a team as code owners October 30, 2026 13:21
@mydea
mydea requested review from andreiborza, chargome, isaacs, logaretm, msonnb and nicohrubec and removed request for a team October 30, 2026 13:21
@mydea mydea changed the title feat(server-utils): Trace Flue and pi-durable model calls through pi-ai feat(server-utils): Enable pi-ai by default & use it for flue & pi-durable Oct 30, 2026
chargome
chargome reviewed Nov 3, 2026
View reviewed changes
Comment thread packages/server-utils/src/integrations/index.ts
langChainIntegration(),
langGraphIntegration(),
mastraIntegration(),
piAiIntegration(),

@chargome chargome Nov 3, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Turning this on by default means one pi-ai request turns off the OpenAI / Anthropic / Google GenAI / Workers AI integrations for the whole process. So an app that uses pi-ai and also e.g. calls openai directly loses spans for its direct calls.

Could we make the skip apply only to requests pi-ai sends? The provider integrations already check the skip on every request, and the pi-ai chat span is active while pi-ai's request goes out. So they could skip only when they're inside a pi-ai span, and leave other calls alone.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mydea reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@mydea mydea Nov 4, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

updated it like this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/server-utils/src/ai/flue/index.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea added a commit that referenced this pull request Nov 3, 2026
@mydea @claude
test(e2e): Point together-ai 1.x at OpenRouter's base URL in gen-ai-l…
ec88aef
…ibraries (#25947)

**Why:** The `gen-ai-libraries (latest)` variant installs
`together-ai@latest`, which is now 1.0.0. That release moved `/v1` from
the SDK's default base URL into the request paths, so with our
`https://openrouter.ai/api/v1` base URL it requests
`/api/v1/v1/chat/completions` and both Together cases fail with a 500
(e.g. on #25940). Against a local server, 0.54.0 hits
`/api/v1/chat/completions` with the `/v1` base and 1.0.0 hits
`/api/v1/v1/chat/completions`; with the base URL minus `/v1`, 1.0.0 hits
the right path.

The default variant keeps 0.54.0, so the client picks the base URL from
`together-ai/version`, which both versions export. Verified against a
local server for both versions, and the import and expression type-check
against both.

**How to review:** One line in `src/libraries.ts`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@mydea
mydea force-pushed the feat/pi-ai-integration-default branch from c5e394f to 52faa76 Compare November 3, 2026 12:09
cursor[bot]
cursor Bot reviewed Nov 3, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/server-utils/src/ai/flue/index.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mydea
mydea marked this pull request as draft November 4, 2026 12:08
cursor[bot]
cursor Bot reviewed Nov 4, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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 bb2e0e8. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/server-utils/test/integrations/pi-ai.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mydea mydea changed the title feat(server-utils): Enable pi-ai by default & use it for flue & pi-durable feat(server-utils): Enable pi-ai by default & use it for Flue & pi-durable Nov 4, 2026
@mydea
mydea requested a review from chargome November 4, 2026 16:22
@mydea
mydea marked this pull request as ready for review November 4, 2026 16:22
chargome
chargome approved these changes Nov 6, 2026
View reviewed changes
@mydea
mydea force-pushed the feat/pi-ai-integration-default branch 2 times, most recently from 888121e to 4519b2d Compare November 10, 2026 08:26
@mydea
mydea force-pushed the feat/pi-ai-integration-default branch from f04f588 to 0399c98 Compare November 11, 2026 14:41
@mydea
mydea requested a review from a team November 11, 2026 14:41
mydea and others added 9 commits November 11, 2026 16:25
@mydea @claude
feat(server-utils): Trace Flue and pi-durable model calls through pi-ai
d685996
Enables `piAiIntegration` by default. Flue and pi-durable send their model
calls through pi-ai, so they no longer open chat spans of their own: Flue drops
its turn spans and hands the conversation id to the pi-ai span through the
scope, and pi-durable drops its `models` proxy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
feat(server-utils): Warn when Flue runs without pi-ai instrumentation
7637453
Flue's model calls are now traced by the pi-ai integration, which needs the
module hook or bundler plugin, while `instrument()` does not. Without them a
Flue app would silently lose its `gen_ai.chat` spans; it now gets a warning on
its first model call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
fix(server-utils): Skip provider spans only for requests pi-ai sends
d0e1668
With pi-ai on by default, a single pi-ai request turned off the OpenAI, Anthropic, Google GenAI and Workers AI integrations for the whole process, so an app's direct calls to those SDKs lost their spans. Those integrations now skip only while a pi-ai span is active, which is the case while pi-ai sends its request.

Mistral is included because pi-ai sends through its SDK in 0.80.1 to 0.84.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
feat(server-utils): Show runtime-specific fix in Flue pi-ai warning
f0bb368
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
fix(server-utils): Apply Flue and pi-durable recording options to cha…
188c744
…t spans

Chat spans moved to the pi-ai integration, so `recordInputs` and `recordOutputs` on Flue and pi-durable only reached tool spans, and an existing opt-out stopped keeping prompts and completions off chat spans. Both now pass their options to the pi-ai span through the scope, the way the conversation id already travels. An explicit `false` on either integration wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
ref(server-utils): Use the active pi-ai span for nested calls and pro…
41126d0
…vider skips

Replace the pi-ai depth counter with the active-span check, which also
catches a nested call made after an await, and put the two provider skip
conditions behind one helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
ref(server-utils): Tidy comments and warning test after pi-ai switch
03ff351
Drop comments left stale by moving chat spans to pi-ai, and assert the
exact Flue warning instead of filtering out the other runtimes' hints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
ref(server-utils): Use shared runtime helpers in Flue pi-ai warning
a34c7e8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea @claude
test(server-utils): Assert span end instead of sleeping in pi-ai scop…
33e9056
…e test

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mydea
mydea force-pushed the feat/pi-ai-integration-default branch from 0399c98 to 33e9056 Compare November 11, 2026 15:25
sentry-junior[bot]
sentry-junior Bot reviewed Nov 12, 2026
View reviewed changes

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The switch looks solid. Earlier feedback is addressed: the provider skip is now scoped to the active pi-ai span, and the Flue and pi-durable recording options reach the chat spans through the scope. I checked @flue/runtime 2.3.0, and it calls getRuntimeModels().streamSimple(...) synchronously inside interceptExecution for the model operation. So the withScope in the MODEL branch does wrap the pi-ai call, and pi-ai is imported statically, so the warning check won't fire before the module loads.

One gap that being on by default opens up: Bedrock. pi-ai 1.x sends Bedrock requests through @aws-sdk/client-bedrock-runtime (client.send(new ConverseStreamCommand(...)) in dist/api/bedrock-converse-stream.js), and awsIntegration turns ConverseStream into a gen_ai.chat span with usage (bedrock-runtime.ts, _requestPreSpanHookConverse). Until now, plain pi-ai apps on Bedrock got only the AWS span, because piAiIntegration was opt-in. After this PR they get two gen_ai.chat spans per request, which double-counts their tokens and cost. That also makes the release note's "Requests pi-ai sends are reported once" untrue for Bedrock. You could check isInsidePiAiSpan() in the Bedrock service hook and fall back to a plain AWS client span there, or call out the Bedrock exception in the release note and handle it in a follow-up.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sentry-junior @mydea
fix(server-utils): Report pi-ai Bedrock requests once
d1c6a62
pi-ai sends Bedrock requests through `@aws-sdk/client-bedrock-runtime`, and `awsIntegration` reported each one as a second `gen_ai.chat` span with the same token usage, nested under pi-ai's. Bedrock requests made while a pi-ai span is active now keep only the plain AWS client span. Direct Bedrock calls are unchanged.

Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@mydea mydea self-assigned this Nov 12, 2026
@sentry-junior @mydea
test(server-utils): Run the pi-ai Bedrock scenario on Bun
f85263b
The Bun build bundles the scenario, and pi-ai loads its Bedrock provider through an `import()` that a bundler cannot follow, so the scenario registers it with pi-ai's `setBedrockProviderModule`. A local server replaces `nock`, which did not intercept the AWS SDK request on Bun.

The direct Bedrock call is dropped: the bundle holds pi-ai's copy of `@aws-sdk/client-bedrock-runtime` and the test's, and renames the second `ConverseStreamCommand`, so `awsIntegration` does not recognize it. `aws-serverless/bedrock` covers direct calls.

Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@mydea
mydea merged commit a5d2d5c into develop Nov 12, 2026
442 of 447 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mydea
mydea deleted the feat/pi-ai-integration-default branch November 12, 2026 10:26
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 16, 2026
publish: getsentry/[email protected] getsentry/publish#10451
Closed
51 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@sentry-junior sentry-junior[bot] sentry-junior[bot] left review comments
@chargome chargome chargome approved these changes
@isaacs isaacs Awaiting requested review from isaacs isaacs was automatically assigned from getsentry/team-javascript-sdks-server
@andreiborza andreiborza Awaiting requested review from andreiborza andreiborza was automatically assigned from getsentry/team-javascript-sdks-server
@logaretm logaretm Awaiting requested review from logaretm logaretm was automatically assigned from getsentry/team-javascript-sdks-browser
@msonnb msonnb Awaiting requested review from msonnb msonnb was automatically assigned from getsentry/team-javascript-sdks-browser
@nicohrubec nicohrubec Awaiting requested review from nicohrubec nicohrubec was automatically assigned from getsentry/team-javascript-sdks-framework

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mydea mydea

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mydea @chargome
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.