Skip to content

feat(opencode): per-model timeout, permissions, and wildcard glob config#22185

Closed
tobias-weiss-ai-xr wants to merge 1 commit intoanomalyco:devfrom
tobias-weiss-ai-xr:feat/per-model-timeout-clean
Closed

feat(opencode): per-model timeout, permissions, and wildcard glob config#22185
tobias-weiss-ai-xr wants to merge 1 commit intoanomalyco:devfrom
tobias-weiss-ai-xr:feat/per-model-timeout-clean

Conversation

@tobias-weiss-ai-xr
Copy link
Copy Markdown

@tobias-weiss-ai-xr tobias-weiss-ai-xr commented Apr 12, 2026

Closes #22211

What

Tool execution uses a single global timeout. Slow models need longer, fast models waste time waiting. No per-model tool restrictions exist.

How

  • Per-model timeout config in opencode.json with fallback chain (explicit → model → global)
  • Per-model permission controls for tool access
  • Wildcard glob support in model ID matching (glm-* matches all GLM models)

Verification

  • 19 packages typecheck clean
  • Tested with different model timeout configs

…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
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #13189: feat: add model fallback support with TTFT-based timeout
#13189

This PR appears related because it also addresses model-specific timeout configuration with a fallback mechanism (TTFT-based timeout). While it may be from an earlier implementation or different approach, it overlaps with the timeout and fallback features in the current PR #22185.

No other clear duplicates were found. The other results address different aspects like bash tool execution, permissions, or unrelated features.

@tobias-weiss-ai-xr tobias-weiss-ai-xr changed the title feat: per-model timeout, permissions, fallback, and wildcard glob support feat(opencode): per-model timeout, permissions, and wildcard glob config Apr 12, 2026
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 13, 2026
@github-actions github-actions bot closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: per-model timeout, permissions, and wildcard glob config

1 participant