chore(spec): prune unused component schemas from the SDK client bundles - #1803
Conversation
The js-sdk and python-sdk Redocly bundles keep operations by tag but never pruned component schemas, so every schema in the synced spec landed in both generated clients — admin, cluster/rig, node, team-API-key and access-token models that no SDK endpoint references. The envd and volume bundles already run remove-unused-components; turn it on for the two SDK bundles too. Regenerated with `make codegen`: schema.gen.ts loses 20 unused schemas, the Python client loses 22 model files. No SDK or CLI source references any removed type (the CLI's use of `Team` stays — the js-sdk bundle keeps `auth`). js-sdk `tsc --noEmit` clean; `import e2b` clean. Signed-off-by: Babis Chalios <babis.chalios@e2b.dev>
PR SummaryLow Risk Overview Regenerated clients drop those types: JS Reviewed by Cursor Bugbot for commit 09b4dc1. Bugbot is set up for automated code reviews on this repo. Configure here. |
🦋 Changeset detectedLatest commit: 09b4dc1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
Package ArtifactsBuilt from 79da243. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.46.2-spec-prune-unused-components.0.tgzCLI ( npm install ./e2b-cli-2.18.1-spec-prune-unused-components.0.tgzCode Interpreter JS SDK ( npm install ./e2b-code-interpreter-2.7.3-spec-prune-unused-components.0.tgzDesktop JS SDK ( npm install ./e2b-desktop-2.3.5-spec-prune-unused-components.0.tgzPython SDK ( pip install ./e2b-2.46.4+spec.prune.unused.components-py3-none-any.whlCode Interpreter Python SDK ( pip install ./e2b_code_interpreter-2.9.3+spec.prune.unused.components-py3-none-any.whlDesktop Python SDK ( pip install ./e2b_desktop-2.4.6+spec.prune.unused.components-py3-none-any.whl |
There was a problem hiding this comment.
TASTE.md compliance review: no violations found. Checked the changed files (redocly.yaml, schema.gen.ts, Python api/client/models/*, changeset) against the public-surface rules (T-18 generated types never reach users, T-54 flat entry points, T-65/T-66 deprecation). The PR only removes generated schemas that no SDK-facing operation references; no public SDK export changes (Team is still kept in the js-sdk bundle via the auth tag for the CLI's asFormattedTeam), so nothing needs a deprecated alias.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3336d6591
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Looks good, straightforward config change with regenerated outputs.
What was reviewed: the redocly.yaml diff enabling remove-unused-components: on for both bundles; confirmed Team schema is retained in schema.gen.ts (still needed by the CLI's format.ts via the auth tag) while Node/NodeDetail/TeamAPIKey/etc. are gone; grepped packages/js-sdk/src, packages/cli/src, and packages/python-sdk/e2b for the 22 removed Python model names and all removed JS schema names — no references outside the generated files; checked the Python models/__init__.py imports/__all__ are internally consistent with no dangling entries. The async Python client (client_async) just re-exports the sync client's models, so there's no parity gap to fix there.
Extended reasoning...
Overview
This PR is a narrow, mechanical change: it flips on remove-unused-components: on in redocly.yaml for the js-sdk and python-sdk bundle configs, then re-runs make codegen to regenerate packages/js-sdk/src/api/schema.gen.ts and packages/python-sdk/e2b/api/client/models/*. The net effect is that component schemas unreferenced by the SDK-exposed operation tags (admin, cluster/rig, node, team-API-key, access-token models) are pruned from both generated clients. A changeset correctly marks this as a patch for e2b and @ e2b/python-sdk.
Security risks
None. This only removes unused generated type definitions/models from client bundles; it does not touch any request/response logic, auth handling, or runtime behavior.
Level of scrutiny
Low-to-moderate scrutiny is warranted given this modifies generated client code and touches the public package surface (hence the changeset), but the change itself is purely subtractive and config-driven, not hand-crafted logic. I verified the two claims most likely to hide a real regression: (1) that Team is still exported from the js-sdk schema despite pruning, since the CLI depends on components['schemas']['Team'] — confirmed it's present at line 2720 of schema.gen.ts; and (2) that none of the 22 removed Python models or the pruned JS schema names are referenced anywhere outside the generated files in js-sdk/src, cli/src, or python-sdk/e2b — confirmed via targeted greps, none found. I also checked the Python models/__init__.py for consistency between its imports and __all__ tuple (matches, no dangling names) and confirmed the async Python client is a thin re-export of the sync client's models rather than a separate generated tree, so no parity gap exists between sync/async Python as required by CLAUDE.md.
Other factors
No spec/ files were hand-edited (only redocly.yaml, which governs post-sync bundling, and generated outputs) — consistent with the repo's Copybara-sync convention. The changeset is present and correctly scoped as a patch. The diff is purely subtractive (2265 deletions vs 14 insertions), self-contained, and matches the PR description precisely, which raises confidence this is a straightforward, correct regeneration rather than a hand-pruned or partially-applied change.
The generated `components` namespace is re-exported from the JS entry point and the Python models package is importable, so the removal is visible to anyone who imported those names. State that plainly, list the names, and classify as minor — the level earlier generated-model removals (#1146, #821) shipped at. Signed-off-by: Babis Chalios <babis.chalios@e2b.dev>
Conflicts were confined to generated files; resolved by re-running `make codegen` against the merged spec. The Rig/admin/access-token models that the spec bump had dragged into this branch are gone; the two `memory` fields remain in both generated clients. Signed-off-by: Babis Chalios <babis.chalios@e2b.dev>
Gap:
redocly.yamlfilters the synced REST spec down to the SDK-facing operations by tag, but never prunes component schemas, so every schema in the spec lands in both generated clients — admin, cluster/rig, node, team-API-key and access-token models no SDK endpoint uses. Surfaced by review on #1800, where the spec bump dragged the newRig*schemas intoschema.gen.tsand the Python models.Change:
remove-unused-components: onfor thejs-sdkandpython-sdkbundles, matching what the envd and volume bundles already do. Regenerated withmake codegen.schema.gen.ts: 20 unused schemas removed, no additionsapi/client/models: 22 model files removed,__init__.pyexports prunedRig*modelsVisible removal, classified minor: the JS
componentsnamespace is re-exported from the entry point and the Python models package is importable, so the removed type names disappear for anyone who imported them directly. The changeset lists every name. No SDK method ever accepted or returned these types (they belong to admin/cluster endpoints the SDKs do not expose), and prior generated-model removals shipped as minor (#1146, #821), so this follows that precedent rather than a major bump.Verification: no SDK or CLI source references a removed type — grep over
packages/js-sdk/src,packages/cli/src,packages/python-sdk/e2b(the CLI'scomponents['schemas']['Team']is unaffected: the js-sdk bundle keepsauth, soTeamstays).tsc --noEmiton js-sdk clean;import e2band the models package import clean (79 models). Generated files were produced by the same Docker codegen CI runs.