From e0e9bd7d5f2ae9bfa47dae0b82040c57207c9b24 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 00:23:20 -0500 Subject: [PATCH] fix(tui): show encrypted reasoning status (#43578) Co-authored-by: Aiden Co-authored-by: Aiden Cline --- packages/tui/src/routes/session/index.tsx | 33 +++++++++-------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index 61abe4abd8d..5112fd6ced5 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -1595,6 +1595,7 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass // OpenRouter encrypts some reasoning blocks; drop the placeholder. return props.part.text.replace("[REDACTED]", "").trim() }) + const opaque = createMemo(() => !content() && Boolean(props.part.metadata)) // Reasoning is finalized when the server sets `time.end` (see processor.ts). // Flips independently of the parent message completing. const isDone = createMemo(() => props.part.time.end !== undefined) @@ -1607,12 +1608,12 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass const syntax = createSyntaxStyleMemo(() => generateSubtleSyntax(theme)) const toggle = () => { - if (!inMinimal()) return + if (!inMinimal() || opaque()) return setExpanded((prev) => !prev) } return ( - + alwaysSeparate.add(el)} paddingLeft={3} @@ -1622,14 +1623,15 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass > - + props.open ? RGBA.fromValues(theme.warning.r, theme.warning.g, theme.warning.b, theme.thinkingOpacity) : theme.warning + const completed = () => { + if (props.encrypted) return `Thought (encrypted)${props.duration ? ` · ${props.duration}` : ""}` + const detail = [props.title, props.duration].filter(Boolean).join(" · ") + return `${props.toggleable ? (props.open ? "- " : "+ ") : ""}Thought${detail ? `: ${detail}` : ""}` + } return ( @@ -1669,22 +1677,7 @@ function ReasoningHeader(props: { - - {props.open ? "- " : "+ "} - - Thought - - : - - - {props.title} - - - - {props.title ? " · " : ""} - {props.duration} - - + {completed()}