Skip to content

fix(providers): honor the apiBaseUrl settings across every request path (fixes #247) - #257

Merged
ltmoerdani merged 1 commit into
mainfrom
fix/issue247-api-base-url
Oct 13, 2026
Merged

ltmoerdani merged 1 commit into
mainfrom
fix/issue247-api-base-url

Conversation

@ltmoerdani

Copy link
Copy Markdown
Owner

Summary

Re-wires the opencodego.apiBaseUrl / opencodezen.apiBaseUrl feature dropped by later structural refactors. Fixes #247.

Root cause

PR #149 fully implemented configurable base URLs (configuredApiBaseUrl() / configuredGoUsageUrl() in extension.ts + tests). Later refactors (8b1176f extract provider/definitions.ts, e8fb6b2 / 2a3589d extract the provider class) reverted the definitions to hardcoded opencode.ai URLs and removed the wiring — leaving orphaned helpers in config.ts and a resolveUsageUrl tracker hook that no caller supplied. Reported exactly as observed in #247.

Fix

  • config.ts: new pure apiRoutesFromBaseUrl() deriving all routes (models, chat/completions, messages, responses, usage) from one base URL
  • provider/definitions.ts: PROVIDERS derives URLs from the configured setting (root-config full-key read, normalized via normalizeApiBaseUrl, safe fallback on malformed values); agent variants inherit via providerVariant, so chat transports, model discovery, connection test, and inline completions are covered by construction
  • usage/dashboard/state.ts: supplies resolveUsageUrl so Go server-usage sync follows the configured base too
  • Reload after changing, matching the documented contract

Verification

  • npm run compile clean
  • Unit tests: 515 pass / 0 fail (incl. new apiRoutesFromBaseUrl coverage)
  • npm run lint: all 7 checks pass (strict gate, no suppressions)

Docs

  • docs/issues/110-20261013-issue247-api-base-url-ignored.md
  • CHANGELOG entry merged under [0.7.9] — unreleased

Merging with a merge commit (no squash).

…th (fixes #247)

Re-wire the PR #149 feature dropped by later structural refactors: the
provider definitions had reverted to hardcoded opencode.ai URLs and the
settings wiring (configuredApiBaseUrl/configuredGoUsageUrl) was gone,
leaving orphaned helpers and an unsupplied resolveUsageUrl tracker hook.

- config.ts: pure apiRoutesFromBaseUrl() derives all routes from one base
- provider/definitions.ts: PROVIDERS derives URLs from the configured
  opencodego/opencodezen.apiBaseUrl (root-config full-key read, normalized,
  safe fallback); agent variants inherit via providerVariant
- usage/dashboard/state.ts: supply resolveUsageUrl so Go usage sync follows
  the configured base too
- tests: apiRoutesFromBaseUrl coverage (custom + default base)
- docs: issues/110 + CHANGELOG (Unreleased)
@ltmoerdani
ltmoerdani merged commit 5389221 into main Oct 13, 2026
2 checks passed
@ltmoerdani
ltmoerdani deleted the fix/issue247-api-base-url branch October 20, 2026 12:35
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.

[BUG] apiBaseUrl settings appear to be ignored in v0.7.5

1 participant