fix(core): Bind AI provider skips to the isolation scope - #23570
Closed
JPeer264 wants to merge 1 commit into
Closed
Conversation
The AI provider skip registry was a module-global Set that the Node and Cloudflare clients cleared once per client. Skips are registered lazily by higher-level integrations at call time (LangChain marking its providers, Vercel AI marking Workers AI), so a single such call suppressed the spans of direct provider calls in every later request served by the same client: for the whole process on Node, for the whole isolate on Cloudflare. The registry is now keyed on the isolation scope. A skip registered inside an invocation applies to that invocation only, one registered outside any invocation still applies everywhere. The per-client clear in the Node and Cloudflare clients is no longer needed. Adds a Node integration test that sends a LangChain request followed by a direct Anthropic request on one server and asserts the second one keeps its span. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
Member
Author
|
Closing for now as it might not be relevant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow up to #23151 (comment)
The AI provider skip registry was a module-global Set that the Node and Cloudflare clients cleared once per client. Skips are registered lazily by higher-level integrations at call time (LangChain marking its providers, Vercel AI marking Workers AI), so a single such call suppressed the spans of direct provider calls in every later request served by the same client: for the whole process on Node, for the whole isolate on Cloudflare.
The registry is now keyed on the isolation scope. A skip registered inside an invocation applies to that invocation only, one registered outside any invocation still applies everywhere. The per-client clear in the Node and Cloudflare clients is no longer needed.
Adds a Node integration test that sends a LangChain request followed by a direct Anthropic request on one server and asserts the second one keeps its span.