fix(auto-instrumentation): Upgrade @apm-js-collab/code-transformer to v0.12.0#1708
Merged
Stephen Belanger (Qard) merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
258f7d9 to
83cddb0
Compare
Luca Forstner (lforst)
approved these changes
Mar 31, 2026
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
2c7c725 to
9dbb7ab
Compare
Stephen Belanger (Qard)
added a commit
that referenced
this pull request
Apr 7, 2026
…v3/v4+/v5 (#1739) ## Summary - **streamText / streamObject (ESM)**: Split the instrumentation config by version range. In v3 both functions are declared `async`, so they need `kind: "Async"` (asyncEnd fires with the resolved stream result). In v4+ they are sync functions returning the stream directly, so they use `kind: "Sync"` with the existing sync-stream channels. - **Agent.stream (v5)**: The `stream()` method in v5 is sync (not async), so `wrapPromise`'s `asyncEnd` never fires under auto-hook instrumentation. Added a new `agentStreamSync` channel (`kind: "sync-stream"`) for the auto-hook path. The existing `agentStream` channel is kept for the `wrapAISDK` wrapper path which uses `tracePromise`. These gaps were exposed by the `@apm-js-collab/code-transformer` v0.11.0 upgrade (PR #1708), which tightened `wrapPromise` to only fire `asyncEnd` when the return value is actually thenable. ## Test plan - All 84 AI SDK instrumentation e2e tests pass (wrapped + auto-hook for v3, v4, v5, v6) - `pnpm run build` succeeds with no type errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Luca Forstner <luca.forstner@gmail.com>
Abhijeet Prasad (AbhiPrasad)
approved these changes
Apr 9, 2026
Member
Abhijeet Prasad (AbhiPrasad)
left a comment
There was a problem hiding this comment.
need this to merge to unblock #1765
2c7c725 to
432e20b
Compare
8c8016a to
2a9ea34
Compare
2a9ea34 to
28a4aa6
Compare
… v0.12.0 - Bump version range to ^0.12.0. v0.12.0 is a JS rewrite (replacing the WASM transformer) that fixes Promise subclass preservation, restoring APIPromise.withResponse() support under auto-instrumentation. - Fix ESM loader hook to pass the actual module type (esm/cjs/unknown) from the Node.js loader format instead of always passing "unknown", which caused CJS require() to be injected into ESM files. - Remove tracePromise assertions from transformation tests (implementation detail of the old WASM output; new JS version uses runStores instead). - Add @apm-js-collab/* to minimumReleaseAgeExclude so pnpm can install v0.12.0 during the 3-day release age window. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28a4aa6 to
f6ec008
Compare
Luca Forstner (lforst)
approved these changes
Apr 10, 2026
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.
Summary
@apm-js-collab/code-transformerfrom^0.9.0to^0.11.0, picking up the v0.11.0 JS rewrite (replaces the previous WASM-based transformer)esm/cjs/unknown) based on Node.js loader format, instead of always passing"unknown"— this was causing CJSrequire()to be injected into ESM (.mjs) filestracePromiseassertions from transformation tests (implementation detail of the old WASM output; the new JS transformer usesrunStoresinstead)dc-browserto v1.0.4, which adds a default export to match Node.js CJS-ESM interop behaviour required by the diagnostics_channel-based wrappersTest plan
pnpm testinjs/)🤖 Generated with Claude Code