Support for reasoning_effort parameter in UI #329

Closed
opened 2026-02-16 17:26:15 -05:00 by yindo · 10 comments
Owner

Originally created by @unkn0wncode on GitHub (Jun 27, 2025).

Originally assigned to: @thdxr on GitHub.

I couldn't find references of reasoning effort in the code at the moment, but multiple models support it, including OpenAI models, Gemini, Deepseek, and more.
Would be ideal to have it implemented in UI for supported models, similar to how /models command works.

Originally created by @unkn0wncode on GitHub (Jun 27, 2025). Originally assigned to: @thdxr on GitHub. I couldn't find references of reasoning effort in the code at the moment, but multiple models support it, including OpenAI models, Gemini, Deepseek, and more. Would be ideal to have it implemented in UI for supported models, similar to how /models command works.
yindo closed this issue 2026-02-16 17:26:15 -05:00
Author
Owner

@johnpyp commented on GitHub (Jun 30, 2025):

In a similar vein, supporting things like ultrathink from claude code would be great to dynamically increase the reasoning effort.

Might need some tuning thresholds for specific popular models, and perhaps just a % of the limit for other models which don't have their own hardcoded.

Since claude has 32k as the max thinking, a good starting place could be mirroring it with:

HIGHEST - 100% thinking budget
MIDDLE - 31.25% thinking budget
BASIC - 12.5% thinking budget
DEFAULT - 0% of course

Reference for claude code's thinking token thresholds and keywords:

HIGHEST (token: 31,999)

    "think harder"

    "think intensely"

    "think longer"

    "think really hard"

    "think super hard"

    "think very hard"

    "ultrathink"

MIDDLE (token: 10,000)

    "think about it"

    "think a lot"

    "think deeply"

    "think hard"

    "think more"

    "megathink"

BASIC (token: 4,000)

    "think"

NONE (token: 0)

    (empty)
@johnpyp commented on GitHub (Jun 30, 2025): In a similar vein, supporting things like `ultrathink` from claude code would be great to dynamically increase the reasoning effort. Might need some tuning thresholds for specific popular models, and perhaps just a % of the limit for other models which don't have their own hardcoded. Since claude has 32k as the max thinking, a good starting place could be mirroring it with: ``` HIGHEST - 100% thinking budget MIDDLE - 31.25% thinking budget BASIC - 12.5% thinking budget DEFAULT - 0% of course ``` Reference for claude code's thinking token thresholds and keywords: ``` HIGHEST (token: 31,999) "think harder" "think intensely" "think longer" "think really hard" "think super hard" "think very hard" "ultrathink" MIDDLE (token: 10,000) "think about it" "think a lot" "think deeply" "think hard" "think more" "megathink" BASIC (token: 4,000) "think" NONE (token: 0) (empty) ```
Author
Owner

@pascalandy commented on GitHub (Jul 12, 2025):

Need a flag

I'm also looking for such a flag. Here is an example for llm by Simon Willison

llm -m openai/o3 "ping"

llm -m openai/o3 -o reasoning_effort high "ping"

Why I want this

from Aider leaderboard

Image

Think about the gap between 65% (Sonnet 4, ultrathink) and 84% (o3-high) 🧠

from Codex

Also, here is PR in Codex - https://github.com/openai/codex/pull/314

@pascalandy commented on GitHub (Jul 12, 2025): ## Need a flag I'm also looking for such a flag. Here is an example for `llm` by Simon Willison ````shell llm -m openai/o3 "ping" llm -m openai/o3 -o reasoning_effort high "ping" ```` ## Why I want this from Aider leaderboard ![Image](https://github.com/user-attachments/assets/46e1d52b-8a52-4fa4-aee3-788a44eede5a) Think about the gap between 65% (Sonnet 4, ultrathink) and 84% (o3-high) 🧠 ## from Codex Also, here is PR in Codex - https://github.com/openai/codex/pull/314
Author
Owner

@asafyish commented on GitHub (Aug 11, 2025):

Can be considered fixed since https://github.com/sst/opencode/commit/d8dc23bde9dfe5d7cba911253e51fa258d11b4b9 ?

@asafyish commented on GitHub (Aug 11, 2025): Can be considered fixed since https://github.com/sst/opencode/commit/d8dc23bde9dfe5d7cba911253e51fa258d11b4b9 ?
Author
Owner

@jamesponddotco commented on GitHub (Aug 15, 2025):

Not sure that works:

"provider": {
    "openai": {
      "models": {
        "gpt-5": {
          "options": {
            "reasoningEffort": "high"
          }
        }
      }
    },
    "anthropic": {
      "models": {
        "claude-sonnet-4-20250514": {
          "options": {
            "thinking": {
              "type": "enabled",
              "budget_tokens": 32000
            }
           }
        }
      }
    }
  },

When using Claude Sonnet I now get:

AI_UnsupportedFunctionalityError: 'thinking requires a budget' functionality not supported.

The error goes away if I remove the options. Maybe I'm passing them wrong?

EDIT: Nevermind, just change budget_tokens to budgetTokens. That's what the ai package used by opencode expects.

