Repository navigation
Conversation
size-limit report 📦Compared: b4a28ac (PR test merge using develop at bdb7624) Against: 77f71ea (develop) · base run #65023
|
Optional E2E testsAll optional checks were successful. 31 successful. See the run. Successful checks
|
7f58fd6 to
91831f6
Compare
91831f6 to
c5e394f
Compare
| langChainIntegration(), | ||
| langGraphIntegration(), | ||
| mastraIntegration(), | ||
| piAiIntegration(), |
There was a problem hiding this comment.
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.
…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 <noreply@anthropic.com>
c5e394f to
52faa76
Compare
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
| }); | ||
| settle(message); | ||
| await events.result(); | ||
| await new Promise(resolve => setTimeout(resolve)); |
There was a problem hiding this comment.
Test sleeps instead of waiting
Low Severity
This new test yields with setTimeout after already awaiting events.result(). A sibling test in the same file settles the stream the same way and asserts spanEnd immediately. Flagged because the review rules call out sleeps in tests; a concrete signal such as the spanEnd listener is enough here.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit bb2e0e8. Configure here.
…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 <noreply@anthropic.com>
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 <noreply@anthropic.com>


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
modelsproxy). WithpiAiIntegration(#25937) enabled by default, pi-ai becomes the single source ofgen_ai.chatspans, 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:
auto.ai.flue/auto.ai.pi_durabletoauto.ai.pi_ai.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 emitscompaction_start(with amanual/threshold/overflowreason) andcompactionobservations, so it could open agen_ai.compactspan with the summarizinggen_ai.chatnested under it.modelsobject created with pi-ai'screateModels().Release note:
🤖 Generated with Claude Code