Skip to content

feat: add model-specific context limits via modelLimits#360

Closed
tobwen wants to merge 3 commits intoOpencode-DCP:devfrom
tobwen:feature/modelLimits
Closed

feat: add model-specific context limits via modelLimits#360
tobwen wants to merge 3 commits intoOpencode-DCP:devfrom
tobwen:feature/modelLimits

Conversation

@tobwen
Copy link
Contributor

@tobwen tobwen commented Feb 7, 2026

summary

Introduce toolSettings.modelLimits to allow per-model context limits as absolute token values or percentages. Update schema validation, config merging/cloning, and context limit resolution so model-specific values override the global contextLimit when available.

example

{
  "toolSettings": {
    "contextLimit": "60%",
    "modelLimits": {
      "opencode/dax-1": "40%",
      "opencode/zen-3": 120000,
      "ollama/*": "25%",
      "*dcp*": 125000
    }
  }
}

788361

tobwen and others added 3 commits February 7, 2026 01:12
Introduce toolSettings.modelLimits to allow per-model context limits as absolute token values or percentages. Update schema validation, config merging/cloning, and context limit resolution so model-specific values override the global contextLimit when available.

Example:
```json
{
  "toolSettings": {
    "contextLimit": "60%",
    "modelLimits": {
      "opencode/dax-1": "40%",
      "opencode/zen-3": 120000,
      "ollama/*": "25%",
      "*dcp*": 125000
    }
  }
}
```
Add test suite for modelLimits including schema validation, config validation, and wildcard matching. Ensures correct behavior for exact and wildcard patterns, percentage parsing, and edge cases.
@Tarquinen Tarquinen deleted the branch Opencode-DCP:dev February 7, 2026 02:38
@Tarquinen Tarquinen closed this Feb 7, 2026
@tobwen tobwen deleted the feature/modelLimits branch February 7, 2026 15:10
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.

2 participants

Comments