Skip to content

Commit b0c12ca

Browse files
ariane-emoryactions-useropencode-agent[bot]rekram1-node
authored andcommitted
feat: persist thinking blocks display to KV and indicate its current display state in the command_list (resolves sst#4582) (sst#4810)
Co-authored-by: GitHub Action <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
1 parent 3301568 commit b0c12ca

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export function Autocomplete(props: {
244244
},
245245
{
246246
display: "/thinking",
247-
description: "toggle thinking blocks",
247+
description: "toggle thinking visibility",
248248
onSelect: () => command.trigger("session.toggle.thinking"),
249249
},
250250
)

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function Session() {
121121
const dimensions = useTerminalDimensions()
122122
const [sidebar, setSidebar] = createSignal<"show" | "hide" | "auto">(kv.get("sidebar", "auto"))
123123
const [conceal, setConceal] = createSignal(true)
124-
const [showThinking, setShowThinking] = createSignal(true)
124+
const [showThinking, setShowThinking] = createSignal(kv.get("thinking_visibility", true))
125125
const [showTimestamps, setShowTimestamps] = createSignal(kv.get("timestamps", "hide") === "show")
126126
const [showTokens, setShowTokens] = createSignal(kv.get("tokens", "hide") === "show")
127127

@@ -439,11 +439,15 @@ export function Session() {
439439
},
440440
},
441441
{
442-
title: "Toggle thinking blocks",
442+
title: showThinking() ? "Hide thinking" : "Show thinking",
443443
value: "session.toggle.thinking",
444444
category: "Session",
445445
onSelect: (dialog) => {
446-
setShowThinking((prev) => !prev)
446+
setShowThinking((prev) => {
447+
const next = !prev
448+
kv.set("thinking_visibility", next)
449+
return next
450+
})
447451
dialog.clear()
448452
},
449453
},

0 commit comments

Comments
 (0)