Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

feat(chat): auto-open the last detailed tool row

vastsa39cde7c0cff8
diff --git a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx
index 47778840d..f7137bd32 100644
--- a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx
+++ b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx
@@ -152,6 +152,8 @@ type ActivityGroupProps = {
embedded?: boolean;
isActive: boolean;
endedAt?: string;
+ /** Last activity chunk of this assistant turn. */
+ isLast?: boolean;
/** Current runtime wait phase, when the group owns the live turn tail. */
runtimeActivity?: AgentActivity;
/** Delegation statuses from the entire assistant turn (cross-activity-part). */
@@ -185,6 +187,7 @@ function activityGroupPropsEqual(
previous.embedded !== next.embedded ||
previous.isActive !== next.isActive ||
previous.endedAt !== next.endedAt ||
+ previous.isLast !== next.isLast ||
previous.runtimeActivity !== next.runtimeActivity ||
previous.items.length !== next.items.length
) {
@@ -211,6 +214,7 @@ export const ActivityGroup = memo(function ActivityGroup({
embedded = false,
isActive,
endedAt,
+ isLast = false,
runtimeActivity,
turnDelegationStatuses,
turnDelegationTimings,
@@ -345,23 +349,33 @@ export const ActivityGroup = memo(function ActivityGroup({
/>
);
}
- return item.kind === "tool" ? (
- <Fragment key={item.message.id}>
- <ToolRow
- message={item.message}
+ const autoOpenLatest =
+ !compact && isLast && itemIndex === items.length - 1;
+ if (item.kind === "tool") {
+ return (
+ <Fragment key={item.message.id}>
+ <ToolRow
+ message={item.message}
+ autoOpen={autoOpenLatest}
+ onUserInteraction={claimDisclosure}
+ {...(item.delegate ? { delegate: item.delegate } : {})}
+ />
+ <ReviewChangeCard message={item.message} />
+ </Fragment>
+ );
+ }
+ if (item.kind === "hostedSearch") {
+ return (
+ <HostedSearchRow
+ key={`hosted-search-${item.message.id}-${item.round.id}`}
+ round={item.round}
+ streaming={isActive && item.message.status === "streaming"}
+ autoOpen={autoOpenLatest}
onUserInteraction={claimDisclosure}
- {...(item.delegate ? { delegate: item.delegate } : {})}
/>
- <ReviewChangeCard message={item.message} />
- </Fragment>
- ) : item.kind === "hostedSearch" ? (
- <HostedSearchRow
- key={`hosted-search-${item.message.id}-${item.round.id}`}
- round={item.round}
- streaming={isActive && item.message.status === "streaming"}
- onUserInteraction={claimDisclosure}
- />
- ) : (
+ );
+ }
+ return (
<ThinkingRow
key={`thinking-${item.message.id}`}
message={item.message}
diff --git a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
index 970e36784..035bbd310 100644
--- a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
+++ b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
@@ -27,6 +27,7 @@ import {
collectDelegationTimings,
} from "../../../lib/subagent-topology";
import {
+ isLastActivityPart,
projectTurnProcess,
resolveThinkingDisplayMode,
shouldGroupTurnProcess,
@@ -331,6 +332,7 @@ export const AssistantTurn = memo(function AssistantTurn({
items={part.items}
endedAt={part.endedAt}
isActive={part === activePart}
+ isLast={isLastActivityPart(entry.parts, part)}
runtimeActivity={part === activePart ? runtimeActivity : undefined}
turnDelegationStatuses={turnDelegationStatuses}
turnDelegationTimings={turnDelegationTimings}
diff --git a/apps/desktop/src/features/chat/transcript/HostedSearchRow.tsx b/apps/desktop/src/features/chat/transcript/HostedSearchRow.tsx
index dcc1793ba..6e0080774 100644
--- a/apps/desktop/src/features/chat/transcript/HostedSearchRow.tsx
+++ b/apps/desktop/src/features/chat/transcript/HostedSearchRow.tsx
@@ -29,15 +29,19 @@ function sourceHost(url: string): string {
export const HostedSearchRow = memo(function HostedSearchRow({
round,
streaming,
+ autoOpen = false,
onUserInteraction,
}: {
round: HostedSearchRound;
streaming: boolean;
+ autoOpen?: boolean;
onUserInteraction?: () => void;
}) {
const { t } = useTranslation();
const detailsId = useId();
- const disclosure = useAutomaticDisclosure(false);
+ const searching = streaming && round.status === "searching";
+ const failed = round.status === "failed";
+ const disclosure = useAutomaticDisclosure(autoOpen && !failed);
const { open, toggle: toggleDisclosure, collapse: collapseDisclosure } = disclosure;
const titleRef = disclosure.titleRef;
const toggleRow = useCallback(() => {
@@ -49,8 +53,6 @@ export const HostedSearchRow = memo(function HostedSearchRow({
collapseDisclosure();
}, [collapseDisclosure, onUserInteraction]);
- const searching = streaming && round.status === "searching";
- const failed = round.status === "failed";
const sources = round.sources ?? [];
// The opened page leads the body list; dedupe against extracted sources.
const links = [
@@ -142,5 +144,6 @@ export const HostedSearchRow = memo(function HostedSearchRow({
}, (previous, next) =>
previous.round === next.round &&
previous.streaming === next.streaming &&
+ previous.autoOpen === next.autoOpen &&
previous.onUserInteraction === next.onUserInteraction,
);
diff --git a/apps/desktop/src/features/chat/transcript/ToolRow.tsx b/apps/desktop/src/features/chat/transcript/ToolRow.tsx
index 3abd04260..2657777d5 100644
--- a/apps/desktop/src/features/chat/transcript/ToolRow.tsx
+++ b/apps/desktop/src/features/chat/transcript/ToolRow.tsx
@@ -80,6 +80,8 @@ type ToolRowProps = {
delegate?: SubagentRun;
/** Card treatment used when several Task calls form a delegation topology. */
variant?: "default" | "topology";
+ /** Open the latest detailed-mode tool unless the user took over. */
+ autoOpen?: boolean;
/** Claims the containing activity group when this row is manually used. */
onUserInteraction?: () => void;
/** Live delegation statuses read from the turn's lifecycle-tool rows. */
@@ -109,6 +111,7 @@ function toolRowPropsEqual(
if (
previous.message !== next.message ||
previous.variant !== next.variant ||
+ previous.autoOpen !== next.autoOpen ||
previous.onUserInteraction !== next.onUserInteraction ||
!subagentRunsEqual(previous.delegate, next.delegate)
) {
@@ -133,6 +136,7 @@ export const ToolRow = memo(function ToolRow({
message,
delegate,
variant = "default",
+ autoOpen = false,
onUserInteraction,
delegationStatuses,
delegationTimings,
@@ -150,9 +154,12 @@ export const ToolRow = memo(function ToolRow({
// (D227). Property reads only, so a streaming row can afford it every tick.
const run = action === "run" ? runOutcome(message) : null;
const failed = status === "error" || run === "failed";
- // Tool details are always user-opened. Failure stays visible in the row head
- // through its status icon/label without expanding the payload automatically.
- const disclosure = useAutomaticDisclosure(false);
+ // Detailed mode opens the last tool of the last activity group. Compact keeps
+ // payloads collapsed so a live burst only updates the header. Failure and
+ // denial stay in the row head without expanding the payload automatically.
+ const disclosure = useAutomaticDisclosure(
+ autoOpen && !failed && status !== "denied",
+ );
const { open, toggle: toggleDisclosure, collapse: collapseDisclosure } = disclosure;
const titleRef = disclosure.titleRef;
const toggleRow = useCallback(() => {
diff --git a/apps/desktop/src/lib/turn-process.ts b/apps/desktop/src/lib/turn-process.ts
index 2121a1084..35da68107 100644
--- a/apps/desktop/src/lib/turn-process.ts
+++ b/apps/desktop/src/lib/turn-process.ts
@@ -59,6 +59,18 @@ export function shouldGroupTurnProcess(mode: ThinkingDisplayMode): boolean {
return mode === "compact";
}
+/** The last activity chunk of a turn owns detailed-mode's default-open tool. */
+export function isLastActivityPart(
+ parts: readonly AssistantTurnPart[],
+ part: AssistantTurnPart,
+): boolean {
+ if (part.kind !== "activity") return false;
+ for (let index = parts.length - 1; index >= 0; index -= 1) {
+ if (parts[index].kind === "activity") return parts[index] === part;
+ }
+ return false;
+}
+
/** Compact process stays collapsed unless an active tool failed. */
export function shouldAutoOpenTurnProcess(
mode: ThinkingDisplayMode,
diff --git a/apps/desktop/test/interaction-performance.test.mjs b/apps/desktop/test/interaction-performance.test.mjs
index eb28053af..a726b785c 100644
--- a/apps/desktop/test/interaction-performance.test.mjs
+++ b/apps/desktop/test/interaction-performance.test.mjs
@@ -94,15 +94,12 @@ test("stream rendering avoids duplicate frame state and coalesces following", ()
});
test("expanded live tool output stays local to the changed row", () => {
- // Running rows remain collapsed until the user asks to inspect output, so a
- // burst of Bash updates does not walk or render the cumulative payload for
- // every row in the activity group.
+ // Only the last detailed-mode tool opens automatically. Collapsed rows skip
+ // the payload walk so a Bash burst does not rerender every sibling.
assert.match(transcript, /const ToolRow = memo\(function ToolRow/);
assert.match(transcript, /function toolRowPropsEqual\(/);
- assert.match(transcript, /if \(previous\.variant !== "topology"\) return true;/);
- // Tool rows remain collapsed during a live burst; only their action/status
- // header updates. The latest thinking row owns the automatic detail view.
- assert.match(transcript, /const disclosure = useAutomaticDisclosure\(false\)/);
+ assert.match(transcript, /if \(previous.variant !== "topology"\) return true;/);
+ assert.match(transcript, /const autoOpenLatest =\s*!compact && isLast && itemIndex === items.length - 1/);
assert.match(
transcript,
/const blocks =\s*variant !== "topology" && open && hasDetails\s*\?\s*buildToolPresentation\(/,
@@ -111,21 +108,21 @@ test("expanded live tool output stays local to the changed row", () => {
test("stream event bursts are coalesced until a paint or terminal event", () => {
assert.match(store, /createFrameBatcher<AgentEventEnvelope>/);
- assert.match(store, /streamUpdates\.enqueue\(/);
- assert.match(store, /streamUpdates\.flushNow\(\)/);
- assert.match(store, /event\.type === "message_update"/);
- assert.match(store, /event\.type === "tool_update"/);
+ assert.match(store, /streamUpdates.enqueue\(/);
+ assert.match(store, /streamUpdates.flushNow\(\)/);
+ assert.match(store, /event.type === "message_update"/);
+ assert.match(store, /event.type === "tool_update"/);
});
test("tool errors stay local to their rows instead of failing the activity group", () => {
- assert.doesNotMatch(toolRow, /const hasFailure = items\.some/);
+ assert.doesNotMatch(toolRow, /const hasFailure = items.some/);
assert.doesNotMatch(toolRow, /processingFailedAfter/);
assert.doesNotMatch(toolRow, /tool-activity-group[\s\S]*?failed/);
- // Failures remain visible in the row header, but their payload stays
- // collapsed until the user opens it.
- assert.match(toolRow, /const disclosure = useAutomaticDisclosure\(false\)/);
- assert.match(`${toolRow}\n${transcriptShared}`, /if \(userInteractedRef\.current\) return/);
- assert.match(toolRow, /status === "error"\s*\? t\("chat\.toolFailed"\)/);
+ // Failures remain visible in the row header; automatic open is last-tool
+ // ownership, not error ownership.
+ assert.match(toolRow, /const disclosure = useAutomaticDisclosure\(\s*autoOpen && !failed && status !== "denied",\s*\)/);
+ assert.match(`${toolRow}\n${transcriptShared}`, /if \(userInteractedRef.current\) return/);
+ assert.match(toolRow, /status === "error"\s*\? t\("chat.toolFailed"\)/);
});
test("manual upward scrolling cancels pending transcript follow work", () => {
diff --git a/apps/desktop/test/thinking-ui.test.mjs b/apps/desktop/test/thinking-ui.test.mjs
index f972c4719..90b918234 100644
--- a/apps/desktop/test/thinking-ui.test.mjs
+++ b/apps/desktop/test/thinking-ui.test.mjs
@@ -231,22 +231,23 @@ test("expanded assistant activity rails collapse their disclosures", () => {
assert.match(stylesSource, /\.disclosure-collapse-rail:focus-visible\s*\{/);
});
-test("live thinking follows the latest step without auto-expanding tool details", () => {
+test("detailed mode opens the last tool while compact keeps payloads collapsed", () => {
assert.match(transcriptSource, /function useAutomaticDisclosure\(automaticOpen: boolean, revealRequest\?: number\)/);
assert.match(transcriptSource, /const userInteractedRef = useRef\(false\)/);
assert.match(transcriptSource, /useLayoutEffect\(\(\) => \{/);
- assert.match(transcriptSource, /if \(userInteractedRef\.current\) return/);
+ assert.match(transcriptSource, /if \(userInteractedRef.current\) return/);
assert.match(transcriptSource, /const \{ open, toggle: toggleDisclosure, collapse: collapseDisclosure \}/);
assert.match(transcriptSource, /useAutomaticDisclosure\(live, revealRequest\)/);
assert.match(
transcriptSource,
- /<ThinkingRow[\s\S]*?autoOpen=\{live && itemIndex === items\.length - 1\}/,
+ /<ThinkingRow[\s\S]*?autoOpen=\{live && itemIndex === items.length - 1\}/,
);
- assert.doesNotMatch(
+ assert.match(
transcriptSource,
- /<ToolRow[\s\S]{0,220}autoOpen=\{live && itemIndex === items\.length - 1\}/,
+ /const autoOpenLatest =\s*!compact && isLast && itemIndex === items.length - 1/,
);
- assert.match(transcriptSource, /const disclosure = useAutomaticDisclosure\(false\)/);
+ assert.match(transcriptSource, /<ToolRow[\s\S]*?autoOpen=\{autoOpenLatest\}/);
+ assert.match(transcriptToolRowSource, /const disclosure = useAutomaticDisclosure\(\s*autoOpen && !failed && status !== "denied",\s*\)/);
assert.match(transcriptSource, /onClick=\{toggleDisclosure\}/);
assert.match(transcriptSource, /onCollapse=\{collapseDisclosure\}/);
assert.match(transcriptSource, /onUserInteraction=\{claimDisclosure\}/);
diff --git a/apps/desktop/test/turn-process.test.mjs b/apps/desktop/test/turn-process.test.mjs
index 27fa5c146..a99676cb4 100644
--- a/apps/desktop/test/turn-process.test.mjs
+++ b/apps/desktop/test/turn-process.test.mjs
@@ -7,6 +7,7 @@ const {
projectTurnProcess,
visibleProcessSteps,
resolveThinkingDisplayMode,
+ isLastActivityPart,
shouldAutoOpenTurnProcess,
shouldGroupTurnProcess,
turnProcessTiming,
@@ -110,6 +111,27 @@ test("only compact groups a turn into a process; compact auto-opens active failu
assert.equal(shouldAutoOpenTurnProcess("compact", false, true), false);
});
+test("the last activity part owns detailed-mode's default-open tool", () => {
+ const entry = turn([
+ message("intro", "assistant", "Inspect", { thinking: "Plan" }),
+ message("read", "tool", "result", { toolName: "Read" }),
+ message("progress", "assistant", "Next"),
+ message("edit", "tool", "updated", { toolName: "Edit" }),
+ message("final", "assistant", "Fixed"),
+ ]);
+ const activities = entry.parts.filter((part) => part.kind === "activity");
+ assert.ok(activities.length >= 2);
+ assert.equal(isLastActivityPart(entry.parts, activities[0]), false);
+ assert.equal(isLastActivityPart(entry.parts, activities.at(-1)), true);
+ assert.equal(
+ isLastActivityPart(
+ entry.parts,
+ entry.parts.find((part) => part.kind === "message"),
+ ),
+ false,
+ );
+});
+
test("history timing uses recorded ends and rejects invalid timestamps and durations", () => {
const entry = turn([
message("read", "tool", "", { toolCompletedAt: "2026-09-17T00:00:02.000Z" }),
diff --git a/docs/adr/turn-process-and-thinking-display.md b/docs/adr/turn-process-and-thinking-display.md
index dff5b8ae1..1d87aa809 100644
--- a/docs/adr/turn-process-and-thinking-display.md
+++ b/docs/adr/turn-process-and-thinking-display.md
@@ -23,14 +23,16 @@ so the renderer does not guess intent from the wording. User/system messages
and compaction dividers retain their existing turn boundaries.
Detailed mode does not wrap a process: thinking, tools and intermediate
-assistant text stay in transcript order beside the answer. Compact mode starts
-completed process areas collapsed. Manual disclosure choices survive
+assistant text stay in transcript order beside the answer. Its last tool-call
+or hosted-search row of the last activity group starts expanded; earlier tool
+details stay collapsed. Compact mode starts completed process areas collapsed
+and keeps individual tool payloads collapsed. Manual disclosure choices survive
streaming and completion. Search navigation opens the containing process.
Tool failures open an unclaimed active process so the invocation error stays
visible even in compact mode; that does not mark the whole turn as failed.
Assistant errors and stopped trailing partial answers stay outside the process.
Tool/delegation detail controls, permission cards, and transcript actions retain
-their existing behavior.
+their existing behavior aside from that detailed last-tool default.
Settings → AI → Defaults includes `thinkingDisplayMode`, an optional
`detailed | compact` AppSettings field. Absent or unrecognized values display
@@ -38,7 +40,8 @@ as detailed. Compact mode renders no reasoning text or excerpt: while a
thinking-only message streams it shows a status indicator, and when reasoning
ends the thinking row disappears. Answer text ends that indicator even while
the assistant message is still streaming. A completed thinking-only process
-leaves no empty header. Tool rows and progress text remain expandable.
+leaves no empty header. Tool rows and progress text remain expandable; detailed
+mode opens the last tool of the last activity group by default.
Changing the setting updates mounted history and nested thinking rows.
The field uses the existing host-owned settings JSON; no database migration or
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index a531dc6cd..0b6974d31 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -809,7 +809,9 @@ containing reasoning, tools and intermediate assistant text in transcript
order. Its trailing answer streams outside the disclosure. Later activity
moves a provisional answer into the process without altering the stored
message. Detailed mode does not wrap that process: the same parts stay in
-place. Assistant errors and trailing aborted partial replies stay visible.
+place. Its last tool-call (or hosted-search) row of the last activity group
+starts expanded; earlier tool details stay collapsed. Compact keeps those
+payloads collapsed. Assistant errors and trailing aborted partial replies stay visible.
Compaction and user/system boundaries are unchanged.
Compact mode starts completed process areas collapsed. Manual choices and
@@ -1952,12 +1954,16 @@ and is intentionally not an elevated card.
Consecutive tool calls form one ChatGPT-style processing group. Historical
groups are collapsed by default. While the turn is active, the latest live
-group opens automatically so the process list is visible. Tool-call details
-remain collapsed by default, including failed tool calls; only the latest
-thinking row opens automatically. When the group or turn settles, automatically
-managed thinking disclosures close so the answer remains the visual focus. A
-user click on a group, row, or collapse rail takes ownership of that disclosure;
-later stream updates and completion never reverse that choice.
+group opens automatically so the process list is visible. In detailed mode,
+the latest tool-call or hosted-search row of the last activity group in a
+turn opens automatically; earlier rows stay collapsed. Compact mode keeps
+tool-call details collapsed by default, including failed tool calls. The
+latest thinking row opens automatically while it streams. When the group or
+turn settles, automatically managed thinking disclosures close so the answer
+remains the visual focus; a detailed last-tool disclosure stays open unless
+a later activity supersedes it. A user click on a group, row, or collapse
+rail takes ownership of that disclosure; later stream updates and completion
+never reverse that choice.
The group header shows `Processing · 12s` while active or `Processed for 12s`
after completion. Expanding it reveals the ordered tool activity rows and their
nested result disclosures. The group
@@ -1987,9 +1993,10 @@ seconds when non-zero) from one hour onward. Zero-value units are omitted, so
transcript after completion. Historical groups remain
collapsed; the latest active group opens automatically and returns to a
collapsed state when it settles unless the user has interacted with it.
-- Tool-call details remain collapsed by default while the group is open. The
- latest thinking row opens automatically while it streams and closes when the
- turn settles unless the user has interacted with it.
+- Tool-call details remain collapsed by default while a compact group is open.
+ In detailed mode the last tool-call or hosted-search row of the last activity
+ group starts expanded. The latest thinking row opens automatically while it
+ streams and closes when the turn settles unless the user has interacted with it.
- The processing group spans the full available assistant column, so expanded
result details keep a usable width even when the header or payload is short.
- The visible label is a natural-language action (`Read`, `Ran`, `Searched`),
@@ -2062,16 +2069,17 @@ twice.
| State | Header treatment | Expanded content |
|---|---|---|
-| Running | Progressive action with readable text and a pulsing marker; a `run` row also shows its spinner and pulses the status dot beside `Working…` | The latest thinking row opens automatically while it streams; tool-call details stay collapsed |
-| Success | Past-tense action + result chips; no green success badge, except a `run` row's dot and `Done` | Result blocks, then arguments if not already shown; automatic thinking disclosures close when the turn settles |
+| Running | Progressive action with readable text and a pulsing marker; a `run` row also shows its spinner and pulses the status dot beside `Working…` | The latest thinking row opens automatically while it streams; detailed mode also opens the last tool of the last activity group; compact tool-call details stay collapsed |
+| Success | Past-tense action + result chips; no green success badge, except a `run` row's dot and `Done` | Result blocks, then arguments if not already shown; automatic thinking disclosures close when the turn settles; detailed last-tool stays open unless superseded |
| Error | Past-tense action + compact danger status; details remain collapsed by default and open only on user request. A `run` row is in this state whenever its command exited non-zero, whatever the call reported (D227) | Error note first, then arguments |
| Denied | Muted `Denied` status | Permission result when available |
### 9.6 Interactions
-- Click the row: expand/collapse the result blocks. Tool-call details are
- collapsed by default while a live group is open; historical and failed rows
- remain collapsed until the user opens them.
+- Click the row: expand/collapse the result blocks. Compact tool-call details
+ stay collapsed by default while a live group is open. Detailed mode opens the
+ last tool-call of the last activity group; earlier and failed rows remain
+ collapsed until the user opens them.
- A file path that a row or its result names is a link, not decoration: clicking
the summary path of a `Read`, `Write`, `Edit`, or `fetch` row, or a path in a
result's file list or match groups, completes the reference through the same
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index 3aff6f448..f6aaa2080 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -807,17 +807,18 @@ may be retained while exactly one workspace supplies the visible shell context.
### 4.2 Collapse indicator
-- Tool activity starts as a lightweight collapsed row; failed calls open
- automatically so the error remains local to its invocation.
+- Tool activity starts as a lightweight collapsed row. Failed calls keep their
+ error in the row header; they do not auto-expand.
- Compact mode gives one assistant turn one process disclosure containing
thinking, tool calls and intermediate progress text. The trailing answer
streams outside it; later activity moves that text into the process. The
header updates elapsed time once per second while active and shows the
visible step count.
-- Detailed mode does not wrap a process. Compact completed process areas
- collapse unless a click, keyboard activation or search reveal has taken
- ownership. Tool details keep
- their individual controls. Failed tool calls open an unclaimed active process so
+- Detailed mode does not wrap a process. Its last tool-call or hosted-search
+ row of the last activity group starts expanded; earlier tool details stay
+ collapsed. Compact completed process areas collapse unless a click, keyboard
+ activation or search reveal has taken ownership. Tool details keep their
+ individual controls. Failed tool calls open an unclaimed active process so
their errors stay visible even in compact mode.
- Compact thinking mode shows only a status indicator while reasoning streams;
when answer text starts or reasoning ends, the thought row disappears. Tools
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index f891bad1b..2f1e1ad62 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -2128,8 +2128,9 @@ identify the platform validation still needed.
expanded row, then keyboard-focus and activate the processing group's
vertical rule. 8) Reload the session and expand the restored group.
- **Expected**: The latest active group opens automatically so the process list
- is visible, but tool-call details, including failed tool details, remain
- collapsed. The latest thinking step
+ is visible. Compact tool-call details, including failed tool details, remain
+ collapsed. In detailed mode the last tool-call of the last activity group
+ starts expanded and earlier rows stay collapsed. The latest thinking step
opens automatically while it streams; older groups and rows remain collapsed.
The header shows its localized processing label, elapsed time, and step count
without an additional status capsule. When the turn settles, the automatic
@@ -13575,8 +13576,9 @@ plugin-form fixtures in an isolated temporary directory at runtime.
intermediate message; switch display modes through Settings → AI → Defaults.
Repeat with a stopped partial answer, an assistant error and a failed tool.
- **Expected:** In detailed mode, thinking, tools and intermediate text stay
- in place with no process wrapper. Compact mode keeps that process collapsed
- until expanded. Manual choices survive updates; search reveals its target; live answer text
+ in place with no process wrapper, and the last tool-call of the last activity
+ group starts expanded. Compact mode keeps that process collapsed
+ until expanded, with tool payloads collapsed. Manual choices survive updates; search reveals its target; live answer text
stays readable. Errors and stopped trailing text stay visible. Compact mode
exposes no reasoning text or excerpt, shows a live indicator, and leaves no
completed thinking-only header. Tools and progress remain accessible. Switching
diff --git a/scripts/e2e/turn-process.tsx b/scripts/e2e/turn-process.tsx
index e68d45330..ede3c9484 100644
--- a/scripts/e2e/turn-process.tsx
+++ b/scripts/e2e/turn-process.tsx
@@ -122,10 +122,28 @@ export async function turnProcessProbe() {
visible(container.querySelector('[data-message-id="progress"]')),
"detailed keeps intermediate progress visible",
);
+ check(
+ container.querySelector('[data-message-id="edit"]')?.classList.contains("open") === true,
+ "detailed opens the last tool",
+ );
+ check(
+ container.querySelector('[data-message-id="read"]')?.classList.contains("open") !== true,
+ "detailed keeps earlier tools collapsed",
+ );
check(
container.querySelectorAll(".tool-row").length === 3,
"detailed shows thinking and both tools in place",
);
+ render(
+ [intro, { ...read, toolStatus: "error", isError: true }, answer],
+ false,
+ null,
+ "failed-last-tool",
+ );
+ check(
+ container.querySelector('[data-message-id="read"]')?.classList.contains("open") !== true,
+ "detailed keeps a last failed tool collapsed",
+ );
const streaming = message("stream", "assistant", "Live text", {
status: "streaming",
@@ -176,6 +194,10 @@ export async function turnProcessProbe() {
header()?.getAttribute("aria-expanded") === "false" && !visible(process()),
"compact completed process starts collapsed",
);
+ check(
+ container.querySelector('[data-message-id="edit"]')?.classList.contains("open") !== true,
+ "compact keeps tool payloads collapsed",
+ );
check(
header()?.textContent?.includes("4 steps"),
"process counts tools and progress once",