Repository navigation
cli: drop the unused gpt-tokenizer peer - #6508
Merged
Merged
Conversation
Nothing under packages/cli imports gpt-tokenizer; package.json was its only mention. As a required peer it still cost every npm or pnpm install of the CLI about 53 MB, and it would have forced the standalone runtime to either carry it or break the CLI's own peer contract. The sandbox's XLE tokenizer generator is the one other reader, and it already falls back to its heuristic: it resolves from the repo root, where the CLI's devDependency was never visible.
josephfarina
requested review from
cixzhang and
imdreamrunner
as code owners
September 24, 2026 05:38
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
Contributor
There was a problem hiding this comment.
Thanks — dropping the unused gpt-tokenizer peer looks correct and safe to land.
- Nothing in the CLI imports or re-exports
gpt-tokenizer; at the previous revision it appeared underpackages/clionly inpackage.json, yet as a required peer it was installed by default on every CLI install. - The lockfile diff removes only the
gpt-tokenizerentries, and no source file changes, so CLI behaviour is unchanged. Removing a peer requirement that narrows nothing is nonbreaking, and the patch[fix]Changeset for@astryxdesign/cliclassifies it correctly. - The sandbox tokenizer generator is unaffected in the repo's pnpm workflow: it resolves from the repo root, where the CLI's dev dependency was never visible, and already writes its heuristic fallback by design. If the sandbox ever needs the real tokenizer guaranteed, it should declare that dependency itself — separate from this change.
No changes requested.
[Automated review]
This branch was successfully deployed
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.
Maintainer impact
@astryxdesign/clilistsgpt-tokenizeras a required peer, but nothing in the CLI imports it. npm and pnpm install required peers by default, so every install of the CLI pulls in about 53 MB (1,348 files) it never uses. Any self-contained copy of the CLI also has to either carry it or break the CLI's own peer contract.Intended invariant
The CLI behaves the same. It never loads
gpt-tokenizer.Change
Drop
gpt-tokenizerfrompeerDependenciesanddevDependenciesinpackages/cli/package.json. The lockfile loses its threegpt-tokenizerentries and nothing else.Evidence
packages/cli/package.jsonis the only file underpackages/clithat mentionsgpt-tokenizer, and[email protected]unpacks to 53,103,516 bytes.pnpm install --frozen-lockfileis clean and the lockfile diff only removesgpt-tokenizer.scripts/generate-xle-tokenizer.mjs, resolves from the repo root where the CLI's devDependency was never visible. It already wrote its heuristic fallback before this change and still does.Scope
Testing
grep -rn gpt-tokenizer packages/clifinds onlypackage.jsonbefore and nothing afternode apps/sandbox/scripts/generate-xle-tokenizer.mjswrites the heuristic fallback before and afternpx vitest run packages/cli