feat(cli): attribute CLI traffic via the e2b-cli integration tag#1525
feat(cli): attribute CLI traffic via the e2b-cli integration tag#1525mishushakov wants to merge 1 commit into
Conversation
PR SummaryMedium Risk Overview This depends on SDK support from the stacked integration-tag work and on the API parsing Reviewed by Cursor Bugbot for commit 777010b. Bugbot is set up for automated code reviews on this repo. Configure here. |
🦋 Changeset detectedLatest commit: 777010b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ad0d704 to
f471903
Compare
Package ArtifactsBuilt from edeb74f. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.31.1-cli-integration-attribution.0.tgzCLI ( npm install ./e2b-cli-2.13.1-cli-integration-attribution.0.tgzPython SDK ( pip install ./e2b-2.30.0+cli.integration.attribution-py3-none-any.whl |
Set ConnectionConfig.setIntegration('e2b-cli/<version>') before the
shared connection config is built at import time so every CLI request
carries the tag in the User-Agent header. The CLI typechecks and
bundles the workspace js-sdk source (tsconfig paths maps 'e2b' to
../js-sdk/src), so no published e2b release is required.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f471903 to
777010b
Compare
Stacked on #1524.
Sets the CLI integration string introduced there:
ConnectionConfig.setIntegration('e2b-cli/<version>')runs at the top ofsrc/api.ts, before the shared connection config is constructed at import time, so every CLI request carries the tag in theUser-Agentheader:No dependency changes needed: the CLI typechecks and bundles the workspace js-sdk source (
packages/cli/tsconfig.jsonmapse2b→../js-sdk/src, and esbuild follows the same mapping when bundling vianoExternal), so the setter is available as soon as #1524 merges — no publishede2brelease required.The API currently parses the SDK version from the
User-Agentby taking everything aftere2b-js-sdk/, so any integration tag appended after the SDK token breaks template builds (verified against production):This affects every integration using #1524's setter, not just the CLI. The parser needs to be fixed on the backend (stop at the first whitespace after the SDK token) before this — or any integration tagging — ships. Prepending the tag instead (
e2b-cli/2.13.0 e2b-js-sdk/2.31.0) passes against today's backend, if a client-side ordering workaround is preferred in #1524.Merge order
e2b-js-sdk/<version>Verified
packages/cli/tests/attribution.test.tscovers the import-time shared config and configs constructed later at runtime (auth commands, Sandbox calls).User-Agent: e2b-js-sdk/2.31.0 e2b-cli/2.13.0, confirming the call survives esbuild bundling (sideEffects: falsemakes a bare side-effect import unsafe, hence placement inapi.ts) and that the bundle carries the workspace SDK regardless of the npme2bversion installed.🤖 Generated with Claude Code