Skip to content

refactor(config): extract shared apiKey helper - #1400

Merged
corbits-triage[bot] merged 1 commit into
mainfrom
cl-10522-apiKey-helper
Oct 12, 2026
Merged

corbits-triage[bot] merged 1 commit into
mainfrom
cl-10522-apiKey-helper

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Extracts the shared apiKey fallback (catalog entry wins, then settings row, else omitted) into an apiKeyFor(entry, providerSettings) helper in src/config/inference-sources.ts.
  • Replaces the copy-pasted ternary at all five source builders (go, zen, anthropic, bifrost, openai-compatible) with the helper; each site keeps the same precedence and spread shape.

Verification

  • bun run typecheck passes
  • bun test ./src/config/inference-sources.test.ts passes (40/40)
  • bun test ./src/config passes (151/151)
  • Per-site parity verified against the pre-change diff: all five ternaries were identical (entry.apiKey → providerSettings.apiKey → absent), so no site deviates.

Fixes CL-10522

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

CL-10522

@corbits-triage

Copy link
Copy Markdown
Contributor

No changes needed from you. A maintainer will review this pull request.

@corbits-triage
corbits-triage Bot merged commit e88fda1 into main Oct 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant