fix(agents): skip Ollama discovery when explicit models are configured#28827
Conversation
Greptile SummaryThis PR fixes a TypeScript type error in the Ollama provider test that was breaking
Confidence Score: 5/5
Last reviewed commit: 7761a08 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7761a08a99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Status follow-up by @Kansodata:
I can take the next fix pass to move this to green without conflicts. |
nikolasdehor
left a comment
There was a problem hiding this comment.
Correct type fix. Aligns the test typing with ModelDefinitionConfig. Needed for #28793 to pass CI.
|
Addressed in 1a4b1befc. Fix applied:
Validation:
|
1a4b1be to
af9fa90
Compare
af9fa90 to
a5da297
Compare
ec70987 to
9cf7d68
Compare
7c7c171 to
ce09115
Compare
|
@Kansodata stop touching the PR im finalizing to merge |
(cherry picked from commit be8a5b9)
(cherry picked from commit be8a5b9)
Summary
models.providers.ollama.modelsis explicitly configured.apiKeyvalues (config-defined) in both skip-discovery and discovery paths when env/profile keys are not present.apiKeyintact.Why
Current
mainstill callsbuildOllamaProvider -> discoverOllamaModelsduring implicit provider resolution even when explicit Ollama models are already configured. That can add avoidable startup delay/timeouts for remote Ollama hosts.Changes
src/agents/models-config.providers.tsmodels.providers.ollama.models.apiKeywhen env/profile key is not available.src/agents/models-config.providers.ollama.test.tsapiKeyis preserved when skip-discovery is used.Validation
pnpm vitest run src/agents/models-config.providers.ollama-autodiscovery.test.ts src/agents/models-config.providers.ollama.test.tspnpm checkCredit
Related