OMP-style per-prompt reasoning-effort selection for OpenCode.
The plugin adds an auto variant to reasoning models. When selected, a configurable judge agent classifies each user request as low, medium, high, or xhigh; the corresponding native model variant options are then applied to the request while the session remains on auto.
- OpenCode 1.17 or newer
- A reasoning model with at least two supported effort variants
- A dedicated judge agent using a concrete, non-reasoning variant such as
none
Add the GitHub package to opencode.jsonc:
For local development, clone the repository and re-export the plugin from a project plugin entry:
// .opencode/plugins/auto-effort.ts
export { AutoEffortPlugin } from "/absolute/path/to/opencode-auto-effort/src/index.ts"Define a minimal agent in opencode.jsonc:
{
"agent": {
"auto-judge": {
"description": "Classifies reasoning effort only",
"mode": "subagent",
"model": "openai/gpt-5.6-luna",
"variant": "none",
"steps": 1,
"maxTokens": 1024,
"tools": {
"*": false
}
}
}
}The default plugin settings are:
[
"@ai-trash/opencode-auto-effort",
{
"provider": "openai",
"judgeAgent": "auto-judge",
"judgeVariant": "none",
"levels": ["low", "medium", "high", "xhigh"],
"fallback": "high",
"timeoutMs": 30000
}
]Select auto from OpenCode's variant picker or launch with:
opencode run --model openai/gpt-5.6-sol --variant auto "your request"- Uses OMP's four-level classification prompt and parsing rules.
- Trims judge input to 6,000 characters: 4,000 from the start and 2,000 from the end.
- Runs the judge with tools disabled and a concrete
nonevariant by default. - Intersects classifier levels with the active model's enabled variants.
- Preserves
autoacross turns and process restarts. - Falls back to the active agent/model variant when available, then
high, then the highest supported level. - Copies the complete selected variant options, including provider-specific fields such as
reasoningSummaryandinclude.
OpenCode runs the judge through a temporary agent session rather than OMP's direct provider call. A longer default timeout is therefore necessary during cold startup.
Compatible with Oh My OpenAgent 4.17.1. The plugin runs after agent variant resolution, preserves the session's auto state in metadata, and applies concrete effort options in chat.params without replacing the visible auto variant.
npm install
npm test
npm run typecheckThe difficulty prompt, input-window policy, level parser, and fallback semantics are adapted from Oh My Pi, licensed under the MIT License. See THIRD_PARTY_NOTICES.
AGPL-3.0-only. See LICENSE.
{ "plugin": [ "@ai-trash/opencode-auto-effort" ] }