Skip to content

fix: revert duplicate LLMProviders.fromEnv() — TS2393 broke build#47

Closed
stackbilt-admin wants to merge 1 commit intomainfrom
fix/duplicate-fromenv-revert
Closed

fix: revert duplicate LLMProviders.fromEnv() — TS2393 broke build#47
stackbilt-admin wants to merge 1 commit intomainfrom
fix/duplicate-fromenv-revert

Conversation

@stackbilt-admin
Copy link
Copy Markdown
Member

Summary

Reverts 33aaf53. That commit added a second static fromEnv() to the LLMProviders class without noticing the existing one (added 2026-04-01 in 743a1e04, PRs #7/#8). TypeScript correctly errored:

src/index.ts(218,10): error TS2393: Duplicate function implementation.
src/index.ts(381,10): error TS2393: Duplicate function implementation.

Broke npm run build (prepare script is tsc), which means publish is blocked AND every downstream consumer that builds llm-providers from main as a sibling-checkout dep currently has red CI.

Why revert vs. fix-forward

The reverted impl was a strict subset of the existing fromEnv — same pattern, fewer providers (no Anthropic, no OpenAI), no FromEnvOverrides support, silent on empty-env (the existing one throws ConfigurationError). Nothing salvageable. The existing fromEnv at src/index.ts:218 already covers the use case the reverted commit's message describes:

Feature Existing (line 218) Reverted (line 381)
Providers Anthropic + OpenAI + Groq + Cerebras + CF AI Groq + Cerebras + CF AI
Overrides FromEnvOverrides (defaultProvider, costOpt, breaker, retries, fallback, ledger, quotaHook, hooks) none
Empty env throws ConfigurationError silently returns empty-config instance

Validation

  • npm run build — clean (tsc exit 0) locally on this branch
  • No test changes; no API surface change (the existing fromEnv is unchanged)

Test plan

  • CI green on this PR
  • After merge: downstream sibling-checkout consumers' typecheck jobs go green
  • Confirm npm publish is unblocked (separate follow-up, not gated on this PR)

🤖 Generated with Claude Code

Reverts 33aaf53. That commit added a second `static fromEnv()` to
`LLMProviders` without noticing the existing one (added 2026-04-01 in
743a1e0, PRs #7/#8). TypeScript correctly errored:

    src/index.ts(218,10): error TS2393: Duplicate function implementation.
    src/index.ts(381,10): error TS2393: Duplicate function implementation.

This broke `npm run build` (the `prepare` script is `tsc`), which means
publish was blocked AND every downstream consumer that builds
llm-providers from main as a sibling-checkout dep had red CI.

The reverted impl was a strict subset of the existing one — same
pattern, fewer providers (no Anthropic, no OpenAI), no overrides
support, silent on empty-env (existing throws `ConfigurationError`).
Nothing salvageable; the existing fromEnv at line 218 already covers
the use case the reverted commit's message describes.
@stackbilt-admin
Copy link
Copy Markdown
Member Author

Superseded by #48, which merged the same fix with a clearer commit message and downstream context. Closing this one.

@stackbilt-admin stackbilt-admin deleted the fix/duplicate-fromenv-revert branch April 21, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant