feat: per-model timeout, permissions, fallback, and wildcard glob support#22055
feat: per-model timeout, permissions, fallback, and wildcard glob support#22055tobias-weiss-ai-xr wants to merge 1 commit intoanomalyco:devfrom
Conversation
…port - Add per-model timeout field on Config.Model and Provider.Model, used in bash tool execution - Add per-model permission overrides merged with priority: model > agent > global - Add fallback model mechanism with retry logic on 429/5xx/timeout errors - Replace manual regex wildcard matching with minimatch for proper glob support
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, here are the potentially related PRs: Related Open/Merged PRs:
These PRs appear to address similar or overlapping functionality with PR #22055. You may want to review them to ensure there's no duplication of effort, especially regarding fallback model handling and wildcard matching implementations. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
timeoutfield onConfig.ModelandProvider.Model, allowing each model to have its own execution timeout. Used by the bash tool to enforce model-specific limits.permissionfield onConfig.Modelwith a three-tier merge priority: model-level > agent-level > global. This allows fine-grained control over which models can access which tools/permissions.fallbackfield onConfig.Modelthat specifies an alternate model to retry on when the primary model fails with 429 (rate limit), 5xx (server error), or timeout errors. Implemented in the LLM session layer.wildcard.tswith theminimatchlibrary, providing proper glob pattern support.Files changed
packages/opencode/src/config/config.ts- Added timeout, permission, and fallback fields to Config.Modelpackages/opencode/src/provider/provider.ts- Propagated new fields to Provider.Modelpackages/opencode/src/session/llm.ts- Implemented fallback model retry logic on 429/5xx/timeoutpackages/opencode/src/session/prompt.ts- Merged per-model permissions with priority chainpackages/opencode/src/tool/bash.ts- Used per-model timeout for bash command executionpackages/opencode/src/util/wildcard.ts- Replaced manual regex with minimatch for glob matching