diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index ea9539720bd..6c7a1310f9e 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -3360,7 +3360,7 @@ function executeCalls(value: unknown): ExecuteCall[] { export function executeCallSummary(call: ExecuteCall) { const args = primitiveInputSummary(call.input ?? {}).replace(/\s+/g, " ") - return `↳ ${call.tool}${call.status === "error" ? " (failed)" : ""}${args ? ` ${args}` : ""}` + return `${call.tool}${args ? ` ${args}` : ""}` } function ExecuteCallView(props: { call: Accessor }) { @@ -3370,11 +3370,16 @@ function ExecuteCallView(props: { call: Accessor }) { const [hover, setHover] = createSignal(false) const input = createMemo(() => Object.entries(props.call().input ?? {})) const expandable = createMemo(() => input().length > 0) - const title = createMemo(() => `↳ ${props.call().tool}${props.call().status === "error" ? " (failed)" : ""}`) + const expandedColor = createMemo(() => theme.raise(theme.text.subdued)) + const color = createMemo(() => { + if (props.call().status === "error") return theme.text.feedback.error.default + if (hover()) return theme.text.default + return expanded() ? expandedColor() : theme.text.subdued + }) return ( expandable() && setHover(true)} onMouseOut={() => setHover(false)} onMouseUp={() => { @@ -3382,21 +3387,16 @@ function ExecuteCallView(props: { call: Accessor }) { setExpanded((value) => !value) }} > - - {expanded() ? title() : executeCallSummary(props.call())} - + + + {props.call().status === "error" ? "✗" : "›"} + + + {expanded() ? props.call().tool : executeCallSummary(props.call())} + + - + {([key, value]) => ( diff --git a/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx b/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx index e405ec7c7fa..514c19fa645 100644 --- a/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx +++ b/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx @@ -191,13 +191,13 @@ describe("TUI inline tool wrapping", () => { status: "completed", input: { sessionID: "ses_example", notify: true }, }), - ).toBe("↳ session.prompt [sessionID=ses_example, notify=true]") + ).toBe("session.prompt [sessionID=ses_example, notify=true]") expect(executeCallSummary({ tool: "session.get", status: "error", input: { nested: { hidden: true } } })).toBe( - "↳ session.get (failed)", + "session.get", ) expect( executeCallSummary({ tool: "session.prompt", status: "completed", input: { text: "first line\nsecond line" } }), - ).toBe("↳ session.prompt [text=first line second line]") + ).toBe("session.prompt [text=first line second line]") }) test("summarizes generic tool arguments on one line", () => {