Skip to content

Remove unused legacy exports from models.config.mjs #11

@s2x

Description

@s2x

Description

models.config.mjs:180-211 defines three legacy exports that are not used anywhere in the codebase:

// Legacy exports for backward compatibility (can be removed in v2.0)
export const modelLimitsOverrides = Object.fromEntries(
  Object.entries(SUPPORTED_MODELS)
    .filter(([_, config]) => config.limit)
    .map(([name, config]) => [name, config.limit])
);

export const modelCostsDefaults = Object.fromEntries(
  Object.entries(SUPPORTED_MODELS)
    .filter(([_, config]) => config.cost)
    .map(([name, config]) => [name, config.cost])
);

export const modelVariants = {
  claude: { low: {...}, high: {...} },
  gemini: { low: {...}, high: {...} },
  geminiPro: { low: {...}, high: {...} },
  gptReasoning: { low: {...}, high: {...} },
};

Evidence of non-use

Searching the codebase:

  • modelLimitsOverrides — not imported or referenced outside its own declaration.
  • modelCostsDefaults — not imported or referenced outside its own declaration.
  • modelVariants — not imported or referenced outside its own declaration.
  • No external package depends on these exports (this is a CLI tool, not a library consumed by other packages).

Impact

  • These objects are computed on every module import (Object.fromEntries + Object.entries + filter + map), even though they're never used.
  • The modelVariants object duplicates data already present in SUPPORTED_MODELS per-model configs, creating a synchronization risk — if someone updates a model's variants in SUPPORTED_MODELS but forgets modelVariants, they silently diverge.
  • The comment "can be removed in v2.0" suggests this was planned for removal. The current version is 1.17.1.

Proposed fix

Remove all three exports. Since the package version is 1.x and these are documented as legacy, they should be safe to remove in a minor version with a note in CHANGELOG.

If external consumers might theoretically depend on them via direct import of models.config.mjs, consider:

  1. Checking npm download stats to see if anyone uses this as a library.
  2. Removing in the next major version bump.

Acceptance criteria

  • modelLimitsOverrides, modelCostsDefaults, and modelVariants are removed from models.config.mjs.
  • No imports or references to these exports exist in the codebase.
  • All existing tests pass.
  • CHANGELOG documents the removal as a breaking change (if targeting v2.0) or cleanup (if no external consumers).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions