fix: revert duplicate LLMProviders.fromEnv() — TS2393 broke build#47
Closed
stackbilt-admin wants to merge 1 commit intomainfrom
Closed
fix: revert duplicate LLMProviders.fromEnv() — TS2393 broke build#47stackbilt-admin wants to merge 1 commit intomainfrom
stackbilt-admin wants to merge 1 commit intomainfrom
Conversation
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.
Member
Author
|
Superseded by #48, which merged the same fix with a clearer commit message and downstream context. Closing this one. |
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.
Summary
Reverts 33aaf53. That commit added a second
static fromEnv()to theLLMProvidersclass without noticing the existing one (added 2026-04-01 in743a1e04, PRs #7/#8). TypeScript correctly errored:Broke
npm run build(preparescript istsc), 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), noFromEnvOverridessupport, silent on empty-env (the existing one throwsConfigurationError). Nothing salvageable. The existingfromEnvatsrc/index.ts:218already covers the use case the reverted commit's message describes:FromEnvOverrides(defaultProvider, costOpt, breaker, retries, fallback, ledger, quotaHook, hooks)ConfigurationErrorValidation
npm run build— clean (tscexit 0) locally on this branchfromEnvis unchanged)Test plan
npm publishis unblocked (separate follow-up, not gated on this PR)🤖 Generated with Claude Code