fix: preserve runtime provider transport overrides for built-in providers#330
Merged
jalehman merged 4 commits intoApr 9, 2026
Conversation
Remove the duplicate auth-handling tests left behind by the rebase conflict resolution so the summarize test file reflects one coherent post-review coverage set. Regeneration-Prompt: |\n Rebased PR 330 onto origin/main, then addressed review findings without changing the intended provider override feature. Preserve the fix that lets runtime provider config override built-in transport defaults, but keep custom OpenAI-compatible provider aliases eligible for the existing direct-credential retry when runtime.modelAuth returns a model.request scope failure. Also avoid tagging arbitrary provider/runtime exceptions as provider_config errors; only the explicit unresolved API-family case should surface that kind. After resolving the rebase conflict in test/summarize.test.ts, remove any duplicate tests introduced by conflict resolution and keep focused regression coverage for runtime-managed providers, custom-provider auth retries, and non-config provider failures. Include a patch changeset for the user-visible bug fix.
a60279e to
3a41a78
Compare
Keep the SecretRef auth-profile tests focused on credential resolution by feeding the test harness the same runtime config object through api.runtime.config.loadConfig(), and by defaulting the synthetic provider to an explicit API family. This matches the new custom-provider guard added in the PR without weakening the guard itself. Regeneration-Prompt: |\n PR 330 now requires custom providers to have an explicit API family instead of silently defaulting to OpenAI. The SecretRef auth-profile tests use a synthetic provider and were failing before completeSimple because their harness only set api.config and never surfaced models.providers.<provider>.api through runtime.config.loadConfig(). Update that test harness so it passes the same config object through runtime loadConfig and injects a test-only default API family for the synthetic provider, keeping the tests focused on env/file SecretRef credential resolution rather than provider API resolution.
Contributor
|
Thank you! |
Merged
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
models.providers.<id>transport fields override built-inpi-aimodel defaults for matching provider idsbaseUrl,api, and merged headers even when the provider id is a built-in one likeopenaiopenaiprovider overridden to a custom proxy URLWhy
Lossless-claw was already resolving provider-level config for custom providers, but the known-model path only filled
baseUrland headers when the built-in model lacked them. That breaks OpenClaw configs which intentionally override a built-in provider id (for exampleopenai) to point at a proxy/base URL, because the built-inpi-aicatalog model keepshttps://api.openai.com/v1and wins.In practice that makes summarization drift back to the official OpenAI endpoint even when OpenClaw runtime config has a different
models.providers.openai.baseUrl.Testing
npm test -- --run test/index-complete-provider-config.test.ts test/index-complete-model-auth.test.ts