Skip to content

fix(config): make provider baseUrl and models optional for auto-discovery#25118

Closed
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg:fix/issue-22836
Closed

fix(config): make provider baseUrl and models optional for auto-discovery#25118
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg:fix/issue-22836

Conversation

@Glucksberg
Copy link
Contributor

@Glucksberg Glucksberg commented Feb 24, 2026

Summary

  • ModelProviderSchema now accepts providers without baseUrl and models, enabling Ollama (and similar) auto-discovery via just apiKey or env var
  • Previously the schema rejected any provider entry missing these required fields, blocking the documented env-var-only setup path

Fixes #22836

🤖 Generated with Claude Code

Greptile Summary

Made baseUrl and models optional in ModelProviderSchema and ModelProviderConfig to enable auto-discovery workflows (Ollama, vLLM, etc.) where providers can be configured with only an API key or environment variable. Added defensive guard in normalizeGoogleProvider to handle providers without models array.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes correctly make fields optional in both TypeScript types and Zod schemas. The codebase already uses defensive checks (Array.isArray(), optional chaining) when accessing these fields, so no runtime errors will occur. The added guard in normalizeGoogleProvider prevents potential issues when iterating over undefined models.
  • No files require special attention

Last reviewed commit: 0973c08

…very (openclaw#22836)

ModelProviderSchema now accepts providers without baseUrl and models,
enabling Ollama (and similar) auto-discovery via just apiKey or env
var. Previously the schema rejected any provider entry missing these
required fields, blocking the documented env-var-only setup path.
@vincentkoc
Copy link
Member

Thanks for working on this.

I’m closing this as superseded by #29299, which resolves #22836 while keeping provider schema/type contracts stable across the codebase.

Your report and implementation attempt helped pinpoint the exact failure path in openclaw config set for Ollama apiKey. If you still see a gap after the merged fix, comment and we can reopen quickly.

@vincentkoc vincentkoc closed this Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama auto-discovery fails: schema requires baseUrl+models[] but docs describe apiKey-only env var mode

2 participants