@jamesponddotco commented on GitHub (Aug 15, 2025): Not sure that works: ```json "provider": { "openai": { "models": { "gpt-5": { "options": { "reasoningEffort": "high" } } } }, "anthropic": { "models": { "claude-sonnet-4-20250514": { "options": { "thinking": { "type": "enabled", "budget_tokens": 32000 } } } } } }, ``` When using Claude Sonnet I now get: ``` AI_UnsupportedFunctionalityError: 'thinking requires a budget' functionality not supported. ``` The error goes away if I remove the options. Maybe I'm passing them wrong? **EDIT:** Nevermind, just change `budget_tokens` to `budgetTokens`. [That's what the `ai` package used by opencode expects.](https://github.com/vercel/ai/blob/a84b07a13817c82e7946675b0cd43edbe4f5f648/packages/anthropic/src/anthropic-messages-options.ts#L61)
Author
Owner

@asafyish commented on GitHub (Aug 16, 2025):

This is the config I use and it's verified working in openai dashboard logs:

{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
        "openai": {
            "models": {
                "gpt-5": {
                    "options": {
                        "reasoningSummary": "auto",
                        "include": [
                            "reasoning.encrypted_content"
                        ]
                    }
                }
            }
        }
    },
    "agent": {
        "gpt-5-max": {
            "model": "openai/gpt-5",
            "description": "Agent that uses high reasoning effort for complex problems",
            "reasoningEffort": "high",
            "textVerbosity": "low"
        }
    }
}

I think this issue can be closed since there at least 2 possible ways to enable high reasoningEffort.

@asafyish commented on GitHub (Aug 16, 2025): This is the config I use and it's verified working in openai dashboard logs: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "openai": { "models": { "gpt-5": { "options": { "reasoningSummary": "auto", "include": [ "reasoning.encrypted_content" ] } } } } }, "agent": { "gpt-5-max": { "model": "openai/gpt-5", "description": "Agent that uses high reasoning effort for complex problems", "reasoningEffort": "high", "textVerbosity": "low" } } } ``` I think this issue can be closed since there at least 2 possible ways to enable high reasoningEffort.
Author
Owner

@carterworks commented on GitHub (Aug 21, 2025):

I think this issue can be closed since there at least 2 possible ways to enable high reasoningEffort.

I believe the core of this issue is different. You've describe ways to persistently enable a thinking budget ("always use high reasoning effort") but this issue is asking for a way to set it dynamically ("use high reasoning effort just for this next request"). Claude Code does it through env variables (MAX_THINKING_TOKENS) and through message keywords ("ultrathink").
There isn't currently a way to set reasoning effort for a single request, like there is in Claude Code.

@carterworks commented on GitHub (Aug 21, 2025): > I think this issue can be closed since there at least 2 possible ways to enable high reasoningEffort. I believe the core of this issue is different. You've describe ways to persistently enable a thinking budget ("always use high reasoning effort") but this issue is asking for a way to set it dynamically ("use high reasoning effort just for this next request"). Claude Code does it through env variables (`MAX_THINKING_TOKENS`) and through message keywords (["ultrathink"](https://simonwillison.net/2025/Apr/19/claude-code-best-practices/)). There isn't currently a way to set reasoning effort for a single request, like there is in Claude Code.
Author
Owner

@f5epcim commented on GitHub (Aug 22, 2025):

I would like to mention this problem, related to private endpoint, where reasoningEffort is rejected and is epxected reasoning_effort. https://github.com/sst/opencode/issues/1859#issuecomment-3214600013

@f5epcim commented on GitHub (Aug 22, 2025): I would like to mention this problem, related to private endpoint, where reasoningEffort is rejected and is epxected reasoning_effort. https://github.com/sst/opencode/issues/1859#issuecomment-3214600013
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@jackfruitsandwich commented on GitHub (Jan 22, 2026):

no reasoning effort control is the only reason I don't use opencode. gpt-5.2-xhigh is my main model and there is no way to use it with my codex subscription through opencode

@jackfruitsandwich commented on GitHub (Jan 22, 2026): no reasoning effort control is the **only** reason I don't use opencode. gpt-5.2-xhigh is my main model and there is no way to use it with my codex subscription through opencode
Author
Owner

@pascalandy commented on GitHub (Jan 22, 2026):

I open sourced my config.
I spent a lot of time configuring my open code setup. up. I'm still not sure it's perfect but it works good at this point.

The trick here is to be aware that there's a big difference between the provider and the agents.

providers:
https://github.com/pascalandy/dotfiles/blob/main/dot_config/opencode/opencode.json.tmpl

agents:
https://github.com/pascalandy/dotfiles/blob/main/dot_config/opencode/config.json

@pascalandy commented on GitHub (Jan 22, 2026): I open sourced my config. I spent a lot of time configuring my open code setup. up. I'm still not sure it's perfect but it works good at this point. The trick here is to be aware that there's a big difference between the provider and the agents. providers: https://github.com/pascalandy/dotfiles/blob/main/dot_config/opencode/opencode.json.tmpl agents: https://github.com/pascalandy/dotfiles/blob/main/dot_config/opencode/config.json
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#329