Repository navigation
fix(config): honor provider model and timeout defaults - #194
Conversation
Signed-off-by: jipeng6036-del <[email protected]>
Signed-off-by: jipeng6036-del <[email protected]>
Reviewer's GuideFixes provider initialization by using the configuration keys that provider implementations actually consume, preserving the intended model and timeout defaults while removing an unused OpenRouter retry option. New tests validate all three default model IDs and Ollama’s extended request timeout without contacting external services. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Summary by QodoFix provider model and timeout defaults
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/core/config/AgentOSConfig.ts" line_range="235" />
<code_context>
- defaultModel: 'openai/gpt-4o-mini',
- maxRetries: 3,
- timeout: 60000,
+ defaultModelId: 'openai/gpt-4o-mini',
+ requestTimeout: 60000,
},
</code_context>
<issue_to_address>
**Calls use unavailable OpenAI**
When openAI is not configured and OpenRouter or Ollama is the available provider, `createAgentOSConfig` leaves the system defaults as OpenAI, and `GMI.getModelAndProviderForLLMCall` chooses those before provider defaults. Calls therefore route to missing OpenAI or select an OpenAI model instead of the configured provider model.
Update the system defaults or model-selection logic so calls use the configured provider and its defaults when OpenAI is unavailable.
Also at `src/core/config/AgentOSConfig.ts:265`.
</issue_to_address>
Code Review by Qodo
1. Model-less gateway calls use costly model
|
| defaultModel: 'openai/gpt-4o-mini', | ||
| maxRetries: 3, | ||
| timeout: 60000, | ||
| defaultModelId: 'openai/gpt-4o-mini', |
There was a problem hiding this comment.
1. Model-less gateway calls use costly model 📎 Requirement gap ≡ Correctness
createModelProviderManagerConfig sets OpenRouter’s defaultModelId to openai/gpt-4o-mini, but resolveModelOption reads the separate runtime registry, where the OpenRouter text default remains openai/gpt-4o. When generateText is called without a model—either with provider: 'openrouter' or with OpenRouter auto-detected—it passes the registry value onward explicitly, bypassing the configured mini default.
Agent Prompt
## Issue description
Model-less public OpenRouter calls resolve to `openai/gpt-4o` through the runtime registry instead of using the configured `openai/gpt-4o-mini` default.
## Fix Focus Areas
- src/core/config/AgentOSConfig.ts[228-236]
- src/api/runtime/provider-defaults.ts[46-49]
- src/api/runtime/provider-defaults.ts[54-57]
- src/api/model.ts[423-438]
## Recommended Fix
Set OpenRouter’s text default in the runtime registry to `openai/gpt-4o-mini` so it matches the provider configuration. Add a model-less `generateText` regression test that verifies the selected model, including provider-only and auto-detected OpenRouter resolution.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Confirmed that these are distinct paths. generateText calls resolveModelOption, and createProviderManager in src/api/model.ts builds a separate single-provider configuration; neither reads this factory's provider entries. The OpenRouter registry text default is also openai/gpt-4o on the base revision a5f0d51. This PR is limited to #113's unrecognized provider configuration keys. It does not change that public API registry or claim that all model-less API calls now select mini.
|
Thanks. Merged as c5860d4. Released in 0.13.10. |
## [0.13.10](v0.13.9...v0.13.10) (2026-10-09) ### fix * **config:** honor provider model and timeout defaults (#194) ([c5860d4](c5860d4)) ### docs * fifth round of audit follow-ups to the guides (#171) ([e64d2d6](e64d2d6)) * **publication:** publish the structured reply guide (#191) ([a5f0d51](a5f0d51)) * the gmi() guide and agent({ runtime: 'gmi' }) (#192) ([e6c6305](e6c6305))
Summary
The configuration factory used
defaultModelandtimeout, which these providers never read. Pass the existing defaults asdefaultModelIdandrequestTimeout, and remove OpenRouter's unused retry setting.Linked issues
Fixes #113
Type of change
How this was verified
Exact baseline/patch verification on Linux, Node 22 and pnpm 10 with locked dependencies and Postgres:
The suite uses the upstream CI argument layout (
vitest run -- --coverage), which does not enable coverage; explicit coverage stops on both revisions because the locked dependencies lack@vitest/coverage-v8. Windows installation also stops at the nativebetter-sqlite3build without Visual Studio C++ tools. No coverage or Windows test pass is claimed.Migration notes
None.
Checklist
Summary by Sourcery
Correct provider configuration defaults so model selection and request timeouts are applied as intended.
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit