[Bug]: reasoningEffort silently dropped for any unrecognized/self-hosted openai-compatible model (no runtime bridge for capabilities.reasoningEfforts)
Prerequisites
- I will write this issue in English (see our Language Policy)
- I have searched existing issues to avoid duplicates
- I am using the latest version of oh-my-openagent
- I have read the documentation or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer
Bug Description
For any model that is not covered by HEURISTIC_MODEL_FAMILY_REGISTRY and has no entry in MODEL_ID_OVERRIDES / getProviderOverride (i.e. any self-hosted, private, or otherwise unrecognized @ai-sdk/openai-compatible model — a local llama.cpp-style server, a custom inference runtime, an internal gateway, etc.), output.options.reasoningEffort is unconditionally deleted by the chat.params hook, even when the model correctly declares a matching variants block in opencode.json and the user explicitly requests one of those variants via --variant / agent reasoningEffort.
This reproduces on the current beta (5.0.1) and is not specific to one model family — it is a structural asymmetry in getModelCapabilities():
// packages/model-core/src/model-capabilities/get-model-capabilities.ts
variants: runtimeVariants ?? providerOverride?.variants ?? override?.variants ?? heuristicFamily?.variants,
reasoningEfforts: providerOverride?.reasoningEfforts ?? override?.reasoningEfforts ?? heuristicFamily?.reasoningEfforts,variants has a live-config reader (runtimeVariants, via readRuntimeModelVariants(runtimeModel)), which picks up the model's own variants: {...} object from the resolved opencode provider config. reasoningEfforts has no equivalent runtime reader — it can only ever come from a hardcoded override (MODEL_ID_OVERRIDES = {}, empty by default), a hardcoded provider override (getProviderOverride, gated to providerID === "github-copilot" only), or a name-based heuristic family match.
Because of this, resolveField() (packages/model-core/src/model-settings-compatibility.ts) always falls through to its last branch for an unrecognized model:
if (familyKnown) return { value: undefined, reason: "unsupported-by-model-family" };
return { value: undefined, reason: "unknown-model-family" };Back in createChatParamsHandler (packages/omo-opencode/src/plugin/chat-params.ts), compatibility.reasoningEffort === undefined triggers:
} else if ("reasoningEffort" in output.options) {
delete output.options.reasoningEffort;
}...deleting a field that OpenCode core had already correctly populated from the model's own variants.<name>.reasoningEffort config, purely because OMO's capability model has never heard of this model. This is the general case of the bug pattern in #4185 / #8400 (missing heuristic-family entry) and the inverse of #8422 (variant known but never bridged to options.reasoningEffort) — but unlike those, no heuristic-family entry can ever fix this, because the affected models are not public/known models at all. Any self-hosted @ai-sdk/openai-compatible server is permanently affected regardless of how correctly it's configured.
Steps to Reproduce
- Run any custom/self-hosted OpenAI-compatible inference server (any backend works — the server only needs to accept/log
reasoning_effortin the request body). - Configure it in
opencode.json:{ "provider": { "my-local": { "npm": "@ai-sdk/openai-compatible", "name": "My Local Server", "options": { "baseURL": "http://127.0.0.1:11435/v1", "apiKey": "local" }, "models": { "my-custom-model": { "name": "My Custom Model", "limit": { "context": 262144, "output": 16384 }, "variants": { "low": { "reasoningEffort": "low" }, "medium": { "reasoningEffort": "medium" }, "xhigh": { "reasoningEffort": "xhigh" } } } } } }, "plugin": ["oh-my-openagent@beta"] } - Capture the outbound HTTP request (proxy, or server-side request logging) and compare:
opencode run --pure -m my-local/my-custom-model --variant xhigh "..." # baseline, no plugins opencode run -m my-local/my-custom-model --variant xhigh "..." # omo loaded
Expected Behavior
Both invocations send reasoning_effort: "xhigh" in the outbound request body — the model declares xhigh as a valid variant in its own config, so OMO should trust that even without a heuristic family match.
Actual Behavior
opencode run --pure ...: request body containsreasoning_effort: "xhigh". Server-side log:thinking xhigh.opencode run ...(OMO loaded, unmodified.omo/omo.jsonc, nothing referencing this model in OMO's own config at all): request body has noreasoning_effort, noreasoningEffort, noproviderOptionskey whatsoever. Server-side log:thinking medium(server default) for every requested variant (low/medium/xhighall collapse to the same effective effort).
Live capture against a local NInfer (llama.cpp-family) server, provider bonsai-ninfer, model bonsai2-27b-heretic, all three variants declared exactly as above:
{"reasoning_effort": "<absent>", "reasoningEffort_camel": "<absent>", "enable_thinking": "<absent>", "providerOptions": "<absent>", "tools_n": 92, "tool_choice": "auto", "top_level_keys": ["max_tokens","messages","model","stream","stream_options","tool_choice","tools"]}Server log for the same three calls (--variant low|medium|xhigh, OMO loaded):
thinking medium
thinking medium
thinking mediumSame three calls with --pure:
thinking low
thinking medium
thinking xhighBisection performed (isolated $HOME, no other plugins/MCP, config identical otherwise): the only variable that flips the outcome is whether oh-my-openagent is loaded at all — .omo/omo.jsonc was empty of any reference to this provider/model in every run.
Doctor Output
oMoMoMoMo Doctor
✓ System OK · Edition: OpenCode · Installed: beta · Latest: 5.0.1
Update: bunx oh-my-openagent installError Logs
See wire-capture JSON and server log excerpts above (Actual Behavior section).
Configuration
{
"provider": {
"bonsai-ninfer": {
"npm": "@ai-sdk/openai-compatible",
"name": "Bonsai Heretic NInfer",
"options": { "baseURL": "http://127.0.0.1:11435/v1", "apiKey": "local" },
"models": {
"bonsai2-27b-heretic": {
"name": "Bonsai 2 27B Heretic NInfer/DFlash2",
"limit": { "context": 262144, "output": 16384 },
"variants": {
"low": { "reasoningEffort": "low" },
"medium": { "reasoningEffort": "medium" },
"xhigh": { "reasoningEffort": "xhigh" }
}
}
}
}
},
"plugin": ["oh-my-openagent@beta"]
}.omo/omo.jsonc at the time of the bisection contained no agents/categories/models entries referencing bonsai-ninfer or bonsai2-27b-heretic at all — the field loss happens purely inside the generic chat.params hook, independent of any OMO-side config.
Additional Context
Suggested minimal fix, mirroring what already exists for variants (tested locally, restores correct low/medium/xhigh delivery on 5.0.1 with the plugin fully active — no --pure needed, all 92 tools still available):
--- a/packages/model-core/src/model-capabilities/get-model-capabilities.ts
+++ b/packages/model-core/src/model-capabilities/get-model-capabilities.ts
@@
- reasoningEfforts: providerOverride?.reasoningEfforts ?? override?.reasoningEfforts ?? heuristicFamily?.reasoningEfforts,
+ reasoningEfforts: providerOverride?.reasoningEfforts ?? override?.reasoningEfforts ?? heuristicFamily?.reasoningEfforts ?? runtimeVariants,Rationale: when nothing else knows this model's supported reasoning-effort tiers, but the model's own variants block is readable at runtime (already true for the variants field resolution above), it's a reasonable default that the variant names are the reasoning-effort tiers — which is the common case for a variants: { low: {reasoningEffort: "low"}, ... }-style config. This only engages when providerOverride, override, and heuristicFamily are all absent, so it can't regress any currently-known model family.
A more conservative alternative, if the maintainers would rather not conflate variants and reasoningEfforts: change resolveField()'s final fallback so an unrecognized model (reason: "unknown-model-family") passes the requested value through unchanged instead of clearing it — i.e. "unknown" defaults to "trust the caller", not "assume unsupported". That would fix this class of bug for reasoningEffort, variant, temperature, etc. in one place, for any model OMO has never heard of, without needing a registry entry per provider going forward.
Related: #4185, #8400 (same code path, but for models with a known-but-incomplete heuristic family), #8422 (a different bridging gap in the same handler, opposite direction: variant known but never mirrored into options.reasoningEffort).
Operating System
Linux
OpenCode Version
1.18.33
Source: code-yeongyu/oh-my-openagent