Skip to content

Commit cd23db0

Browse files
committed
hide toggle for non reasoning models
1 parent c098709 commit cd23db0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,10 @@ export function Prompt(props: PromptProps) {
589589

590590
// Capture mode before it gets reset
591591
const currentMode = store.mode
592+
const thinking =
593+
local.model.parsed().reasoning && local.effort.current() !== "default"
594+
? { effort: local.effort.current() }
595+
: undefined
592596

593597
if (store.mode === "shell") {
594598
sdk.client.session.shell({
@@ -617,7 +621,7 @@ export function Prompt(props: PromptProps) {
617621
agent: local.agent.current().name,
618622
model: `${selectedModel.providerID}/${selectedModel.modelID}`,
619623
messageID,
620-
thinking: local.effort.current() !== "default" ? { effort: local.effort.current() } : undefined,
624+
thinking,
621625
})
622626
} else {
623627
sdk.client.session.prompt({
@@ -626,7 +630,7 @@ export function Prompt(props: PromptProps) {
626630
messageID,
627631
agent: local.agent.current().name,
628632
model: selectedModel,
629-
thinking: local.effort.current() !== "default" ? { effort: local.effort.current() } : undefined,
633+
thinking,
630634
parts: [
631635
{
632636
id: Identifier.ascending("part"),
@@ -874,6 +878,7 @@ export function Prompt(props: PromptProps) {
874878
}
875879
if (keybind.match("effort_cycle", e)) {
876880
e.preventDefault()
881+
if (!local.model.parsed().reasoning) return
877882
local.effort.cycle()
878883
return
879884
}
@@ -992,7 +997,7 @@ export function Prompt(props: PromptProps) {
992997
{local.model.parsed().model}
993998
</text>
994999
<text fg={theme.textMuted}>{local.model.parsed().provider}</text>
995-
<Show when={local.effort.current() !== "default"}>
1000+
<Show when={local.effort.current() !== "default" && local.model.parsed().reasoning}>
9961001
<text fg={theme.textMuted}>·</text>
9971002
<text>
9981003
<span style={{ fg: theme.warning, bold: true }}>{local.effort.current()}</span>

packages/opencode/src/cli/cmd/tui/context/local.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,15 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
241241
return {
242242
provider: "Connect a provider",
243243
model: "No provider selected",
244+
reasoning: false,
244245
}
245246
}
246247
const provider = sync.data.provider.find((x) => x.id === value.providerID)
247248
const info = provider?.models[value.modelID]
248249
return {
249250
provider: provider?.name ?? value.providerID,
250251
model: info?.name ?? value.modelID,
252+
reasoning: info?.capabilities?.reasoning ?? false,
251253
}
252254
}),
253255
cycle(direction: 1 | -1) {

0 commit comments

Comments
 (0)