Repository navigation
fix(providers): honor the apiBaseUrl settings across every request path (fixes #247) - #257
Merged
Merged
Conversation
…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)
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
Re-wires the
opencodego.apiBaseUrl/opencodezen.apiBaseUrlfeature dropped by later structural refactors. Fixes #247.Root cause
PR #149 fully implemented configurable base URLs (
configuredApiBaseUrl()/configuredGoUsageUrl()inextension.ts+ tests). Later refactors (8b1176fextractprovider/definitions.ts,e8fb6b2/2a3589dextract the provider class) reverted the definitions to hardcodedopencode.aiURLs and removed the wiring — leaving orphaned helpers inconfig.tsand aresolveUsageUrltracker hook that no caller supplied. Reported exactly as observed in #247.Fix
config.ts: new pureapiRoutesFromBaseUrl()deriving all routes (models,chat/completions,messages,responses,usage) from one base URLprovider/definitions.ts:PROVIDERSderives URLs from the configured setting (root-config full-key read, normalized vianormalizeApiBaseUrl, safe fallback on malformed values); agent variants inherit viaproviderVariant, so chat transports, model discovery, connection test, and inline completions are covered by constructionusage/dashboard/state.ts: suppliesresolveUsageUrlso Go server-usage sync follows the configured base tooVerification
npm run compilecleanapiRoutesFromBaseUrlcoverage)npm run lint: all 7 checks pass (strict gate, no suppressions)Docs
docs/issues/110-20261013-issue247-api-base-url-ignored.md[0.7.9] — unreleasedMerging with a merge commit (no squash).