tui: show pending toolcall count instead of generic 'Running...' message
This commit is contained in:
@@ -1411,13 +1411,6 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|||||||
// OpenRouter sends encrypted reasoning data that appears as [REDACTED]
|
// OpenRouter sends encrypted reasoning data that appears as [REDACTED]
|
||||||
return props.part.text.replace("[REDACTED]", "").trim()
|
return props.part.text.replace("[REDACTED]", "").trim()
|
||||||
})
|
})
|
||||||
const streaming = createMemo(() => {
|
|
||||||
if (!props.last) return false
|
|
||||||
if (props.part.time.end) return false
|
|
||||||
if (props.message.time.completed) return false
|
|
||||||
if (props.message.error) return false
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
return (
|
return (
|
||||||
<Show when={content() && ctx.showThinking()}>
|
<Show when={content() && ctx.showThinking()}>
|
||||||
<box
|
<box
|
||||||
@@ -1432,7 +1425,7 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|||||||
<code
|
<code
|
||||||
filetype="markdown"
|
filetype="markdown"
|
||||||
drawUnstyledText={false}
|
drawUnstyledText={false}
|
||||||
streaming={streaming()}
|
streaming={true}
|
||||||
syntaxStyle={subtleSyntax()}
|
syntaxStyle={subtleSyntax()}
|
||||||
content={"_Thinking:_ " + content()}
|
content={"_Thinking:_ " + content()}
|
||||||
conceal={ctx.conceal()}
|
conceal={ctx.conceal()}
|
||||||
@@ -1446,13 +1439,6 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|||||||
function TextPart(props: { last: boolean; part: TextPart; message: AssistantMessage }) {
|
function TextPart(props: { last: boolean; part: TextPart; message: AssistantMessage }) {
|
||||||
const ctx = use()
|
const ctx = use()
|
||||||
const { theme, syntax } = useTheme()
|
const { theme, syntax } = useTheme()
|
||||||
const streaming = createMemo(() => {
|
|
||||||
if (!props.last) return false
|
|
||||||
if (props.part.time?.end) return false
|
|
||||||
if (props.message.time.completed) return false
|
|
||||||
if (props.message.error) return false
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
return (
|
return (
|
||||||
<Show when={props.part.text.trim()}>
|
<Show when={props.part.text.trim()}>
|
||||||
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}>
|
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}>
|
||||||
@@ -1460,20 +1446,16 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess
|
|||||||
<Match when={Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
|
<Match when={Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
|
||||||
<markdown
|
<markdown
|
||||||
syntaxStyle={syntax()}
|
syntaxStyle={syntax()}
|
||||||
streaming={streaming()}
|
streaming={true}
|
||||||
content={props.part.text.trim()}
|
content={props.part.text.trim()}
|
||||||
conceal={ctx.conceal()}
|
conceal={ctx.conceal()}
|
||||||
tableOptions={{
|
|
||||||
widthMode: "full",
|
|
||||||
columnFitter: "balanced",
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={!Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
|
<Match when={!Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
|
||||||
<code
|
<code
|
||||||
filetype="markdown"
|
filetype="markdown"
|
||||||
drawUnstyledText={false}
|
drawUnstyledText={false}
|
||||||
streaming={streaming()}
|
streaming={true}
|
||||||
syntaxStyle={syntax()}
|
syntaxStyle={syntax()}
|
||||||
content={props.part.text.trim()}
|
content={props.part.text.trim()}
|
||||||
conceal={ctx.conceal()}
|
conceal={ctx.conceal()}
|
||||||
@@ -1997,8 +1979,8 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
|||||||
|
|
||||||
if (isRunning() && tools().length > 0) {
|
if (isRunning() && tools().length > 0) {
|
||||||
// content[0] += ` · ${tools().length} toolcalls`
|
// content[0] += ` · ${tools().length} toolcalls`
|
||||||
if (current()) content.push(`└ ${Locale.titlecase(current()!.tool)} ${(current()!.state as any).title}`)
|
if (current()) content.push(`⤷ ${Locale.titlecase(current()!.tool)} ${(current()!.state as any).title}`)
|
||||||
else content.push(`└ Running...`)
|
else content.push(`⤷ ${tools().length} toolcalls`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.part.state.status === "completed") {
|
if (props.part.state.status === "completed") {
|
||||||
|
|||||||
Reference in New Issue
Block a user