Skip to content

cli: drop the unused gpt-tokenizer peer - #6508

Merged
josephfarina merged 1 commit into
mainfrom
cli/drop-gpt-tokenizer-peer
Sep 24, 2026
Merged

josephfarina merged 1 commit into
mainfrom
cli/drop-gpt-tokenizer-peer

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Maintainer impact

@astryxdesign/cli lists gpt-tokenizer as 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-tokenizer from peerDependencies and devDependencies in packages/cli/package.json. The lockfile loses its three gpt-tokenizer entries and nothing else.

Evidence

  • Failure before the change: packages/cli/package.json is the only file under packages/cli that mentions gpt-tokenizer, and [email protected] unpacks to 53,103,516 bytes.
  • Success after the change: pnpm install --frozen-lockfile is clean and the lockfile diff only removes gpt-tokenizer.
  • Product/runtime behavior verified unchanged: the CLI suite passes. The only other reader, the sandbox's 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

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • grep -rn gpt-tokenizer packages/cli finds only package.json before and nothing after
  • node apps/sandbox/scripts/generate-xle-tokenizer.mjs writes the heuristic fallback before and after
  • npx vitest run packages/cli

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.
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 24, 2026 5:42am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 24, 2026
@astracat-bot

astracat-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 24, 2026, 5:42 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 under packages/cli only in package.json, yet as a required peer it was installed by default on every CLI install.
  • The lockfile diff removes only the gpt-tokenizer entries, 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/cli classifies 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]

@josephfarina
josephfarina enabled auto-merge (squash) September 24, 2026 05:49
@josephfarina
josephfarina merged commit c13ef6b into main Sep 24, 2026
36 checks passed
@github-actions
github-actions Bot deleted the cli/drop-gpt-tokenizer-peer branch September 24, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — 5985e807 Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant