Skip to content

feat: add percentage support for contextLimit configuration#355

Merged
Tarquinen merged 1 commit intoOpencode-DCP:devfrom
tobwen:feature/percentage-context-limit
Feb 6, 2026
Merged

feat: add percentage support for contextLimit configuration#355
Tarquinen merged 1 commit intoOpencode-DCP:devfrom
tobwen:feature/percentage-context-limit

Conversation

@tobwen
Copy link
Contributor

@tobwen tobwen commented Feb 6, 2026

summary

Allow contextLimit to accept percentage strings (e.g. "40%") to specify a percentage of the model's context window instead of fixed values.

Values are rounded and clamped between 0 and 100.

examples

  • "40%" → 40% of model context window
  • "40.7%" → rounded to 41%
  • "-5%" → clamped to 0%
  • "999%" → clamped to 100%

Allow contextLimit to accept percentage strings (e.g. "40%") to specify
a percentage of the model's context window instead of fixed values.

Values are rounded and clamped between 0 and 100.
@Tarquinen Tarquinen changed the base branch from master to dev February 6, 2026 18:50
@Tarquinen Tarquinen merged commit 49d2289 into Opencode-DCP:dev Feb 6, 2026
1 check passed
@Tarquinen
Copy link
Collaborator

Good idea! I'll probably change the default to a % and add it to the readme default config. Thank you for your help!

@tobwen tobwen deleted the feature/percentage-context-limit branch February 6, 2026 22:01
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