Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
feat(chat): separate Bash rows and thinking visibility
v_wyxgwang52976b8db07d
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex c8fce3e16..23fd405d2 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -162,6 +162,9 @@ jobs:- name: Run browser capture/resize E2Erun: xvfb-run --auto-servernum sh -c 'openbox >/dev/null 2>&1 & exec node scripts/e2e-browser-capture-resize.mjs'+ - name: Run transcript rendering and disclosure E2E+ run: xvfb-run --auto-servernum sh -c 'node scripts/e2e-transcript-render.mjs && node scripts/e2e-transcript-disclosure-anchor.mjs'+- name: Build host-corerun: cargo build -p host-core --lockeddiff --git a/apps/desktop/src/components/settings/ShowThinkingRow.tsx b/apps/desktop/src/components/settings/ShowThinkingRow.tsxnew file mode 100644index 000000000..126534c79--- /dev/null+++ b/apps/desktop/src/components/settings/ShowThinkingRow.tsx@@ -0,0 +1,28 @@+import { useTranslation } from "react-i18next";+import type { AppSettings } from "@pi-desktop/shared";+import { resolveShowThinking } from "../../lib/thinking-visibility";+import { SettingsRow } from "../../features/settings/primitives";+import { SettingsToggle } from "../ui";++export function ShowThinkingRow({+ settings,+ saveSettings,+}: {+ settings: AppSettings;+ saveSettings: (patch: Partial<AppSettings>) => Promise<void>;+}) {+ const { t } = useTranslation();+ const showThinking = resolveShowThinking(settings);+ return (+ <SettingsRow+ title={t("settings.showThinking")}+ description={t("settings.showThinkingDesc")}+ >+ <SettingsToggle+ checked={showThinking}+ label={t("settings.showThinking")}+ onChange={() => void saveSettings({ showThinking: !showThinking })}+ />+ </SettingsRow>+ );+}diff --git a/apps/desktop/src/components/settings/ThinkingDisplayModeRow.tsx b/apps/desktop/src/components/settings/ThinkingDisplayModeRow.tsxdeleted file mode 100644index 27c3afc76..000000000--- a/apps/desktop/src/components/settings/ThinkingDisplayModeRow.tsx+++ /dev/null@@ -1,32 +0,0 @@-import { useTranslation } from "react-i18next";-import type { AppSettings } from "@pi-desktop/shared";-import { resolveThinkingDisplayMode } from "../../lib/turn-process";-import { SettingsRow } from "../../features/settings/primitives";-import { SegmentedControl } from "../ui";--export function ThinkingDisplayModeRow({- settings,- saveSettings,-}: {- settings: AppSettings;- saveSettings: (patch: Partial<AppSettings>) => Promise<void>;-}) {- const { t } = useTranslation();- const current = resolveThinkingDisplayMode(settings.thinkingDisplayMode);- return (- <SettingsRow- title={t("settings.thinkingDisplayMode")}- description={t("settings.thinkingDisplayModeDesc")}- >- <SegmentedControl- value={current}- onChange={(value) => void saveSettings({ thinkingDisplayMode: resolveThinkingDisplayMode(value) })}- options={[- { value: "detailed", label: t("settings.thinkingDisplayDetailed") },- { value: "compact", label: t("settings.thinkingDisplayCompact") },- ]}- label={t("settings.thinkingDisplayMode")}- />- </SettingsRow>- );-}diff --git a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsxindex 07420e007..338dd06fc 100644--- a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx+++ b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx@@ -54,7 +54,7 @@ import {} from "./shared";import { TranscriptSearchContext } from "../../../lib/transcript-search-context";import { useAppStore } from "../../../stores/app-store";-import { resolveThinkingDisplayMode } from "../../../lib/turn-process";+import { resolveShowThinking } from "../../../lib/thinking-visibility";type Translate = (key: string, options?: Record<string, unknown>) => string;@@ -216,9 +216,8 @@ export const ActivityGroup = memo(function ActivityGroup({turnDelegationStatuses,turnDelegationTimings,}: ActivityGroupProps) {- const compact = useAppStore(- (state) => resolveThinkingDisplayMode(state.settings?.thinkingDisplayMode) === "compact",- );+ const showThinking = useAppStore((state) => resolveShowThinking(state.settings));+ const hideThinking = !showThinking;const { t } = useTranslation();const detailsId = useId();const rawDelegateItems = useMemo(() => items.filter(isDelegationActivityItem), [items]);@@ -253,10 +252,10 @@ export const ActivityGroup = memo(function ActivityGroup({const searchTarget = useContext(TranscriptSearchContext);const revealRequest = useMemo(() => searchTarget && items.some((item) => item.message.id === searchTarget.messageId)? searchTarget.requestId : undefined, [items, searchTarget]);- const visibleItems = useMemo(() => cachedVisibleActivityItems(items, compact, isActive), [items, compact, isActive]);+ const visibleItems = useMemo(() => cachedVisibleActivityItems(items, hideThinking, isActive), [items, hideThinking, isActive]);const first = items[0];const disclosure = useAutomaticDisclosure(- hasSubagentTopology ? live : visibleItems.length <= 1 || (!compact && live),+ hasSubagentTopology ? live : visibleItems.length <= 1 || live,revealRequest,disclosureKey("activity", first?.message.id ?? "", first?.kind ?? "", first?.kind === "hostedSearch" ? first.round.id : ""),);@@ -313,9 +312,9 @@ export const ActivityGroup = memo(function ActivityGroup({? runActivityLabel(runtimeActivity, t as Translate): "";const currentDetail = useMemo(() =>- live && !runtimeStatus && lastItem && !(compact && lastItem.kind === "thinking")+ live && !runtimeStatus && lastItem && !(hideThinking && lastItem.kind === "thinking")? activityItemDetail(lastItem) : "",- [live, runtimeStatus, lastItem, compact]);+ [live, runtimeStatus, lastItem, hideThinking]);const tail = live && !open ? currentDetail : "";useEffect(() => {diff --git a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsxindex 17e138d0f..ccee9888d 100644--- a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx+++ b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx@@ -20,8 +20,8 @@ import {collectDelegationTimings,} from "../../../lib/subagent-topology";import {- resolveThinkingDisplayMode,- shouldGroupTurnProcess,+ segmentTurnProcess,+ type TurnProcessRunSegment,} from "../../../lib/turn-process";import { sessionAllows } from "../../../lib/remote-session-safety";import { useSlotSessionId } from "../../../plugins/renderer-slots/use-slots";@@ -36,6 +36,8 @@ import {import { activityItemsEqual } from "./ActivityGroup";import { GeneratedImages } from "./GeneratedImages";import { MessageRow } from "./MessageRow";+import { ReviewChangeCard } from "../../../components/ReviewChangeCard";+import { ToolRow } from "./ToolRow";import { assistantTurnMenuItems } from "./menu-items";import {useChatTextActions,@@ -233,6 +235,24 @@ export const TranscriptTail = memo(function TranscriptTail({transcriptEntryEqual(previous.entry, next.entry));+/**+ * A `Bash`/run call rendered on its own, outside every process and activity+ * disclosure. It stays visible with all disclosures collapsed, and its own+ * detail stays closed until the user opens it.+ */+const StandaloneRunRow = memo(function StandaloneRunRow({+ segment,+}: {+ segment: TurnProcessRunSegment;+}) {+ return (+ <div className="turn-run-row" data-run-row="true">+ <ToolRow imagesInTurn message={segment.item.message} />+ <ReviewChangeCard message={segment.item.message} />+ </div>+ );+});+export const AssistantTurn = memo(function AssistantTurn({entry,isActive,@@ -323,12 +343,18 @@ export const AssistantTurn = memo(function AssistantTurn({);statusesRef.current = turnDelegationStatuses;timingsRef.current = turnDelegationTimings;- const groupProcess = useAppStore((state) =>- shouldGroupTurnProcess(- resolveThinkingDisplayMode(state.settings?.thinkingDisplayMode),- ),- );const { process, responses } = summary;+ const segments = useMemo(() => segmentTurnProcess(process), [process]);+ // While the turn runs, its latest process chunk stays open; earlier chunks+ // have settled, and untouched chunks close on completion.+ const lastProcessIndex = useMemo(+ () =>+ segments.reduce(+ (last, segment, index) => (segment.kind === "process" ? index : last),+ -1,+ ),+ [segments],+ );const activePart = isActive ? entry.parts.at(-1) : undefined;const partContext = { isActive, activePart, runtimeActivity, turnDelegationStatuses, turnDelegationTimings };@@ -342,16 +368,24 @@ export const AssistantTurn = memo(function AssistantTurn({aria-label={t("chat.assistantMessage")}><div className="message-col">- {groupProcess ? (- <>- <TurnProcess turnId={entry.id} processParts={process} turnParts={entry.parts} isActive={isActive} delegationStatuses={turnDelegationStatuses}>- <AssistantTurnParts parts={process} {...partContext} />+ {segments.map((segment, index) => {+ if (segment.kind === "run") {+ return <StandaloneRunRow key={`run-${segment.key}`} segment={segment} />;+ }+ return (+ <TurnProcess+ key={`process-${segment.key}`}+ turnId={segment.key}+ processParts={segment.parts}+ turnParts={segment.parts}+ isActive={isActive && index === lastProcessIndex}+ delegationStatuses={turnDelegationStatuses}+ >+ <AssistantTurnParts parts={segment.parts} {...partContext} /></TurnProcess>- <AssistantTurnParts parts={responses} {...partContext} />- </>- ) : (- <AssistantTurnParts parts={entry.parts} {...partContext} />- )}+ );+ })}+ <AssistantTurnParts parts={responses} {...partContext} />{generatedImages}{!isActive && metaMessage ? (<MessageMetadiff --git a/apps/desktop/src/features/chat/transcript/TurnProcess.tsx b/apps/desktop/src/features/chat/transcript/TurnProcess.tsxindex 95825e457..488ed2924 100644--- a/apps/desktop/src/features/chat/transcript/TurnProcess.tsx+++ b/apps/desktop/src/features/chat/transcript/TurnProcess.tsx@@ -8,10 +8,9 @@ import { TranscriptSearchContext } from "../../../lib/transcript-search-context"import {isTurnThinking,processContainsMessage,- resolveThinkingDisplayMode,- shouldAutoOpenTurnProcess,turnProcessTiming,} from "../../../lib/turn-process";+import { resolveShowThinking } from "../../../lib/thinking-visibility";import { useAppStore } from "../../../stores/app-store";import {IconChevronRight,@@ -37,7 +36,7 @@ export function TurnProcess({children: ReactNode;}) {const { t } = useTranslation();- const mode = useAppStore((state) => resolveThinkingDisplayMode(state.settings?.thinkingDisplayMode));+ const showThinking = useAppStore((state) => resolveShowThinking(state.settings));const search = useContext(TranscriptSearchContext);const revealRequest = useMemo(() => search && processContainsMessage(processParts, search.messageId)? search.requestId : undefined, [processParts, search]);@@ -45,9 +44,13 @@ export function TurnProcess({processParts.flatMap((part) => part.kind === "activity" ? part.items : []), delegationStatuses,), [processParts, delegationStatuses]);const thinkingNow = useMemo(() => isTurnThinking(turnParts, isActive), [turnParts, isActive]);- const visibleSteps = useMemo(() => cachedVisibleProcessSteps(processParts, mode === "compact", isActive), [processParts, mode, isActive]);+ const visibleSteps = useMemo(() => cachedVisibleProcessSteps(processParts, !showThinking, isActive), [processParts, showThinking, isActive]);+ // Active processes start open and untouched completed ones close by default;+ // an explicit user choice stays authoritative. This does not depend on the+ // thinking preference, and a recorded failure keeps an untouched active+ // process open through recovery because it stays active until the turn ends.const disclosure = useAutomaticDisclosure(- shouldAutoOpenTurnProcess(mode, isActive, summary.issues > 0),+ isActive,revealRequest,disclosureKey("turn", turnId),);diff --git a/apps/desktop/src/features/chat/transcript/shared.tsx b/apps/desktop/src/features/chat/transcript/shared.tsxindex d38a4619b..f79dbcc12 100644--- a/apps/desktop/src/features/chat/transcript/shared.tsx+++ b/apps/desktop/src/features/chat/transcript/shared.tsx@@ -21,7 +21,8 @@ import { useChatFileMenu } from "../../../hooks/use-chat-file-menu";import { ContextMenu } from "../../../components/ContextMenu";import { ImageHoverCard, type ImageHoverAnchor } from "../../../components/ImageHoverCard";import { useDisclosureAnchorNotifier } from "../../../lib/disclosure-anchor-context";-import { isThinkingActive, resolveThinkingDisplayMode } from "../../../lib/turn-process";+import { isThinkingActive } from "../../../lib/turn-process";+import { resolveShowThinking } from "../../../lib/thinking-visibility";import { TranscriptSearchContext } from "../../../lib/transcript-search-context";import { disclosureKey, useAutomaticDisclosure } from "./disclosure";export { useAutomaticDisclosure } from "./disclosure";@@ -691,10 +692,11 @@ export const ThinkingRow = memo(function ThinkingRow({onUserInteraction?.();collapseDisclosure();}, [collapseDisclosure, onUserInteraction]);- const compact = useAppStore(- (state) => resolveThinkingDisplayMode(state.settings?.thinkingDisplayMode) === "compact",- );- if (compact) {+ // `Show thinking` off keeps the live indicator but suppresses completed+ // reasoning rows and excerpts. The stored text is never removed, so turning+ // the preference back on restores the row.+ const showThinking = useAppStore((state) => resolveShowThinking(state.settings));+ if (!showThinking) {return isThinkingActive(message, streaming) ? (<div className="tool-row thinking thinking-compact" role="status"><span className="tool-row-icon" aria-hidden>diff --git a/apps/desktop/src/features/settings/SettingsPage.tsx b/apps/desktop/src/features/settings/SettingsPage.tsxindex bd8ce1d3d..b226e2e6b 100644--- a/apps/desktop/src/features/settings/SettingsPage.tsx+++ b/apps/desktop/src/features/settings/SettingsPage.tsx@@ -36,7 +36,7 @@ import { Badge, Button, cx, SegmentedControl, SettingsToggle } from "../../compoimport { ModelConfigPage } from "../../components/settings/ModelConfigPage";import { KeyboardShortcutsSection } from "../../components/settings/KeyboardShortcutsSection";import { FontFamilyRow } from "../../components/settings/FontFamilyRow";-import { ThinkingDisplayModeRow } from "../../components/settings/ThinkingDisplayModeRow";+import { ShowThinkingRow } from "../../components/settings/ShowThinkingRow";import { FontSizeRow } from "../../components/settings/FontSizeRow";import { LanguageRow } from "../../components/settings/LanguageRow";import { SettingsMenuSelect } from "../../components/settings/SettingsMenuSelect";@@ -492,7 +492,7 @@ export function SettingsPage() {</SettingsRow><CommandShellRow settings={settings} saveSettings={saveSettings} /><LinkOpenTargetRow settings={settings} saveSettings={saveSettings} />- <ThinkingDisplayModeRow settings={settings} saveSettings={saveSettings} />+ <ShowThinkingRow settings={settings} saveSettings={saveSettings} /><ContextUsageDisplayRowsettings={settings}saveSettings={saveSettings}diff --git a/apps/desktop/src/lib/api.ts b/apps/desktop/src/lib/api.tsindex 476b42ecc..8ac8604cf 100644--- a/apps/desktop/src/lib/api.ts+++ b/apps/desktop/src/lib/api.ts@@ -422,6 +422,14 @@ export function validateSettingsWrite(settings: AppSettings): AppSettings {errorCode: "INVALID_PARAMS",});}+ if (+ Object.prototype.hasOwnProperty.call(settings, "showThinking") &&+ typeof settings.showThinking !== "boolean"+ ) {+ throw Object.assign(new Error("showThinking is invalid"), {+ errorCode: "INVALID_PARAMS",+ });+ }const value = settings as AppSettings & {defaultCommandShell?: unknown;largePasteThreshold?: unknown;diff --git a/apps/desktop/src/lib/assistant-turns.ts b/apps/desktop/src/lib/assistant-turns.tsindex 9fe477026..e7b3ae0d9 100644--- a/apps/desktop/src/lib/assistant-turns.ts+++ b/apps/desktop/src/lib/assistant-turns.ts@@ -5,7 +5,7 @@ import type {UiMessage,} from "@pi-desktop/shared";import { addUsage, hostedSearchRounds } from "@pi-desktop/shared";-import { isDelegationStartTool } from "./tool-display";+import { getToolAction, isDelegationStartTool } from "./tool-display";import { messageContentFacts } from "./transcript-summary";export type AssistantActivityItem =@@ -85,6 +85,18 @@ function isDelegationStartActivity(item: AssistantActivityItem): boolean {return item.kind === "tool" && isDelegationStartTool(item.message.toolName);}+/**+ * A `Bash` call or a run alias renders as a standalone row outside any process+ * or activity-group disclosure (ADR turn-process-and-thinking-display).+ * Adjacent Bash rows each stay standalone, so a run item neither joins the+ * preceding segment nor absorbs the next one.+ */+export function isStandaloneRunActivity(+ item: AssistantActivityItem,+): item is Extract<AssistantActivityItem, { kind: "tool" }> {+ return item.kind === "tool" && getToolAction(item.message.toolName) === "run";+}+/** Delegate rows grouped by the `Task` call that produced them, chains merged. */function collectSubagentRuns(messages: readonly UiMessage[],@@ -233,11 +245,20 @@ export function buildTranscriptEntries(const pushActivity = (item: AssistantActivityItem) => {const current = ensureTurn(item.message);const last = current.parts[current.parts.length - 1];+ const standalone = isStandaloneRunActivity(item);+ const lastStandalone =+ last?.kind === "activity" &&+ last.items.length === 1 &&+ isStandaloneRunActivity(last.items[0]);// A delegation card is only the Task fan-out. Mixing the parent's later// Read/Grep/thinking into that group painted them as subagent work (D319).+ // A standalone run row never merges with a neighbour, so adjacent Bash+ // calls each keep their own row.if (last?.kind === "activity" &&last.items.length > 0 &&+ !standalone &&+ !lastStandalone &&isDelegationStartActivity(last.items[0]) === isDelegationStartActivity(item)) {last.items.push(item);diff --git a/apps/desktop/src/lib/settings-search.ts b/apps/desktop/src/lib/settings-search.tsindex 2d4563c45..106358e27 100644--- a/apps/desktop/src/lib/settings-search.ts+++ b/apps/desktop/src/lib/settings-search.ts@@ -112,9 +112,8 @@ export const SETTINGS_NAV: SettingsNavEntry[] = ["settings.infiniteProviderRetryDesc","settings.smoothStreaming","settings.smoothStreamingDesc",- "settings.thinkingDisplayMode",- "settings.thinkingDisplayDetailed",- "settings.thinkingDisplayCompact",+ "settings.showThinking",+ "settings.showThinkingDesc","settings.contextUsageDisplay","settings.contextUsageDisplayRemaining","settings.contextUsageDisplayUsed",diff --git a/apps/desktop/src/lib/thinking-visibility.ts b/apps/desktop/src/lib/thinking-visibility.tsnew file mode 100644index 000000000..fb2d31aab--- /dev/null+++ b/apps/desktop/src/lib/thinking-visibility.ts@@ -0,0 +1,21 @@+import type { AppSettings } from "@pi-desktop/shared";++/**+ * Resolve whether the transcript shows model reasoning.+ *+ * `showThinking` is the current preference and wins whenever it is a boolean.+ * `thinkingDisplayMode` is the legacy field: an explicit `compact` hides+ * reasoning while `detailed`, an unknown value, or an absent field shows it.+ * Absent settings therefore show reasoning, matching the legacy default. This+ * resolver is presentation-only and never controls turn-process folding.+ */+export function resolveShowThinking(+ settings:+ | Pick<AppSettings, "showThinking" | "thinkingDisplayMode">+ | null+ | undefined,+): boolean {+ const value = settings?.showThinking;+ if (typeof value === "boolean") return value;+ return settings?.thinkingDisplayMode !== "compact";+}diff --git a/apps/desktop/src/lib/transcript-activity-summary.ts b/apps/desktop/src/lib/transcript-activity-summary.tsindex 8aa3775be..53efdea73 100644--- a/apps/desktop/src/lib/transcript-activity-summary.ts+++ b/apps/desktop/src/lib/transcript-activity-summary.ts@@ -73,19 +73,19 @@ export function activityTimingInputs(items: readonly AssistantActivityItem[]) {}return { startedAt, recordedEnd, missingStartDuration };}-export function cachedVisibleActivityItems(items: readonly AssistantActivityItem[], compact: boolean, active: boolean) {- return items.filter((item) => item.kind !== "thinking" || !compact ||+export function cachedVisibleActivityItems(items: readonly AssistantActivityItem[], hideThinking: boolean, active: boolean) {+ return items.filter((item) => item.kind !== "thinking" || !hideThinking ||(active && item.message.status === "streaming" && !messageContentFacts(item.message).hasContent));}-export function cachedVisibleProcessSteps(parts: readonly AssistantTurnPart[], compact: boolean, active: boolean) {+export function cachedVisibleProcessSteps(parts: readonly AssistantTurnPart[], hideThinking: boolean, active: boolean) {let count = 0;for (const part of parts) {if (part.kind === "message") {if (messageContentFacts(part.message).hasContent) count += 1;} else {for (const item of part.items) {- if (item.kind !== "thinking" || !compact ||+ if (item.kind !== "thinking" || !hideThinking ||(active && item.message.status === "streaming" && !messageContentFacts(item.message).hasContent)) count += 1;}}diff --git a/apps/desktop/src/lib/turn-process.ts b/apps/desktop/src/lib/turn-process.tsindex adbfdbe13..7f22a11e0 100644--- a/apps/desktop/src/lib/turn-process.ts+++ b/apps/desktop/src/lib/turn-process.ts@@ -1,12 +1,10 @@-import type { AppSettings, UiMessage } from "@pi-desktop/shared";-import type { AssistantTurnEntry, AssistantTurnPart } from "./assistant-turns";-import { activityItemHasIssue } from "./activity-summary";--type ThinkingDisplayMode = NonNullable<AppSettings["thinkingDisplayMode"]>;--export function resolveThinkingDisplayMode(value: unknown): ThinkingDisplayMode {- return value === "compact" ? "compact" : "detailed";-}+import type { UiMessage } from "@pi-desktop/shared";+import type {+ AssistantActivityItem,+ AssistantTurnEntry,+ AssistantTurnPart,+} from "./assistant-turns";+import { isStandaloneRunActivity } from "./assistant-turns";export function isThinkingActive(message: UiMessage, active: boolean): boolean {return active && message.status === "streaming" && !message.content.trim();@@ -41,26 +39,60 @@ export function processContainsMessage(});}-export function hasFailedProcessTool(parts: readonly AssistantTurnPart[]): boolean {- return parts.some(- (part) =>- part.kind === "activity" &&- part.items.some(activityItemHasIssue),- );-}+/** A `Bash`/run call rendered as its own row outside any process disclosure. */+export type TurnProcessRunSegment = {+ kind: "run";+ key: string;+ item: Extract<AssistantActivityItem, { kind: "tool" }>;+};-/** Both presentation modes expose the same process hierarchy. */-export function shouldGroupTurnProcess(mode: ThinkingDisplayMode): boolean {- return mode === "detailed" || mode === "compact";-}+/** One chronological chunk of non-run process content between run calls. */+export type TurnProcessBodySegment = {+ kind: "process";+ key: string;+ parts: AssistantTurnPart[];+};-/** Active processes open in Detailed; settled processes default closed. */-export function shouldAutoOpenTurnProcess(- mode: ThinkingDisplayMode,- isActive: boolean,- hasToolFailure: boolean,-): boolean {- return isActive && (mode === "detailed" || hasToolFailure);+export type TurnProcessSegment = TurnProcessRunSegment | TurnProcessBodySegment;++/**+ * Split one turn's process into the order it renders (ADR+ * turn-process-and-thinking-display).+ *+ * `Bash` and run aliases are pulled out of the process flow entirely: each is+ * its own `run` segment rendered as a standalone row with no process or group+ * ancestor, and adjacent calls stay separate. The remaining tools, thinking,+ * hosted searches and progress text keep their original order and are grouped+ * into `process` chunks between the run calls. Segment parts are the same part+ * objects as the input, so downstream reveal and active-tail identity still+ * hold.+ */+export function segmentTurnProcess(+ parts: readonly AssistantTurnPart[],+): TurnProcessSegment[] {+ const segments: TurnProcessSegment[] = [];+ let pending: AssistantTurnPart[] = [];+ const flushProcess = () => {+ if (pending.length === 0) return;+ const first = pending[0];+ const key =+ first.kind === "activity" ? first.items[0].message.id : first.message.id;+ segments.push({ kind: "process", key, parts: pending });+ pending = [];+ };+ for (const part of parts) {+ if (part.kind === "activity" && part.items.length === 1) {+ const item = part.items[0];+ if (isStandaloneRunActivity(item)) {+ flushProcess();+ segments.push({ kind: "run", key: item.message.id, item });+ continue;+ }+ }+ pending.push(part);+ }+ flushProcess();+ return segments;}/**@@ -85,9 +117,17 @@ export function projectTurnProcess(entry: AssistantTurnEntry) {return { process, responses };}+/**+ * Steps a process body renders under the thinking preference.+ *+ * `hideThinking` is `!showThinking`: completed reasoning rows and excerpts are+ * hidden, while the live reasoning indicator still counts as a visible step so+ * a thinking-only process keeps its indicator. Bash and run aliases are always+ * counted: they render as standalone rows inside the process.+ */export function visibleProcessSteps(parts: readonly AssistantTurnPart[],- mode: ThinkingDisplayMode,+ hideThinking: boolean,active: boolean,): number {let count = 0;@@ -99,7 +139,7 @@ export function visibleProcessSteps(for (const item of part.items) {if (item.kind !== "thinking" ||- mode === "detailed" ||+ !hideThinking ||isThinkingActive(item.message, active)) {count += 1;diff --git a/apps/desktop/test/session-reference-ui.test.mjs b/apps/desktop/test/session-reference-ui.test.mjsindex 7100d7974..d3e0822b1 100644--- a/apps/desktop/test/session-reference-ui.test.mjs+++ b/apps/desktop/test/session-reference-ui.test.mjs@@ -94,7 +94,8 @@ const shared = load(new URL("../src/features/chat/transcript/shared.tsx", importReact.createElement("button", { ...props, "aria-label": ariaLabel ?? tooltip }),},"../../../lib/disclosure-anchor-context": { useDisclosureAnchorNotifier: () => {} },- "../../../lib/turn-process": { isThinkingActive: () => false, resolveThinkingDisplayMode: () => "none" },+ "../../../lib/turn-process": { isThinkingActive: () => false },+ "../../../lib/thinking-visibility": { resolveShowThinking: () => true },"../../../lib/transcript-search-context": { TranscriptSearchContext: React.createContext(null) },"../../../lib/assistant-turns": { messageThinking: () => "" },"../../../lib/use-referenced-image-data-url": { useReferencedImageDataUrl: () => undefined },diff --git a/apps/desktop/test/thinking-visibility.test.mjs b/apps/desktop/test/thinking-visibility.test.mjsnew file mode 100644index 000000000..57b67b186--- /dev/null+++ b/apps/desktop/test/thinking-visibility.test.mjs@@ -0,0 +1,38 @@+import assert from "node:assert/strict";+import { register } from "node:module";+import test from "node:test";+register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));+const { resolveShowThinking } = await import("../src/lib/thinking-visibility.ts");++test("an explicit showThinking boolean wins over the legacy display mode", () => {+ assert.equal(+ resolveShowThinking({ showThinking: true, thinkingDisplayMode: "compact" }),+ true,+ );+ assert.equal(+ resolveShowThinking({ showThinking: false, thinkingDisplayMode: "detailed" }),+ false,+ );+});++test("legacy compact hides reasoning while detailed and unknown show it", () => {+ assert.equal(resolveShowThinking({ thinkingDisplayMode: "compact" }), false);+ assert.equal(resolveShowThinking({ thinkingDisplayMode: "detailed" }), true);+ assert.equal(resolveShowThinking({ thinkingDisplayMode: "unknown" }), true);+});++test("absent settings and non-boolean showThinking fall back to the legacy field", () => {+ assert.equal(resolveShowThinking(undefined), true);+ assert.equal(resolveShowThinking(null), true);+ assert.equal(resolveShowThinking({}), true);+ assert.equal(resolveShowThinking({ showThinking: undefined }), true);+ assert.equal(resolveShowThinking({ showThinking: null }), true);+ assert.equal(+ resolveShowThinking({ showThinking: null, thinkingDisplayMode: "compact" }),+ false,+ );+ assert.equal(+ resolveShowThinking({ showThinking: null, thinkingDisplayMode: "detailed" }),+ true,+ );+});diff --git a/apps/desktop/test/transcript-summary.test.mjs b/apps/desktop/test/transcript-summary.test.mjsindex 0e052073b..50322ca52 100644--- a/apps/desktop/test/transcript-summary.test.mjs+++ b/apps/desktop/test/transcript-summary.test.mjs@@ -113,7 +113,7 @@ test("activity summary and compact visibility preserve error, search and thinkinfor (const compact of [false, true]) for (const active of [false, true]) {assert.deepEqual(cachedVisibleActivityItems(subset, compact, active), visibleActivityItems(subset, compact, active));const parts = [{ kind: "activity", items: subset }, { kind: "message", message: message("progress", "progress") }];- assert.equal(cachedVisibleProcessSteps(parts, compact, active), visibleProcessSteps(parts, compact ? "compact" : "detailed", active));+ assert.equal(cachedVisibleProcessSteps(parts, compact, active), visibleProcessSteps(parts, compact, active));}}});diff --git a/apps/desktop/test/turn-process.test.mjs b/apps/desktop/test/turn-process.test.mjsindex fed99a512..1a3bb25b1 100644--- a/apps/desktop/test/turn-process.test.mjs+++ b/apps/desktop/test/turn-process.test.mjs@@ -2,13 +2,13 @@ import assert from "node:assert/strict";import { register } from "node:module";import test from "node:test";register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));-const { buildTranscriptEntries } = await import("../src/lib/assistant-turns.ts");+const { buildTranscriptEntries, isStandaloneRunActivity } = await import(+ "../src/lib/assistant-turns.ts"+);const {projectTurnProcess,+ segmentTurnProcess,visibleProcessSteps,- resolveThinkingDisplayMode,- shouldAutoOpenTurnProcess,- shouldGroupTurnProcess,turnProcessTiming,} = await import("../src/lib/turn-process.ts");@@ -23,14 +23,16 @@ const turn = (messages) =>buildTranscriptEntries(messages).entries.find((entry) => entry.kind === "assistant-turn",);+const tool = (id, toolName, extra = {}) =>+ message(id, "tool", "", { toolName, ...extra });test("one turn groups thinking, tools and progress while retaining only the trailing answer", () => {const entry = turn([message("user", "user", "Inspect"),message("intro", "assistant", "I will inspect", { thinking: "Plan" }),- message("read", "tool", "result", { toolName: "Read" }),+ tool("read", "Read", { toolResult: "result" }),message("progress", "assistant", "I found the cause"),- message("edit", "tool", "updated", { toolName: "Edit" }),+ tool("edit", "Edit", { toolResult: "updated" }),message("final", "assistant", "Fixed"),]);const projected = projectTurnProcess(entry);@@ -38,15 +40,15 @@ test("one turn groups thinking, tools and progress while retaining only the traiprojected.responses.map((part) => part.message.id),["final"],);- assert.equal(visibleProcessSteps(projected.process, "detailed", false), 5);- assert.equal(visibleProcessSteps(projected.process, "compact", false), 4);+ assert.equal(visibleProcessSteps(projected.process, false, false), 5);+ assert.equal(visibleProcessSteps(projected.process, true, false), 4);});test("streamed text stays readable until later work establishes it as progress", () => {const text = message("text", "assistant", "Inspecting", { status: "streaming" });assert.equal(projectTurnProcess(turn([text])).responses[0].message, text);const projected = projectTurnProcess(- turn([text, message("tool", "tool", "", { toolName: "Read" })]),+ turn([text, tool("read", "Read")]),);assert.equal(projected.responses.length, 0);assert.equal(projected.process[0].message, text);@@ -67,7 +69,7 @@ test("errors and aborted partial replies remain outside the process", () => {status: "aborted",});const projected = projectTurnProcess(- turn([error, message("tool", "tool", "result"), partial]),+ turn([error, tool("read", "Read"), partial]),);assert.deepEqual(projected.responses.map((part) => part.message.id),@@ -75,45 +77,126 @@ test("errors and aborted partial replies remain outside the process", () => {);});-test("compact thinking disappears after reasoning ends without removing stored data", () => {+test("hidden thinking disappears after reasoning ends without removing stored data", () => {const thinking = message("think", "assistant", "", {thinking: "Private reasoning",status: "streaming",});const entry = turn([thinking]);- assert.equal(visibleProcessSteps(entry.parts, "compact", true), 1);- assert.equal(visibleProcessSteps(entry.parts, "compact", false), 0);+ assert.equal(visibleProcessSteps(entry.parts, true, true), 1);+ assert.equal(visibleProcessSteps(entry.parts, true, false), 0);const withAnswer = turn([{ ...thinking, content: "Answer" }]);assert.equal(- visibleProcessSteps(projectTurnProcess(withAnswer).process, "compact", true),+ visibleProcessSteps(projectTurnProcess(withAnswer).process, true, true),0,);assert.equal(thinking.thinking, "Private reasoning");});-test("missing and unknown display settings retain detailed mode", () => {- for (const value of [undefined, null, "hidden", false, "detailed"]) {- assert.equal(resolveThinkingDisplayMode(value), "detailed");- }- assert.equal(resolveThinkingDisplayMode("compact"), "compact");+test("Bash and run aliases render as standalone rows, never inside a group", () => {+ const entry = turn([+ message("user", "user", "Run it"),+ tool("read", "Read", { toolResult: "a" }),+ tool("bash1", "Bash", { toolArgs: { command: "echo 1" } }),+ tool("bash2", "Bash", { toolArgs: { command: "echo 2" } }),+ tool("grep", "Grep", { toolResult: "b" }),+ tool("shell", "Shell", { toolArgs: { command: "echo 3" } }),+ message("final", "assistant", "Done"),+ ]);+ const activities = entry.parts.filter((part) => part.kind === "activity");+ assert.deepEqual(+ activities.map((part) => part.items.map((item) => item.message.id)),+ [["read"], ["bash1"], ["bash2"], ["grep"], ["shell"]],+ );+ assert.deepEqual(+ activities.map((part) => isStandaloneRunActivity(part.items[0])),+ [false, true, true, false, true],+ );+});++test("adjacent run aliases each keep their own standalone row", () => {+ const entry = turn([+ message("user", "user", "Run"),+ tool("a", "Bash", { toolArgs: { command: "a" } }),+ tool("b", "exec", { toolArgs: { command: "b" } }),+ tool("c", "shell", { toolArgs: { command: "c" } }),+ ]);+ const activities = entry.parts.filter((part) => part.kind === "activity");+ assert.equal(activities.length, 3);+ assert.ok(activities.every((part) => part.items.length === 1));+ assert.ok(activities.every((part) => isStandaloneRunActivity(part.items[0])));+});++test("a run row splits the surrounding ordinary activity into its own groups", () => {+ const entry = turn([+ message("user", "user", "Run"),+ tool("read1", "Read", { toolResult: "a" }),+ tool("grep1", "Grep", { toolResult: "b" }),+ tool("bash", "Bash", { toolArgs: { command: "pnpm test" } }),+ tool("read2", "Read", { toolResult: "c" }),+ tool("edit2", "Edit", { toolResult: "d" }),+ ]);+ const activities = entry.parts.filter((part) => part.kind === "activity");+ assert.deepEqual(+ activities.map((part) => part.items.map((item) => item.message.id)),+ [["read1", "grep1"], ["bash"], ["read2", "edit2"]],+ );+});++test("process segments pull every Bash row out and keep chronological chunks", () => {+ const entry = turn([+ message("user", "user", "run"),+ tool("read", "Read", { toolResult: "a" }),+ tool("grep", "Grep", { toolResult: "b" }),+ tool("bash", "Bash", { toolArgs: { command: "ls" } }),+ tool("edit", "Edit", { toolResult: "c" }),+ ]);+ const segments = segmentTurnProcess(projectTurnProcess(entry).process);+ assert.deepEqual(+ segments.map((segment) => segment.kind),+ ["process", "run", "process"],+ );+ assert.deepEqual(+ segments.map((segment) => segment.key),+ ["read", "bash", "edit"],+ );+ assert.deepEqual(+ segments[0].parts.flatMap((part) =>+ part.kind === "activity" ? part.items.map((item) => item.message.id) : [],+ ),+ ["read", "grep"],+ );});-test("completed turn processes stay closed by default while active failures remain visible", () => {- assert.equal(shouldGroupTurnProcess("detailed"), true);- assert.equal(shouldGroupTurnProcess("compact"), true);- assert.equal(shouldAutoOpenTurnProcess("detailed", false, false), false);- assert.equal(shouldAutoOpenTurnProcess("detailed", false, true), false);- assert.equal(shouldAutoOpenTurnProcess("detailed", true, false), true);- assert.equal(shouldAutoOpenTurnProcess("detailed", true, true), true);- assert.equal(shouldAutoOpenTurnProcess("compact", false, false), false);- assert.equal(shouldAutoOpenTurnProcess("compact", true, false), false);- assert.equal(shouldAutoOpenTurnProcess("compact", true, true), true);- assert.equal(shouldAutoOpenTurnProcess("compact", false, true), false);+test("a Bash-only turn has no process segment at all", () => {+ const entry = turn([+ message("user", "user", "run"),+ tool("bash1", "Bash", { toolArgs: { command: "a" } }),+ tool("bash2", "Bash", { toolArgs: { command: "b" } }),+ ]);+ const segments = segmentTurnProcess(projectTurnProcess(entry).process);+ assert.deepEqual(+ segments.map((segment) => segment.kind),+ ["run", "run"],+ );+});++test("a turn without Bash keeps one process segment", () => {+ const entry = turn([+ message("user", "user", "read"),+ tool("read", "Read", { toolResult: "a" }),+ tool("grep", "Grep", { toolResult: "b" }),+ ]);+ const segments = segmentTurnProcess(projectTurnProcess(entry).process);+ assert.deepEqual(+ segments.map((segment) => segment.kind),+ ["process"],+ );});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" }),+ tool("read", "Read", { toolCompletedAt: "2026-09-17T00:00:02.000Z" }),message("answer", "assistant", "Done", {createdAt: "2026-09-17T00:00:03.000Z",responseDurationMs: 1000,@@ -135,7 +218,7 @@ test("history timing uses recorded ends and rejects invalid timestamps and durattest("user boundaries retain independent processes and delegation details stay attached", () => {const entries = buildTranscriptEntries([message("u1", "user", "one"),- message("task", "tool", "started", { toolName: "Task", toolCallId: "call" }),+ tool("task", "Task", { toolCallId: "call", toolResult: "started" }),message("nested", "assistant", "Delegate answer", { parentToolCallId: "call" }),message("a1", "assistant", "one done"),message("u2", "user", "two"),@@ -147,7 +230,7 @@ test("user boundaries retain independent processes and delegation details stay aassert.equal(projectTurnProcess(entries[1]).process.length, 0);});-test("settings writes validate the mode without changing other preferences", async () => {+test("settings writes validate the thinking preference without changing other preferences", async () => {const { validateSettingsWrite } = await import("../src/lib/api.ts");const settings = {defaultMode: "agent",@@ -162,6 +245,15 @@ test("settings writes validate the mode without changing other preferences", asy() => validateSettingsWrite({ ...settings, infiniteProviderRetry: "yes" }),/infiniteProviderRetry is invalid/,);+ for (const showThinking of [true, false]) {+ const next = { ...settings, showThinking };+ assert.equal(validateSettingsWrite(next), next);+ }+ assert.throws(+ () => validateSettingsWrite({ ...settings, showThinking: "yes" }),+ /showThinking is invalid/,+ );+ // The legacy field is retained for persisted-settings compatibility.for (const thinkingDisplayMode of ["detailed", "compact"]) {const next = { ...settings, thinkingDisplayMode };assert.equal(validateSettingsWrite(next), next);diff --git a/crates/host-core/src/config_sync/domains.rs b/crates/host-core/src/config_sync/domains.rsindex 0bf1d2015..7538bedad 100644--- a/crates/host-core/src/config_sync/domains.rs+++ b/crates/host-core/src/config_sync/domains.rs@@ -33,6 +33,7 @@ pub(crate) const PORTABLE_APPLICATION_FIELDS: &[&str] = &["language","fontFamily","fontScale",+ "showThinking","thinkingDisplayMode","enterToSend","largePasteThreshold",@@ -97,6 +98,7 @@ pub const DOMAIN_ADAPTERS: &[DomainAdapterSpec] = &["language","fontFamily","fontScale",+ "showThinking","thinkingDisplayMode","enterToSend","keybindings",@@ -624,6 +626,13 @@ mod tests {fn adapter_registry_covers_every_portable_domain() {assert_eq!(DOMAIN_ADAPTERS.len(), ALL_DOMAINS.len());assert!(!PORTABLE_APPLICATION_FIELDS.contains(&"defaultPermissionMode"));+ // The explicit reasoning-display boolean and its legacy fallback are+ // both portable, and both are advertised by the application adapter.+ assert!(PORTABLE_APPLICATION_FIELDS.contains(&"showThinking"));+ assert!(PORTABLE_APPLICATION_FIELDS.contains(&"thinkingDisplayMode"));+ let application = adapter_for(DOMAIN_APPLICATION).expect("application adapter");+ assert!(application.exportable_fields.contains(&"showThinking"));+ assert!(application.exportable_fields.contains(&"thinkingDisplayMode"));for domain in ALL_DOMAINS {let adapter = adapter_for(domain).expect("portable domain adapter");assert_eq!(adapter.schema_version, 1);diff --git a/crates/host-core/src/config_sync/engine_s3_tests.rs b/crates/host-core/src/config_sync/engine_s3_tests.rsindex 70584e192..a9882ad52 100644--- a/crates/host-core/src/config_sync/engine_s3_tests.rs+++ b/crates/host-core/src/config_sync/engine_s3_tests.rs@@ -9,6 +9,10 @@ fn theme(state: &AppState) -> Result<Value> {Ok(state.db.get_setting("app")?.unwrap_or_else(|| json!({}))["theme"].clone())}+fn app_settings(state: &AppState) -> Result<Value> {+ Ok(state.db.get_setting("app")?.unwrap_or_else(|| json!({})))+}+async fn approve_all(state: &Arc<Mutex<AppState>>,tx: &mpsc::UnboundedSender<String>,@@ -104,6 +108,75 @@ async fn backup_does_not_apply_remote_settings_and_restore_is_local_only() -> ReOk(())}+#[tokio::test]+async fn application_show_thinking_roundtrips_and_keeps_local_only_settings() -> Result<()> {+ if run_in_isolated_process(+ "config_sync::engine::s3_tests::application_show_thinking_roundtrips_and_keeps_local_only_settings",+ )? {+ return Ok(());+ }+ let fixture = fixture(false).await;+ let directory_a = tempfile::tempdir()?;+ let directory_b = tempfile::tempdir()?;+ let device_a = configure_test_device(directory_a.path(), &fixture.endpoint).await?;+ let device_b = configure_test_device(directory_b.path(), &fixture.endpoint).await?;+ // The source device carries the explicit reasoning-display boolean (a+ // false value must stay false), the legacy display mode, and a device-local+ // permission mode that must never travel through a revision.+ device_a.lock().await.db.set_setting(+ "app",+ &json!({+ "theme": "light",+ "showThinking": false,+ "thinkingDisplayMode": "detailed",+ "defaultPermissionMode": "accept-edits",+ }),+ )?;+ let (tx, _rx) = mpsc::unbounded_channel();+ sync_now(device_a.clone(), tx.clone()).await?;+ let received = sync_now(device_b.clone(), tx.clone()).await?;+ assert!(pending_approvals(&received).is_empty());+ {+ let state = device_b.lock().await;+ let settings = app_settings(&state)?;+ assert_eq!(settings["theme"], "light");+ // A false boolean survives capture and apply instead of reading as absent.+ assert_eq!(settings["showThinking"], false);+ // The legacy field is still exported so older readers keep working.+ assert_eq!(settings["thinkingDisplayMode"], "detailed");+ // Local-only settings do not travel: the source value never appears.+ assert!(settings.get("defaultPermissionMode").is_none());+ }+ // The receiving device now adopts its own local-only value.+ device_b.lock().await.db.set_setting(+ "app",+ &json!({+ "theme": "light",+ "showThinking": false,+ "thinkingDisplayMode": "detailed",+ "defaultPermissionMode": "ask",+ }),+ )?;+ // A later portable edit still syncs while the device-local value is untouched.+ device_a.lock().await.db.set_setting(+ "app",+ &json!({+ "theme": "light",+ "showThinking": true,+ "thinkingDisplayMode": "detailed",+ "defaultPermissionMode": "accept-edits",+ }),+ )?;+ sync_now(device_a.clone(), tx.clone()).await?;+ sync_now(device_b.clone(), tx).await?;+ let state = device_b.lock().await;+ let settings = app_settings(&state)?;+ assert_eq!(settings["showThinking"], true);+ assert_eq!(settings["thinkingDisplayMode"], "detailed");+ assert_eq!(settings["defaultPermissionMode"], "ask");+ Ok(())+}+#[tokio::test]async fn sync_restore_requires_acknowledgement_and_propagates_as_a_new_revision() -> Result<()> {if run_in_isolated_process(diff --git a/docs/adr/turn-process-and-thinking-display.md b/docs/adr/turn-process-and-thinking-display.mdindex 11454f4c9..ce0c90bef 100644--- a/docs/adr/turn-process-and-thinking-display.md+++ b/docs/adr/turn-process-and-thinking-display.md@@ -2,7 +2,7 @@- Status: Accepted- Date: 2026-09-17-- Amended: 2026-09-27+- Amended: 2026-10-16- Issues: #510, #461- Amends: D071, [ADR 0242](0242-delta-only-streaming-updates.md)@@ -16,77 +16,95 @@ readers also need a thinking indicator without rapidly changing reasoning text.## Decision-Both display modes project each loaded assistant-turn entry into one turn-process-disclosure plus its trailing answer. Thinking, tools and intermediate assistant-text keep their original order inside the process. A trailing assistant text-stays visible while streaming; if later tool or thinking activity follows, that-text moves into the process without changing the stored message. There is no-semantic final-answer marker in `UiMessage`, so the renderer does not guess-intent from wording. User/system messages and compaction dividers retain their-existing turn boundaries.--The process has three independent disclosure levels: the whole turn process, an-ordinary activity group, and one item's details. An ordinary activity group-contains one contiguous tool/search/thinking segment between progress paragraphs-and appears only when the mode has at least two visible items. A singleton uses-its item disclosure directly; hidden compact-mode thinking does not create a-redundant wrapper. Existing Task topology remains its segment's container and is-not duplicated inside an ordinary activity group.--Detailed mode starts active whole-process disclosures open. On completion,-untouched whole-process disclosures close by default; an explicit user choice-remains authoritative. The ordinary group that owns the active execution-segment starts open, then closes on completion only while untouched. Other-completed ordinary groups start closed. Compact mode starts process and-ordinary-group disclosures closed, but an untouched active process containing-any recorded failed or denied tool stays open through later recovery and closes-on turn completion if still untouched. Compact mode keeps every tool/search-payload closed and renders no reasoning text or excerpt; it shows only the-active thinking indicator and omits empty completed thinking-only containers.--The leaf default that this decision first introduced was later removed. Item-payloads never open themselves in either mode: a tool-call, hosted-search or-plan row stays a header row until the user opens it, wherever it sits in the-group. Group and whole-process defaults are unchanged, and opening a closed-ancestor still exposes the retained item choices without opening all-descendants.+One unified turn-process presentation applies to every loaded assistant-turn+entry: it projects the entry into chronological collapsible process segments plus+its trailing answer. Thinking, tools and intermediate assistant text keep their+original order across those segments. A trailing assistant text stays visible+while streaming; if later tool or thinking activity follows, that text moves into+the process without changing the stored message. There is no semantic+final-answer marker in `UiMessage`, so the renderer does not guess intent from+wording. User/system messages and compaction dividers retain their existing turn+boundaries.++The process is segmented rather than one flat container. Non-Bash activity forms+ordinary activity groups: one contiguous tool/search/thinking segment between+progress paragraphs or Bash rows, appearing only when at least two items are+visible under the current thinking preference. A singleton uses its item+disclosure directly; hidden thinking does not create a redundant wrapper.+Existing Task topology remains its segment's container and is not duplicated+inside an ordinary activity group.++Bash and run aliases are excluded from every process disclosure — neither a+turn-level process disclosure nor an ordinary activity group — and render as+standalone rows that stay visible even when every group is collapsed. Adjacent+Bash rows each remain standalone, and a Bash row's detail stays closed until the+user opens it. Other operations between progress paragraphs still form+chronological collapsible activity groups.++Group folding defaults are unified and do not depend on the thinking preference.+The ordinary activity group that owns the active execution segment starts open,+then closes on completion only while untouched. Other completed groups start+closed. An untouched active group containing any recorded failed or denied tool+stays open through later recovery and closes on turn completion if still+untouched. Bash rows remain visible regardless of any group's collapsed state.++The thinking preference is a boolean `showThinking`. When it is false, the live+thinking indicator stays visible, while completed thinking rows and excerpts are+hidden and empty thinking-only containers are omitted; the stored reasoning is+retained, so turning the preference back on restores the completed rows and+excerpts. Hidden thinking never creates an empty group wrapper.++The leaf default that an earlier decision first introduced was later removed.+Item payloads never open themselves: a tool-call, hosted-search or plan row+stays a header row until the user opens it, wherever it sits in the group, and+this holds regardless of the thinking preference. Group defaults are unchanged,+and opening a closed ancestor still exposes the retained item choices without+opening all descendants.Each header toggles only its own level. Parent and child states are independent:closing a parent preserves descendant choices, reopening restores them, andsibling groups do not form an accordion. Manual interaction with an item claims-the containing group and process as user-owned without toggling either ancestor;-completion must not close a container around content the user opened, focused,-or selected. Manual choices survive streaming, completion, mode changes,-reparenting from singleton to group, and row remounts while the owning retained-session pane remains alive. Pane eviction, session deletion, or renderer restart-releases this presentation memory; it is not stored in messages or host settings.--Search/navigation reveals the ancestor path its target needs: the process, then-the activity group that owns the named message. Item-level targeting is not part-of this change, so each row's own details stay behind its own disclosure.+its containing group as user-owned without toggling it; completion must not close+a container around content the user opened, focused, or selected. Manual choices+survive streaming, completion, preference changes, reparenting from singleton to+group, and row remounts while the owning retained session pane remains alive.+Pane eviction, session deletion, or renderer restart releases this presentation+memory; it is not stored in messages or host settings.++Search/navigation reveals the ancestor path its target needs: the process segment+and the activity group that own the named message. Item-level targeting is not+part of this change, so each row's own details stay behind its own disclosure.Replaying the same request does not repeatedly override a later manual close.-Compact-mode reasoning remains hidden until the user chooses Detailed. Assistant-errors, stopped trailing partial answers, permission/question/plan/goal-decisions, and any other pending action surface remain outside hidden process-content and reachable without expanding it.--Settings → AI → Defaults retains `thinkingDisplayMode`, the optional-`detailed | compact` `AppSettings` field. Absent or unrecognized values resolve-to detailed. The field changes presentation only; it does not alter provider-thinking levels, runtime/model context, stored reasoning, export, permissions,-execution, or copy payloads. Process headers use recorded timing, direct-tool/search counts, running state, and issue counts; they do not double-count-delegated child work or treat a failed child as a failed assistant turn.+Reasoning hidden by the preference stays hidden until the user turns+`showThinking` on. Assistant errors, stopped trailing partial answers,+permission/question/plan/goal decisions, and any other pending action surface+remain outside hidden process content and reachable without expanding it.++Settings → AI → Defaults exposes a `Show thinking` boolean that persists as the+optional `showThinking` `AppSettings` field. Absent and non-boolean values fall+back to the legacy `thinkingDisplayMode` field: an explicit `compact` hides+reasoning while `detailed`, an unknown value, or an absent field shows it. The+legacy field is retained for persisted-settings compatibility and is no longer+exposed in the UI. The preference changes presentation only; it does not alter+provider thinking levels, runtime/model context, stored reasoning, export,+permissions, execution, or copy payloads, and it does not control process-segment+or activity-group folding. Process headers use recorded timing, direct tool/search+counts, running state, and issue counts; they do not double-count delegated child+work or treat a failed child as a failed assistant turn.## Consequences-- Both modes expose one whole-process disclosure while keeping the final answer- and actionable interruptions reachable outside it.-- Detailed mode keeps the active process visible, folds untouched completed- processes by default, preserves explicit disclosure choices, and retains the- literal-final-item leaf default.-- Compact mode remains the low-detail option: the process is folded, payloads- stay closed, and reasoning content is suppressed.+- Chronological collapsible process segments keep the final answer and actionable+ interruptions reachable, and Bash/run rows stay visible even when every group is+ collapsed.+- Group folding defaults are unified: active work stays visible, untouched+ completed groups fold by default, and explicit disclosure choices are preserved+ regardless of the thinking preference.+- When `showThinking` is false, the live indicator stays visible while completed+ reasoning rows and excerpts are hidden. The stored reasoning is retained and+ reappears when the preference is turned back on.+- Bash and run aliases stay standalone rows outside every process disclosure, so+ shell-heavy turns remain scannable without folding adjacent commands together.- Disclosure memory is pane-owned presentation state with stable turn, group,and item identities; it is neither a persisted transcript contract nor acentral workflow-store concern.@@ -103,3 +121,8 @@ E2E-CHAT-turn-process-and-thinking-display for the synchronized scenario text.For the 2026-09-27 amendment, `apps/desktop/test/turn-process.test.mjs` coversthe default selection, and `pnpm test:e2e:transcript-disclosure` exercisesactive-to-completed collapse and user-open retention in real Chromium.+For the 2026-10-16 amendment, `apps/desktop/test/thinking-visibility.test.mjs`+covers the `showThinking`/legacy `thinkingDisplayMode` resolver precedence, and+the i18n catalog tests cover the new `settings.showThinking` copy. The UI,+resolver, and E2E scenarios are validated on the integration candidate; see+E2E-CHAT-turn-process-and-thinking-display for the synchronized scenario text.diff --git a/docs/spec/03-runtime/04-data-storage.md b/docs/spec/03-runtime/04-data-storage.mdindex 11770883c..df5d9d2aa 100644--- a/docs/spec/03-runtime/04-data-storage.md+++ b/docs/spec/03-runtime/04-data-storage.md@@ -410,9 +410,13 @@ CREATE TABLE kv (| `plugin:<id>` | per-plugin settings; uninstall = `DELETE WHERE ns = ?` || `projectMemory` | durable user-authored context keyed by canonical project path; structured values contain `format: "entries-v1"`, visual `entries`, derived `content`, and `updatedAt` |-The app settings JSON optionally stores `thinkingDisplayMode` (`detailed` or-`compact`). Missing values retain detailed presentation. This additive display-preference neither rewrites stored reasoning nor changes the database schema.+The app settings JSON optionally stores `showThinking` (boolean) for transcript+reasoning visibility. It is a portable application preference and synchronizes+across devices like the legacy field. Missing values fall back to the legacy+`thinkingDisplayMode` field (`compact` hides, `detailed`/unknown/absent shows),+which is retained only for persisted-settings compatibility and as that+fallback. These additive display preferences neither rewrite stored reasoning+nor change the database schema.The settings blob may still contain legacy prompt-enhancement keys from anearlier release. They are retained for rollback and downgrade compatibility,diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex 3e61a737f..14e104c82 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -266,7 +266,7 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (control column.- **Defaults** card: the host-backed default operating mode (Agent / Plan / Goal),command shell selection, Link open destination, context usage display- (remaining or used), thinking display mode, Enter-to-send control, the+ (remaining or used), the Show thinking toggle, Enter-to-send control, theinfinite provider retry switch, and the large text paste threshold. Theretry switch is off by default and explains that network/transient providerfailures keep retrying until success; Stop still cancels the turn and the@@ -289,17 +289,17 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (settings are edited on the Plugins page; the one-time migration of legacyprompt-enhancement preferences is specified in`04-ux/12-prompt-enhancement.md`.-- **Thinking display mode** uses a menu select with Detailed (default) and- Compact. Both modes use one whole-process disclosure. Detailed starts the- process open, keeps reasoning visible, opens the active multi-item activity- group, and closes an untouched group when it completes; Compact starts the- process and groups closed, keeps tool/search payloads closed, shows only an- active thinking indicator, and hides finished reasoning. Singleton activity- uses its item disclosure directly in either mode. The global preference- persists as `thinkingDisplayMode` in host-owned settings; missing values use- Detailed. It affects presentation only, not model reasoning configuration,- and explicit disclosure choices are retained for the mounted session pane.- Settings search indexes the row and both mode names.+- **Show thinking** is a toggle that persists as the optional `showThinking`+ boolean in host-owned settings. Off keeps the live thinking indicator visible+ and hides completed reasoning rows and excerpts; stored reasoning is retained+ and reappears when the toggle is turned back on. It affects presentation only,+ not model reasoning configuration, and it does not control turn-process or+ activity-group folding: active processes start open and untouched completed+ processes fold by default regardless of the toggle. The legacy+ `thinkingDisplayMode` field (`detailed` / `compact`) is retained only for+ persisted-settings compatibility and is no longer exposed; an absent or+ unknown value shows reasoning and an explicit `compact` hides it. Settings+ search indexes the row.- The **Command shell** row in Defaults uses the host-discovered catalog of nativePowerShell 5.1, PowerShell 7, cmd, Git Bash, and Bash with IDs`windows-powershell`, `windows-pwsh`, `cmd`, `git-bash`, anddiff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 7311437d3..7dd9b545f 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -849,47 +849,54 @@ reading surface of the workstation.### Turn process and thinking display-Both Detailed and Compact project each loaded assistant turn into one whole-process-disclosure containing reasoning, tools, hosted searches and intermediate assistant-text in transcript order. The trailing answer streams outside that disclosure;-later activity can reclassify provisional answer text into the process without-changing the stored message. Assistant errors and stopped trailing partial answers-also stay outside it. User/system messages and compaction boundaries are unchanged.+One unified turn-process presentation projects each loaded assistant turn into+chronological collapsible process segments plus its trailing answer. Reasoning,+tools, hosted searches and intermediate assistant text keep their transcript order+across those segments. The trailing answer streams outside the process; later+activity can reclassify provisional answer text into the process without changing+the stored message. Assistant errors and stopped trailing partial answers also+stay outside it. User/system messages and compaction boundaries are unchanged.Within the process, an ordinary activity group represents one contiguous-tool/search/thinking segment between progress paragraphs. It renders a group header-only when the current mode has two or more visible items. A singleton uses its item-disclosure directly, compact-hidden thinking never creates an empty wrapper, and-the existing Task topology remains the container for delegated work.--Detailed opens whole-process disclosures while a turn is active. When a turn-settles, an untouched process defaults closed; an explicit user choice remains-authoritative. The ordinary group owning the active execution segment starts-open, then closes on completion only if untouched; other completed groups start-closed. Compact starts the process and ordinary groups closed. Its untouched-active process remains open when any failed or denied tool has been recorded,-through later successful recovery, and closes on completion if still untouched.-Group headers summarize count, running state and issue count without treating a-failed child as a failed turn.--No item payload opens itself in either mode: a tool, hosted-search or plan call-stays a header row until the user opens its disclosure. The activity group and-the whole process keep their automatic open defaults, so a live turn still shows-its work. Compact keeps all tool/search payloads closed and suppresses reasoning-text and excerpts; only its active thinking indicator remains.--Whole process, group and item are independent controls. Closing an ancestor keeps-descendant choices and reopening restores them; opening a parent never expands all-children. User interaction with a child claims its ancestors without toggling them,-so completion cannot close around opened, focused or selected content. Choices use+tool/search/thinking segment between progress paragraphs or Bash rows. It renders a+group header only when at least two items are visible under the current thinking+preference. A singleton uses its item disclosure directly, hidden thinking never+creates an empty wrapper, and the existing Task topology remains the container for+delegated work. Bash and run aliases are excluded from every process disclosure —+neither a turn-level process disclosure nor an ordinary activity group — and render+as standalone rows that stay visible even when every group is collapsed. Adjacent+Bash rows each remain standalone, and a Bash row's detail stays closed until the+user opens it.++The ordinary group owning the active execution segment starts open while a turn is+active, then closes on completion only if untouched; other completed groups start+closed. An untouched active group remains open when any failed or denied tool has+been recorded, through later successful recovery, and closes on completion if still+untouched. These group defaults are unified and do not depend on the thinking+preference. Group headers summarize count, running state and issue count without+treating a failed child as a failed turn.++No item payload opens itself: a tool, hosted-search or plan call stays a header row+until the user opens its disclosure, including a Bash row, whose detail stays closed+until the user opens it. The activity groups keep their automatic open defaults, so+a live turn still shows its work. When the `Show thinking` preference is off, the+live thinking indicator stays visible while completed reasoning rows and excerpts+are suppressed and empty thinking-only containers are omitted; the stored reasoning+is retained and reappears when the preference is turned back on.++Group and item are independent controls. Closing an ancestor keeps descendant+choices and reopening restores them; opening a parent never expands all children.+User interaction with a child claims its containing group without toggling it, so+completion cannot close around opened, focused or selected content. Choices usestable turn/group/item identities and remain while the retained session pane lives,-including mode changes and row remounts; pane eviction, deletion or renderer restart-reapplies defaults rather than persisting disclosure state to messages or settings.--Search/navigation reveals the process and the activity group that own the named-message, and applies each reveal request once. Item-level targeting is not part-of this change. Compact reasoning stays hidden until-the user selects Detailed. Permission, question, plan/goal approval and other+including preference changes and row remounts; pane eviction, deletion or renderer+restart reapplies defaults rather than persisting disclosure state to messages or+settings.++Search/navigation reveals the process segment and the activity group that own the+named message, and applies each reveal request once. Item-level targeting is not+part of this change. Reasoning hidden by the preference stays hidden until the user+turns `Show thinking` on. Permission, question, plan/goal approval and otherpending action cards remain reachable outside a hidden process. See[ADR turn-process-and-thinking-display](../../adr/turn-process-and-thinking-display.md).@@ -2236,14 +2243,18 @@ Lightweight inline disclosure row showing a semantic tool action, its primaryargument hint, status, and a readable rendering of the result. It follows D071and is intentionally not an elevated card.-One contiguous tool/search/thinking segment between progress paragraphs becomes an-ordinary processing group only when it has two or more visible items. A singleton-uses its item disclosure directly, and Task topology keeps its existing container.-While the turn is active, the ordinary group owning the execution segment opens in-Detailed and remains closed in Compact; when it settles, an untouched Detailed-group closes. No item payload opens itself in either mode: a tool, hosted-search-or plan row stays a header row until the user opens it, whichever item of the-group it is. Compact keeps every tool/search payload closed.+One contiguous tool/search/thinking segment between progress paragraphs or Bash+rows becomes an ordinary processing group only when it has two or more visible+items under the current thinking preference. A singleton uses its item disclosure+directly, and Task topology keeps its existing container. Bash and run aliases are+excluded from every process disclosure — neither a turn-level process disclosure+nor an ordinary group — and render as standalone rows that stay visible even when+every group is collapsed; adjacent Bash rows each remain standalone. While the+turn is active, the ordinary group owning the execution segment opens; when it+settles, an untouched group closes. These group defaults do not depend on the+thinking preference. No item payload opens itself: a tool, hosted-search or plan+row stays a header row until the user opens it, whichever item of the group it is,+including a Bash row whose detail stays closed until opened.The group header shows `Processing · 12s` while active or `Processed for 12s`after completion, plus bounded item and issue counts. Expanding it reveals the@@ -2251,7 +2262,7 @@ ordered activity rows and their independent result disclosures. A failed childremains an error on its own ToolCallRow but does not make the group or whole turnterminally failed; terminal agent errors remain owned by the assistant error orTurnOutcomeCard surface. A user action on a group, item, or collapse rail claims-that level and its ancestors without toggling them, so streaming and completion+that level and its containing group without toggling them, so streaming and completionnever reverse the chosen state or close around focused/selected content.Elapsed labels use compact automatically carried units: seconds below oneminute, minutes plus seconds below one hour, and hours plus minutes (and@@ -2272,12 +2283,16 @@ seconds when non-zero) from one hour onward. Zero-value units are omitted, so- The leading Lucide icon reflects the action type: file, folder, search,edit, terminal, web, or generic tool.- A multi-item group header owns elapsed time plus item and issue counts and stays- in the transcript after completion. In Detailed the active group starts open and- closes on completion only if untouched; completed groups otherwise start closed.- Compact groups start closed. A singleton has no group header.-- Tool/search payloads stay collapsed in both modes until the user opens them; no- row auto-opens, so a final thinking item never selects an earlier tool. Live- thinking follows its own disclosure policy and never opens sibling payloads.+ in the transcript after completion. The active group starts open and closes on+ completion only if untouched; completed groups otherwise start closed. These+ defaults do not depend on the thinking preference. A singleton has no group+ header.+- Tool/search payloads stay collapsed until the user opens them; no row+ auto-opens, so a final thinking item never selects an earlier tool. Live+ thinking follows its own indicator/disclosure policy and never opens sibling+ payloads.+- Bash and run rows render standalone outside every process disclosure and stay+ visible even when every group is collapsed; adjacent Bash rows remain separate.- The processing group spans the full available assistant column, so expandedresult details keep a usable width even when the header or payload is short.- The visible label is a natural-language action (`Read`, `Ran`, `Searched`),@@ -2350,16 +2365,16 @@ 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…` | Detailed opens the active multi-item group; no item payload opens itself. Compact payloads stay closed; live thinking follows its own indicator/disclosure policy |+| 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 active multi-item group opens; no item payload opens itself; live thinking follows its own indicator/disclosure policy || 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; an untouched active group closes on completion, while manual group and item choices are retained || 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 nonzero, whatever the call reported (D227) | Error note first, then arguments || Denied | Muted `Denied` status; payload remains closed until requested | Permission result when available |### 9.6 Interactions-- Click the row: expand/collapse only that result payload. Compact payloads start- closed. No payload opens itself in either mode, so the row the user opens is the- only expanded one; failed and denied rows behave the same.+- Click the row: expand/collapse only that result payload. Payloads start+ closed. No payload opens itself, so the row the user opens is the only expanded+ one; failed and denied rows behave the same.- A file path that a row or its result names is a link, not decoration: clickingthe summary path of a `Read`, `Write`, `Edit`, or `fetch` row, or a path in aresult's file list or match groups, completes the reference through the same@@ -2371,14 +2386,14 @@ twice.disclosure, and a reference that matches nothing reports itself withoutopening a panel. A tool surface picks no destination of its own.- Click the processing header: expand/collapse only that ordered activity list.- Detailed opens the active group and closes it on settlement only if untouched;- completed groups otherwise start closed. Compact groups start closed. Opening a- group does not expand every item, and sibling groups remain independent.+ The active group opens and closes on settlement only if untouched; completed+ groups otherwise start closed. Opening a group does not expand every item, and+ sibling groups remain independent.- Click or keyboard-activate the left rule beside expanded thinking, tool details,delegated work, or processing steps: collapse that owning disclosure withoutchanging adjacent expansion state. Item interaction also claims its containing- group and whole process as user-owned without toggling them; automatic stream or- completion transitions never reverse those states.+ group as user-owned without toggling it; automatic stream or completion+ transitions never reverse those states.- A failed child row remains error-hued and reports its failure in the row header,but its payload is not auto-expanded. The containing group settles as`Processed for {elapsed}` with an issue count even when a later tool recovered.diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.mdindex 126e98f14..538beda37 100644--- a/docs/spec/04-ux/09-interaction-patterns.md+++ b/docs/spec/04-ux/09-interaction-patterns.md@@ -911,35 +911,42 @@ may be retained while exactly one workspace supplies the visible shell context.- Tool activity starts as a lightweight collapsed item row. Failed and deniedcalls keep their issue in the row header and do not auto-expand their payload.-- Both modes give each loaded assistant turn one whole-process disclosure. It- contains thinking, tools, hosted searches and intermediate progress text; the- trailing answer, assistant errors and stopped trailing text remain outside it.+- One unified presentation gives each loaded assistant turn chronological+ collapsible process segments. They contain thinking, tools, hosted searches and+ intermediate progress text; the trailing answer, assistant errors and stopped+ trailing text remain outside them.- A contiguous activity segment receives a group disclosure only when it has at- least two mode-visible items. Progress text ends the segment, a singleton uses- its item disclosure directly, and compact-hidden thinking does not create a- redundant group. Existing Task topology remains separate.-- Detailed starts active and completed whole processes open. Its active ordinary- group starts open and closes when it completes only if untouched; completed- groups otherwise start closed. Compact starts the process and groups closed,- except an untouched active process with any recorded failed/denied tool remains- open through recovery and closes on completion.-- No item payload opens itself in either mode: a tool, hosted-search or plan call- stays a header row until the user opens it, including the literal final item of- the last activity group. Group and whole-process defaults are unchanged, so a- final thinking item never causes a backward scan. Compact keeps every item- payload closed and hides reasoning text/excerpts while retaining its active- thinking indicator.-- Activating a process, group or item header toggles only that level. Closing a- parent preserves child state, reopening restores it, and sibling groups remain+ least two visible items under the current thinking preference. Progress text or a+ Bash row ends the segment, a singleton uses its item disclosure directly, and+ hidden thinking does not create a redundant group. Existing Task topology remains+ separate. Bash and run aliases are excluded from every process disclosure —+ neither a turn-level process disclosure nor a group — and stay standalone rows+ that remain visible even when every group is collapsed; adjacent Bash rows each+ remain standalone.+- The active ordinary group starts open and closes when it completes only if+ untouched; completed groups otherwise start closed, and an untouched active group+ with any recorded failed/denied tool remains open through recovery. These group+ defaults do not depend on the thinking preference. Bash rows stay visible+ regardless of any group's collapsed state.+- No item payload opens itself: a tool, hosted-search or plan call stays a header+ row until the user opens it, including the literal final item of the last+ activity group. Group defaults are unchanged, so a final thinking item never+ causes a backward scan. When `Show thinking` is off, every item payload stays+ closed and completed reasoning text/excerpts are hidden while the live thinking+ indicator remains visible; stored reasoning is retained and reappears when the+ preference is turned back on.+- Activating a group or item header toggles only that level. Closing a parent+ preserves child state, reopening restores it, and sibling groups remainindependent. Opening a parent is never an expand-all action.-- A manual item action claims its group and process as user-owned without toggling- them. Streaming and completion cannot reopen a manual close or close around- content the user opened, focused or selected. Choices survive mode changes,- singleton-to-group growth and remounts while the retained session pane lives.-- Search/navigation opens the process and activity group that own the named+- A manual item action claims its containing group as user-owned without toggling+ it. Streaming and completion cannot reopen a manual close or close around+ content the user opened, focused or selected. Choices survive preference+ changes, singleton-to-group growth and remounts while the retained session pane+ lives.+- Search/navigation opens the process segment and activity group that own the namedmessage, once per reveal request. Item-level targeting is not part of this- change. Compact reasoning requires an explicit switch to Detailed. Closing- search does not collapse the revealed path.+ change. Reasoning hidden by the preference stays hidden until the user turns+ `Show thinking` on. Closing search does not collapse the revealed path.- Pending permission, question, plan/goal approval and other action cards remainreachable outside hidden process content.- Each disclosure uses its own button, `aria-expanded` and `aria-controls`; closed@@ -1449,10 +1456,11 @@ Project drag/drop follows these patterns:a multi-line draft: the bottom reserve is padding on the transcript content, sothe content is observed on its border box and the newest turn moves up withthe composer instead of sliding behind it (D287).-- A manual disclosure — whole process, activity group, tool/search/thinking item,+- A manual disclosure — process segment, activity group, tool/search/thinking item,delegate brief, or error detail — holds the reading position of the scrollerthat owns it (issue #324). Only the initiating level claims the anchor; marking- ancestors user-owned does not claim their scroll positions. The title is handed+ the containing group user-owned does not claim its scroll position. The title is+ handedto the scroller before the state changes, follow mode is left, and the scrollerrestores the title's viewport offset for every frame of the height change. Anested scroller (the delegate run dock, D302) holds its own position and passesdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 8f29a9c3b..4accdb676 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -3293,30 +3293,32 @@ identify the platform validation still needed.#### E2E-040: Nested tool activity survives transcript reload- **Preconditions**: Provider configured; project open; a turn can containprogress text, multiple search/tool/thinking items, and a failed or denied tool.-- **Steps**: 1) In Detailed, stream progress paragraph A, a multi-item search- segment, progress paragraph B, and a multi-item command segment. 2) Inspect the- open whole process and active group; manually close the active group while more- output arrives. 3) Complete the turn and inspect untouched versus user-owned- groups. 4) Open one completed group and one item, copy its output, close and- reopen the group, then open a sibling group independently. 5) Repeat with a- singleton item and with the last activity group's literal final item set to a- tool/search, thinking, failed tool, and denied tool. 6) Switch to Compact and- inspect the active-thinking, failure/recovery and completed states. 7) Remount- rows within the retained pane, then reload the renderer and reopen the session.-- **Expected**: Both modes use one whole-process disclosure and keep the trailing- answer outside it. Detailed keeps active and completed processes open; the- active multi-item group opens, then closes on completion only if untouched.- Compact starts processes/groups and all payloads closed, hides reasoning text,- and keeps an untouched active process open after a failed/denied tool through- later recovery. A singleton has no group wrapper. No item payload opens itself:- a tool/search row stays a header until the user opens it, while a final thinking- item keeps its own leaf default and never selects an earlier tool. Parent, child- and sibling choices are independent;+- **Steps**: 1) Stream progress paragraph A, a multi-item search segment,+ progress paragraph B, and a multi-item command segment with adjacent Bash rows.+ 2) Inspect the open active group; manually close it while more output arrives.+ 3) Complete the turn and inspect untouched versus user-owned groups, and confirm+ the Bash rows stay visible with every group collapsed. 4) Open one completed+ group and one item, copy its output, close and reopen the group, then open a+ sibling group independently. 5) Repeat with a singleton item and with the last+ activity group's literal final item set to a tool/search, thinking, failed tool,+ and denied tool. 6) Toggle `Show thinking` off and on and inspect the+ active-thinking, failure/recovery and completed states. 7) Remount rows within+ the retained pane, then reload the renderer and reopen the session.+- **Expected**: Chronological collapsible process segments keep the trailing answer+ outside them. The active group opens, then closes on completion only if+ untouched; completed groups otherwise start closed. Bash/run aliases are excluded+ from every process disclosure and stay visible even when every group is collapsed.+ A singleton has no group wrapper. No item payload opens itself: a tool/search row+ stays a header until the user opens it, while a final thinking item keeps its own+ leaf default and never selects an earlier tool. When `Show thinking` is off, the+ live thinking indicator stays visible while completed reasoning text and excerpts+ are hidden and empty thinking-only containers are omitted; turning it back on+ restores them. Parent, child and sibling choices are independent;closing/reopening a parent preserves descendants, and streaming/completion doesnot override user-owned choices. Retained-pane remounts preserve choices;renderer restart reapplies defaults while tool names, arguments, results and- statuses remain restored. Group/process headers show bounded running and issue- summaries without marking the whole turn failed.+ statuses remain restored. Group headers show bounded running and issue summaries+ without marking the whole turn failed.- **Specs linked**: `04-ux/01-ui-ia.md`,`04-ux/07-ui-design-system.md`, `04-ux/08-component-spec.md`,`04-ux/09-interaction-patterns.md`@@ -6689,7 +6691,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.Electron; deterministic messages/status transitions, no provider credentials.- **Steps**: Send a turn, stream partial text, stop delivering deltas, start andfinish a tool, clear/set runtime phases, resume text, then complete, stop, or- fail. Repeat in detailed and compact modes. Exercise planning, permission,+ fail. Repeat with `Show thinking` on and off. Exercise planning, permission,question and proposal waits, history reading, and switching sessions.- **Expected**: Exactly one localized, accessible tail status remains throughoutput pauses and completed-tool gaps. Runtime phases take precedence over@@ -6699,7 +6701,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.Active and assistant-error turns mount no empty action toolbar. A partialanswer has 24 CSS px between its fragment box and the status labelat the default font scale; settled non-error content retains Copy, Fork,- and Regenerate. Check detailed and compact modes. History reading and+ and Regenerate. Check the `Show thinking` preference on and off. History reading andpermission cards retain normal message padding. Ending a turn keeps pinnedfollow at the bottom while restoring the normal toolbar height. A scrolled-up reader keeps the exact text positionand scroll offset.@@ -16920,39 +16922,46 @@ plugin-form fixtures in an isolated temporary directory at runtime.- **Preconditions:** A turn with progress paragraph A, multiple searches plusthinking, progress paragraph B, multiple commands plus thinking, and a final- answer; Detailed and Compact display modes; legacy message-level transcript- search targets.-- **Steps:** In Detailed, confirm a live process starts open, let that same turn- finish without interacting, and confirm the process collapses. On a second- turn, explicitly open the completed process and confirm the choice survives- subsequent updates. Review the nested path, including independent group/item- toggles, parent close/reopen, a singleton segment, literal-final-item leaf- selection, failure/denial/recovery, retained-pane remounts and a legacy search- reveal. Repeat in Compact with permission/question/plan/goal cards, a stopped- partial answer, an assistant error and delegated child work.-- **Expected:** Both modes use one whole-process disclosure and leave the final- answer, assistant errors, stopped trailing text and pending actions outside it.- Detailed starts active processes open; untouched processes collapse at- completion, while explicit user choices persist. The active multi-item group- is open and an untouched group closes on completion. Compact starts processes- and groups closed, hides reasoning, and keeps payloads closed; an untouched- active process with a recorded failed/denied tool stays open through recovery- and closes on completion. Singletons have no group. No item payload opens- itself: a tool/search row stays closed until the user opens it, while a final- thinking item keeps its own leaf default. Parent/child/- sibling states remain independent, pane-owned user choices survive updates,- mode changes and remounts, and renderer restart reapplies defaults. Search- reveals the process and activity group that own the named message once per- request; item-level targeting is not part of this change, and Compact- reasoning requires an explicit switch to Detailed. Saved mode survives- restart and a missing/unknown setting resolves to Detailed.+ answer; the `Show thinking` preference on and off; legacy message-level+ transcript search targets.+- **Steps:** Confirm a live active group starts open, let that same turn finish+ without interacting, and confirm the group collapses. On a second turn, explicitly+ open a completed group and confirm the choice survives subsequent updates. Turn+ `Show thinking` off and confirm the live thinking indicator remains while+ completed reasoning rows and excerpts disappear and no empty thinking-only+ container is left; turn it back on and confirm the completed rows return. Collapse+ every group and confirm the Bash/run rows stay visible. Review the nested path,+ including independent group/item toggles, parent close/reopen, a singleton+ segment, literal-final-item leaf selection, failure/denial/recovery, retained-pane+ remounts, Bash rows staying standalone (including adjacent Bash rows) with their+ details closed until opened, and a legacy search reveal.+- **Expected:** Chronological collapsible process segments leave the final answer,+ assistant errors, stopped trailing text and pending actions outside them. The+ active group starts open; untouched groups collapse at completion, while explicit+ user choices persist. These group defaults do not depend on the `Show thinking`+ preference. Bash/run aliases are excluded from every process disclosure and stay+ standalone rows visible even when every group is collapsed; adjacent Bash rows+ each remain standalone and a Bash row's detail stays closed until the user opens+ it. When `Show thinking` is off, the live thinking indicator stays visible,+ completed reasoning rows and excerpts are hidden, and empty thinking-only+ containers are omitted; turning it back on restores them. Singletons have no+ group. No item payload opens itself: a tool/search row stays closed until the user+ opens it, while a final thinking item keeps its own leaf default.+ Parent/child/sibling states remain independent, pane-owned user choices survive+ updates, preference changes and remounts, and renderer restart reapplies defaults.+ Search reveals the process segment and activity group that own the named message+ once per request; item-level targeting is not part of this change, and reasoning+ hidden by the preference stays hidden until the user turns `Show thinking` on.+ Saved `showThinking` survives restart; an absent value falls back to the legacy+ `thinkingDisplayMode` (`compact` hides, `detailed`/unknown/absent shows).- **Validation scope for the 2026-09-20 change:** Nested disclosure and activitygroup presentation only; precise item-level transcript search targeting is outof scope and keeps the existing message-level search behavior.- **Automation:** `pnpm test:e2e:transcript` covers default and active-to-completedprocess disclosure behavior; `pnpm test:e2e:transcript-disclosure` verifiesmanual-open retention and viewport anchoring; `apps/desktop/test/turn-process.test.mjs`- covers default selection.+ covers process defaults and `apps/desktop/test/thinking-visibility.test.mjs`+ covers the `showThinking`/legacy resolver precedence.- **Specs:** 04-ux/06-settings-ia, 04-ux/08-component-spec,04-ux/09-interaction-patterns; ADR turn-process-and-thinking-display.diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 8982f39a2..e5fb235fa 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -52,6 +52,7 @@ This log freezes previously open questions into concrete decisions.| D656 | Quarantine appends the host keeps refusing instead of stalling the outbox | **Amend ADR 0041 / D318 / D444 / D597: an append whose `session.appendMessage` or `session.recordUsage` call fails with an error the outbox cannot classify as a duplicate message id, a `PERMISSION_DENIED:` poison row, or a foreign-key orphan is retried on a bounded backoff (5s, doubling to a 60s cap) instead of ending the flush. The fifth consecutive failure on that head moves it into an application-owned dead-letter file, `session-message-outbox.dead-letter.json`, with its payload, session id, quarantine timestamp, and host error; only the newest 256 quarantined appends are kept, and the oldest is discarded with a warn. The flush then continues with the next entry, so one refused append can no longer hold the FIFO head, fill the 1024-entry cap, or fail every session's writes. Quarantined appends are never replayed automatically, and `session.delete` drops that session's quarantined appends too. No protocol version, storage schema, or queued-outbox format change.** | A `stream did not contain valid UTF-8` append stayed at the FIFO head for 14.8 hours while `session.persistence.outbox.is.full` fired 5990 times, so every session's appends failed until restart. Only three error classes had a drain, and every other error was treated as transient forever (#1560). || D657 | Let the embedded Browser open local files outside the workspace | **Amend ADR 0170: an explicit absolute path or `file:` URL may load any existing regular local file, and a local-file page may navigate to other existing local files. Relative inputs remain workspace-rooted; HTTP(S) pages retain only the prior in-workspace file-link allowance. Missing files, directories, and remote file authorities remain blocked. `BrowserPreview` and the sidecar keep their workspace-rooted resolver. The public `pi.browser.navigate` API follows this policy under the high-risk `browser.cdp` permission. See ADR 0328, E2E-059, `04-ux/08-component-spec.md`, and `05-security/01-security.md`.** | Users need to inspect local HTML outside a project, while workspace-scoped agent file tools and remote-page navigation must retain their existing boundary (#1627). || D659 | Reopen archived projects in the sidebar | **Amend D093 / D455: successful explicit project activation clears the normalized path's renderer-local archived flag and persists it, so Open from Project archive, reopening the same folder through Add project, and opening a project session reveal the project in the home sidebar. Selecting a row for inspection and ordinary session refreshes do not alter archive state. No host/project/session storage or protocol change. See ADR 0294, E2E-264, and issue #1653.** | Reopening a project changed the active workspace but left its path-keyed archived presentation flag set, hiding it from the sidebar after the user explicitly reopened it. |+| D660 | Segmented turn process and independent thinking preference | **Supersede the `Detailed` / `Compact` display-mode behavior and the single whole-process disclosure recorded by D633 / D651 and the `turn-process-and-thinking-display` ADR: a turn renders as chronological collapsible process segments, Bash and run aliases stay outside every folded container (the turn-level process disclosure and any ordinary activity group) and remain visible even when every group is collapsed, and process/group folding defaults are independent of the thinking preference. The preference is the optional boolean `AppSettings.showThinking`; absent or non-boolean values fall back to the legacy `thinkingDisplayMode` field (`compact` hides, `detailed`/unknown/absent shows), which is retained only for persisted-settings compatibility. `showThinking` joins the portable application fields so it synchronizes like the legacy field; no other host protocol, persistence schema, permission, or plugin contract change. See the amended ADR, `04-ux/06-settings-ia.md`, `04-ux/08-component-spec.md`, `04-ux/09-interaction-patterns.md`, and E2E-CHAT-turn-process-and-thinking-display.** | One flat container left long tool/search runs hard to scan and forced reasoning visibility and process folding into the same two-valued switch; an independent boolean plus always-visible Bash rows keeps shell-heavy turns readable without hiding the answer. |## B. Secondary implementation defaults@@ -7684,3 +7685,32 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.E2E-PROVIDER-custom-endpoint-session-identity. See issue #1634,`03-runtime/02-agent-runtime.md` §6.3, and`03-runtime/11-provider-model-system.md`.++## 2026-10-16 — Segmented turn process and independent thinking preference (D660)++- D660 supersedes the `Detailed` / `Compact` display-mode behavior and the single+ whole-process disclosure recorded by D633 / D651 and the+ `turn-process-and-thinking-display` ADR. A turn now renders as chronological+ collapsible process segments; the trailing answer, assistant errors, stopped+ trailing text, and pending action surfaces stay outside them.+- Bash and run aliases render as standalone rows outside every folded container —+ neither the turn-level process disclosure nor an ordinary activity group — and+ stay visible even when every group is collapsed. Adjacent Bash rows remain+ separate, and a Bash row's detail stays closed until the user opens it.+- Group folding defaults are unified and independent of the thinking preference:+ the active group opens and closes on completion only if untouched, other+ completed groups start closed, and an untouched active group with a recorded+ failed or denied tool stays open through later recovery.+- The preference is the optional boolean `AppSettings.showThinking`. When false,+ the live thinking indicator stays visible while completed thinking rows and+ excerpts are hidden and empty thinking-only containers are omitted; the stored+ reasoning is retained. Absent or non-boolean values fall back to the legacy+ `thinkingDisplayMode` field (`compact` hides, `detailed`/unknown/absent shows),+ which is retained only for persisted-settings compatibility and is no longer+ exposed in the UI.+- `showThinking` joins the portable application fields so it synchronizes like the+ legacy field; no other host protocol, persistence schema, permission, or plugin+ contract change. Covered by `apps/desktop/test/thinking-visibility.test.mjs` and+ the i18n catalog tests. See the amended ADR, `04-ux/06-settings-ia.md`,+ `04-ux/08-component-spec.md`, `04-ux/09-interaction-patterns.md`, and+ E2E-CHAT-turn-process-and-thinking-display.diff --git a/docs/superpowers/specs/2026-09-20-nested-thinking-process-disclosure-design.md b/docs/superpowers/specs/2026-09-20-nested-thinking-process-disclosure-design.mdindex 8ef9d3413..fe6dca4fc 100644--- a/docs/superpowers/specs/2026-09-20-nested-thinking-process-disclosure-design.md+++ b/docs/superpowers/specs/2026-09-20-nested-thinking-process-disclosure-design.md@@ -1,5 +1,13 @@# Nested Thinking and Tool Process Disclosure+> **Archive note (2026-10-16).** This dated design is a historical proposal, kept+> for context. Its `thinkingDisplayMode: detailed | compact` setting and single+> whole-process container are superseded by D660 and the amended+> [ADR turn-process-and-thinking-display](../../adr/turn-process-and-thinking-display.md):+> the process is now segmented, Bash/run aliases stay outside every folded+> container, and reasoning visibility is the independent boolean+> `AppSettings.showThinking` with a legacy `thinkingDisplayMode` fallback.+## Status and scope- Status: Proposed for review; implementation is not authorized by this document.diff --git a/docs/zh-CN/adr/turn-process-and-thinking-display.md b/docs/zh-CN/adr/turn-process-and-thinking-display.mdindex e5e1feb91..afc0f3194 100644--- a/docs/zh-CN/adr/turn-process-and-thinking-display.md+++ b/docs/zh-CN/adr/turn-process-and-thinking-display.md@@ -4,7 +4,7 @@- 状态:已接受- 日期:2026-09-17-- 修订:2026-09-27+- 修订:2026-10-16- Issues:#510、#461- 修订对象:D071、[ADR 0242](/adr/0242-delta-only-streaming-updates)@@ -17,50 +17,65 @@## 决策-两种显示模式都把每个已加载的助手回合条目投影为一个“回合过程”披露区和其后的最终-回答。思考、工具和中间进度文字按原顺序保留在过程中。流式输出时,暂定为回答的末尾-助手文字保持可见;如果随后出现工具或思考活动,该文字会移入过程,但不会改写已存-消息。`UiMessage` 没有语义化的最终回答标记,因此渲染器不根据措辞猜测。用户消息、-系统消息和压缩分隔线继续保留原有回合边界。+所有已加载的助手回合条目都使用同一套回合过程展示:投影为按时间顺序排列、可折叠的+过程片段,以及其后的最终回答。思考、工具和中间进度文字跨这些片段按原顺序保留。流式+输出时,暂定为回答的末尾助手文字保持可见;如果随后出现工具或思考活动,该文字会移入+过程,但不会改写已存消息。`UiMessage` 没有语义化的最终回答标记,因此渲染器不根据+措辞猜测。用户消息、系统消息和压缩分隔线继续保留原有回合边界。-过程包含三个相互独立的披露层级:整个回合过程、普通活动组和单项详情。普通活动组-包含两个进度段落之间的一段连续工具、搜索或思考活动,并且仅在当前模式下至少有两个-可见项时出现。单个工具、搜索或思考直接使用自身披露;紧凑模式隐藏的思考不会制造-多余的组层级。现有 Task 拓扑仍是其片段的容器,不会在普通活动组中重复渲染。+过程是分段的,而不是一个扁平容器。非 Bash 活动形成普通活动组:两个进度段落或 Bash 行+之间的一段连续工具、搜索或思考活动,并且仅在当前思考偏好下至少有两个可见项时出现。+单项活动直接使用自身披露;被隐藏的思考不会制造多余的组包装。现有 Task 拓扑仍是其片段+的容器,不会在普通活动组中重复渲染。-详细模式下,活动中的整个过程默认展开。回合完成后,未操作的整体过程默认收起;用户-明确选择的状态继续生效。拥有当前执行片段的普通活动组运行时默认展开,仅在用户未操作-时于完成后收起;其他已完成普通活动组默认收起。紧凑模式下过程和普通活动组默认收起,-但只要活动回合中记录过失败或被拒工具,尚未被用户接管的过程就会在后续恢复期间保持-展开,并在回合完成后收起。紧凑模式下所有工具/搜索载荷均默认收起,不渲染推理正文或-摘要,仅保留活动思考指示器,也不会留下空的已完成纯思考容器。+Bash 和 run 别名被排除在所有过程披露之外——既不属于回合级过程披露,也不属于普通活动组+——而是作为独立行渲染,即使所有组都收起也保持可见。相邻的 Bash 行各自保持独立,且+Bash 行的详情在用户手动打开之前保持收起。进度段落之间的其他操作仍会形成可按时间顺序+折叠的活动组。-本决策最初引入的叶子默认值后来被移除。两种模式下条目载荷都不会自动展开:工具调用、-托管搜索或计划行在用户打开之前始终只是标题行,无论它位于活动组的哪一项。组与整体过程-的默认展开不变,打开一个已收起的祖先仍会恢复已保留的条目选择,不会展开所有后代。+活动组的折叠默认值是统一的,不依赖思考偏好。拥有当前执行片段的普通活动组默认展开,+仅在用户未操作时于完成后收起;其他已完成组默认收起。只要活动组中记录过失败或被拒工具,+尚未被用户接管的活动组就会在后续恢复期间保持展开,并在回合完成后收起。无论任何组是否+收起,Bash 行都保持可见。++思考偏好是一个布尔值 `showThinking`。当它为 false 时,活动思考指示器保持可见,而已完成+的思考行和摘要会被隐藏,空的纯思考容器会被省略;已存推理仍会保留,因此重新打开该偏好+会恢复已完成的思考行和摘要。被隐藏的思考不会制造空的组包装。++本决策早先引入的叶子默认值后来被移除。条目载荷都不会自动展开:工具调用、托管搜索或+计划行在用户打开之前始终只是标题行,无论它位于活动组的哪一项,且与思考偏好无关。+组默认值不变,打开一个已收起的祖先仍会恢复已保留的条目选择,不会展开所有后代。每个标题只切换自己的层级。父子状态彼此独立:收起父级会保留后代选择,重新展开会恢复-这些选择,同级组不是互斥手风琴。用户操作某个条目时,会把所属组和过程标记为用户接管,-但不会切换祖先;完成事件不得收起包含用户已展开、聚焦或选择内容的容器。只要所属的-保留会话窗格仍存在,手动选择就跨流式更新、完成、模式切换、单项变组和行重新挂载保留。-窗格淘汰、会话删除或渲染器重启会释放这些展示状态;它们不写入消息或宿主设置。--搜索和导航只展开目标所需的祖先路径:过程,以及拥有该消息的活动组。条目级精确定位不在本次范围内,各行详情仍由各自的折叠控制。同一请求重新渲染时,不会反复覆盖用户之后的手动收起。紧凑模式中的推理仍保持隐藏,-同一请求重新渲染时,不会反复覆盖用户之后的手动收起。紧凑模式中的推理仍保持隐藏,-直到用户选择详细模式。助手错误、中止后的末尾部分回答、权限/提问/计划/目标决策及-其他待处理操作面必须位于隐藏过程之外,无需展开过程即可操作。--“设置 -> AI -> 默认项”继续使用可选的 `thinkingDisplayMode` 设置,取值为-`detailed | compact`;缺失或未知值按详细模式处理。该字段只改变展示,不改变提供商-思考级别、运行时或模型上下文、已存推理、导出、权限、执行或复制载荷。过程标题使用已-记录的计时、直接工具/搜索计数、运行状态和问题计数;不会重复计算委派子任务,也不会-把单个失败工具误报为整个助手回合失败。+这些选择,同级组不是互斥手风琴。用户操作某个条目时,会把所属组标记为用户接管,但不会+切换该组;完成事件不得收起包含用户已展开、聚焦或选择内容的容器。只要所属的保留会话+窗格仍存在,手动选择就跨流式更新、完成、偏好切换、单项变组和行重新挂载保留。窗格淘汰、+会话删除或渲染器重启会释放这些展示状态;它们不写入消息或宿主设置。++搜索和导航只展开目标所需的祖先路径:拥有该消息的过程片段和活动组。条目级精确定位不在+本次范围内,各行详情仍由各自的折叠控制。同一请求重新渲染时,不会反复覆盖用户之后的+手动收起。被偏好隐藏的推理会保持隐藏,直到用户打开 `showThinking`。助手错误、中止后的+末尾部分回答、权限/提问/计划/目标决策及其他待处理操作面必须位于隐藏过程之外,+无需展开过程即可操作。++“设置 -> AI -> 默认项”提供一个 `Show thinking` 布尔开关,以可选的 `showThinking`+`AppSettings` 字段持久化。缺失或非布尔值会回退到旧版 `thinkingDisplayMode` 字段:+显式 `compact` 隐藏推理,而 `detailed`、未知值或缺失值都显示推理。旧字段为持久化设置的+兼容性而保留,不再在界面中暴露。该偏好只改变展示,不改变提供商思考级别、运行时或模型+上下文、已存推理、导出、权限、执行或复制载荷,也不控制过程片段或活动组的折叠。过程标题+使用已记录的计时、直接工具/搜索计数、运行状态和问题计数;不会重复计算委派子任务,+也不会把单个失败工具误报为整个助手回合失败。## 结果-- 两种模式均提供整体过程披露,同时把最终回答和待处理操作保留在过程之外。-- 详细模式在运行中展示整个过程,未操作的已完成过程默认收起,保留用户明确选择及字面- 最后一项的叶子默认值。+- 按时间顺序排列的可折叠过程片段让最终回答和待处理操作保持可达,并且即使所有组都收起,+ Bash/run 行也保持可见。+- 活动组的折叠默认值统一:运行中的工作保持可见,未操作的已完成组默认收起,+ 无论思考偏好如何都保留用户明确的披露选择。+- 当 `showThinking` 为 false 时,活动指示器保持可见,而已完成的推理行和摘要被隐藏。+ 已存推理仍会保留,重新打开偏好时重新出现。+- Bash 和 run 别名作为独立行位于所有过程披露之外,因此命令密集的回合无需把相邻命令+ 折叠在一起即可浏览。- 披露记忆是以稳定回合、组和条目标识为键的窗格展示状态,不是持久化转录契约,也不属于中央工作流 store。- 只对已加载的转录条目分组;不会重建未加载历史,也不会跨压缩边界合并回合。@@ -73,3 +88,7 @@2026-09-27 修订由 `apps/desktop/test/turn-process.test.mjs` 覆盖默认选择,并由`pnpm test:e2e:transcript-disclosure` 在真实 Chromium 中验证运行中到完成时的自动收起和用户展开状态保留。+2026-10-16 修订由 `apps/desktop/test/thinking-visibility.test.mjs` 覆盖+`showThinking`/旧版 `thinkingDisplayMode` 的解析优先级,并由 i18n 目录测试覆盖新增的+`settings.showThinking` 文案。界面、解析器与 E2E 场景在集成候选上验证;同步后的场景文本见+E2E-CHAT-turn-process-and-thinking-display。diff --git a/docs/zh-CN/spec/03-runtime/04-data-storage.md b/docs/zh-CN/spec/03-runtime/04-data-storage.mdindex e0d641bdb..5b8bc49f7 100644--- a/docs/zh-CN/spec/03-runtime/04-data-storage.md+++ b/docs/zh-CN/spec/03-runtime/04-data-storage.md@@ -1229,6 +1229,11 @@ outbox 排空。渲染器侧的停止绝不重写已有已开始回复的转录1–1,000,000 的整数范围。因此现有数据库会在读取时延迟获得默认值,不需要破坏性迁移或第二个设置存储。+应用设置 JSON 还可选存储布尔值 `showThinking`,用于转录中的推理可见性。它是可移植的+应用偏好,会像旧字段一样跨设备同步。缺失值回退到旧版 `thinkingDisplayMode` 字段+(`compact` 隐藏,`detailed`/未知/缺失显示);该旧字段仅为持久化设置兼容性保留,+并作为该回退来源。这些新增展示偏好既不重写已存推理,也不改变数据库 schema。+应用设置 JSON 可能仍包含旧版本写入的提示词增强键。为支持回退和降级,宿主保留这些值,但不会再把它们作为有效偏好读取或写入。用户安装并授权独立的`pi.prompt-enhancement` 插件时,Electron 会将有效旧值一次性复制到插件私有设置中diff --git a/docs/zh-CN/spec/04-ux/06-settings-ia.md b/docs/zh-CN/spec/04-ux/06-settings-ia.mdindex 985912332..88b7a4b58 100644--- a/docs/zh-CN/spec/04-ux/06-settings-ia.md+++ b/docs/zh-CN/spec/04-ux/06-settings-ia.md@@ -104,7 +104,7 @@都以相同方式展开。关闭时的触发器按当前文案收缩,不超过设置控件列。- **默认项**卡:主机支持的默认运行模式(Agent / Plan / Goal)、命令 Shell 选择、链接打开目标、上下文用量显示(剩余或已用)、- 思考显示模式、回车发送控制、无尽重试开关和大段文本粘贴阈值。无尽重试默认关闭;开启后网络/临时提供商故障会持续到成功,+ 显示思考开关、回车发送控制、无尽重试开关和大段文本粘贴阈值。无尽重试默认关闭;开启后网络/临时提供商故障会持续到成功,但停止按钮仍可取消回合,开启期间可能持续消耗 API 用量。链接打开目标默认使用工作面板浏览器,可将对话、会话记录和插件页的 HTTP(S) 点击路由到系统浏览器。插件/设置页若目标是工作面板,会先回到对话再打开(不记入导航栈),避免被遮罩挡住;没有会话时才回退到@@ -117,13 +117,13 @@`composer.transform` 权限时才会显示。宿主不包含提示词增强设置卡,也不会默认安装独立的`pi.prompt-enhancement` 插件。插件设置在「插件」页编辑;旧提示词增强偏好的单次迁移见`04-ux/12-prompt-enhancement.md`。-- **思考显示模式**使用菜单选择器,提供详细(默认)和紧凑。两种模式都使用一个- 整体过程披露。详细模式默认展开过程、显示推理、展开活动中的多项活动组,并在用户- 未操作时于组完成后将其收起;紧凑模式默认收起过程与活动组,保持工具/搜索载荷- 关闭,只显示活动思考指示器并隐藏已完成推理。单项活动在两种模式下都直接使用自身- 披露。全局偏好以 `thinkingDisplayMode` 持久化到宿主设置;缺失值使用详细模式。- 它只影响展示,不改变模型推理配置;显式披露选择在已挂载的会话窗格内保留。设置- 搜索会索引该行和两种模式名称。+- **显示思考**是一个开关,以可选的 `showThinking` 布尔值持久化到宿主设置。关闭时+ 仍显示活动思考指示器,并隐藏已完成的推理行和摘要;已存推理仍会保留,重新打开时+ 重新出现。它只影响展示,不改变模型推理配置,也不控制回合过程或活动组的折叠:+ 无论开关如何,运行中的过程默认展开,未操作的已完成过程默认收起。旧版+ `thinkingDisplayMode` 字段(`detailed` / `compact`)仅为持久化设置兼容性保留,+ 不再在界面暴露;缺失或未知值显示推理,显式 `compact` 隐藏推理。设置搜索会索引+ 该行。- 语音绑定(`AppSettings.speech`)**不属于设置页面**(ADR 0291)。宿主仍保留语音能力与`speech/*` IPC,供插件和已存绑定使用;这里不再提供转写/朗读的服务、协议、模型或音色选择,设置搜索也不再索引语音相关键。diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.mdindex a2498e2dd..8d328ed34 100644--- a/docs/zh-CN/spec/04-ux/08-component-spec.md+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md@@ -1056,35 +1056,37 @@ SESSIONS [msg+][↕]### 回合过程与思考展示-详细和紧凑模式都会把每个已加载的助手回合投影为一个整体过程披露,其中按转录顺序-包含推理、工具、托管搜索和中间进度文字。末尾回答在披露之外流式显示;后续活动可以-把暂定回答重新归入过程,但不会改写已存消息。助手错误和中止后的末尾部分回答也留在-过程之外。用户/系统消息及压缩边界不变。--过程内的普通活动组表示两个进度段落之间的一段连续工具、搜索或思考活动。只有当前-模式下至少有两个可见项时才显示组标题。单项活动直接使用自身披露,紧凑模式隐藏的-思考不会制造空包装,委派工作继续使用现有 Task 拓扑作为容器。--详细模式下,活动过程默认展开;回合结束后,未操作的过程默认收起,用户明确选择的状态-继续生效。拥有当前执行片段的普通活动组默认展开,完成时仅在用户未操作的情况下收起;-其他已完成组默认收起。紧凑模式下过程和普通活动组默认收起;若活动回合记录过失败或-被拒工具,尚未被用户接管的过程会在后续成功恢复期间保持展开,并在回合完成后收起。-组标题显示计数、运行状态和问题计数,但不会把失败子项当作整个回合失败。--两种模式都不会自动展开条目载荷:工具调用、托管搜索或计划卡片行在用户打开其披露之前-始终只是标题行。活动组与整体过程保留各自的自动展开默认值,因此进行中的回合仍会展示-自己的工作。紧凑模式保持所有工具/搜索载荷关闭,不显示推理正文或摘要,只保留活动思考-指示器。--整个过程、活动组和条目是相互独立的控件。收起祖先会保留下级选择,重新展开时恢复;-展开父级不会展开所有后代。用户操作子项时会接管祖先但不切换祖先,因此完成事件不能-收起包含已展开、聚焦或选中内容的容器。选择以稳定回合/组/条目标识保存在会话窗格-内,跨模式切换和行重新挂载保留;窗格淘汰、会话删除或渲染器重启后重新应用默认值,-不会写入消息或设置。--搜索和导航只展开拥有目标消息的过程与活动组,并且每个显示请求只-应用一次。紧凑模式中的推理在用户切换到详细模式前保持隐藏。权限、提问、计划/目标-审批及其他待处理操作卡位于隐藏过程之外,始终可达。参见+所有已加载的助手回合都使用同一套回合过程展示,投影为按时间顺序排列、可折叠的过程片段,+以及其后的最终回答。推理、工具、托管搜索和中间进度文字跨这些片段按转录顺序保留。末尾+回答在过程之外流式显示;后续活动可以把暂定回答重新归入过程,但不会改写已存消息。助手+错误和中止后的末尾部分回答也留在过程之外。用户/系统消息及压缩边界不变。++过程内的普通活动组表示两个进度段落或 Bash 行之间的一段连续工具、搜索或思考活动。只有在+当前思考偏好下至少有两个可见项时才显示组标题。单项活动直接使用自身披露,被隐藏的思考+不会制造空包装,委派工作继续使用现有 Task 拓扑作为容器。Bash 和 run 别名被排除在所有+过程披露之外——既不属于回合级过程披露,也不属于普通活动组——而是作为独立行渲染,即使+所有组都收起也保持可见;相邻的 Bash 行各自保持独立,其详情在用户打开之前保持收起。++拥有当前执行片段的普通活动组在回合运行时默认展开,完成时仅在用户未操作的情况下收起;+其他已完成组默认收起。若活动组记录过失败或被拒工具,尚未被用户接管的活动组会在后续成功+恢复期间保持展开,并在回合完成后收起。这些组默认值统一,不依赖思考偏好。无论任何组是否+收起,Bash 行都保持可见。组标题显示计数、运行状态和问题计数,但不会把失败子项当作整个+回合失败。++条目载荷都不会自动展开:工具调用、托管搜索或计划卡片行在用户打开其披露之前始终只是+标题行,包括 Bash 行——其详情在用户打开之前保持收起。活动组保留各自的自动展开默认值,+因此进行中的回合仍会展示自己的工作。当 `Show thinking` 偏好关闭时,活动思考指示器保持+可见,而已完成的推理行和摘要被隐藏,空的纯思考容器被省略;已存推理仍会保留,重新打开+偏好时重新出现。++活动组和条目是相互独立的控件。收起祖先会保留下级选择,重新展开时恢复;展开父级不会+展开所有后代。用户操作子项时会接管其所属组但不切换该组,因此完成事件不能收起包含已+展开、聚焦或选中内容的容器。选择以稳定回合/组/条目标识保存在会话窗格内,跨偏好切换+和行重新挂载保留;窗格淘汰、会话删除或渲染器重启后重新应用默认值,不会写入消息或设置。++搜索和导航只展开拥有目标消息的过程片段和活动组,并且每个显示请求只应用一次。条目级精确+定位不在本次范围内。被偏好隐藏的推理会保持隐藏,直到用户打开 `Show thinking`。权限、+提问、计划/目标审批及其他待处理操作卡位于隐藏过程之外,始终可达。参见[ADR turn-process-and-thinking-display](/zh-CN/adr/turn-process-and-thinking-display)。### 7.2 解剖学@@ -1112,7 +1114,7 @@ SESSIONS [msg+][↕]| 会话转换 | 热目标面板立即以其保留的内容和位置被揭示。若它仍在运行或仍持有尚未刷入的已完成回复,其实时渲染器快照在持久化再验证中保留。冷目标让可见面板在一条细进度轨道下停留在它自己的会话上,直到目标提交;没有任何内容被调暗,隐藏的面板保持挂载且惰性,当前流更新不会延迟 || 流媒体 | 追加新令牌;仅在固定到底部时自动滚动 || 回合开始 | 发送/重试/重新生成重新固定跟随模式并跳转到底部 |-| 仅思考流式输出 | 详细模式按活动思考策略显示条目;紧凑模式只显示状态指示器。用户手动收起后,后续推理不会重新打开该层级;没有空回答气泡,底部状态继续标明回合仍在运行 |+| 仅思考流式输出 | 转录打开;最新思考披露展开,除非用户已接管;没有空回答气泡,底部状态继续标明回合仍在运行 || 运行中兜底 | 未知具体运行时阶段且不在规划状态时,整轮显示带跳动圆点的紧凑 Working 行,包括部分输出暂停和工具完成后的空档 || 运行中规划 | 整轮在同一位置显示带跳动圆点的紧凑规划/目标行,具体运行时阶段优先;等待用户操作或回合结束时隐藏。Composer 模式芯片脉冲 || 空闲 | 可滚动;没有自动滚动 |@@ -1520,18 +1522,19 @@ sorting, new settings, persistence, or host protocol is introduced.参数提示、状态和结果的可读呈现。遵循D071并且故意不是一张高级卡。-两个进度段落之间的一段连续工具、搜索或思考活动,仅在有两个及以上可见项时成为普通-处理组。单项活动直接使用自身披露,Task 拓扑继续使用原有容器。回合活动期间,拥有-当前执行片段的普通组在详细模式下默认展开,在紧凑模式下默认收起;详细模式的未操作-组在完成时自动收起。两种模式都不会自动展开条目载荷:工具调用、托管搜索或计划行在用-户打开之前始终只是标题行,无论它位于活动组的哪一项。紧凑模式保持所有工具/搜索载荷-关闭。+两个进度段落或 Bash 行之间的一段连续工具、搜索或思考活动,仅在当前思考偏好下有两个及+以上可见项时成为普通处理组。单项活动直接使用自身披露,Task 拓扑继续使用原有容器。+Bash 和 run 别名被排除在所有过程披露之外——既不属于回合级过程披露,也不属于普通组——+而是作为独立行渲染,即使所有组都收起也保持可见;相邻的 Bash 行各自保持独立。回合活动+期间,拥有当前执行片段的普通组默认展开;未操作的组在完成时自动收起。这些组默认值不依赖+思考偏好。条目载荷都不会自动展开:工具调用、托管搜索或计划行在用户打开之前始终只是+标题行,无论它位于活动组的哪一项,包括详情在打开前保持收起的 Bash 行。组标题在活动时显示 `Processing · 12s`,完成后显示 `Processed for 12s`,并提供有界条目与问题计数。展开后显示有序活动行及其相互独立的结果披露。失败子项仍在自己的ToolCallRow 上显示错误,但不会让组或整个回合成为终端失败;终端 Agent 错误仍由助手-错误或 TurnOutcomeCard 表面拥有。用户操作组、条目或收起栏时会接管该层级及其祖先,-但不切换祖先,因此流式更新和完成不会覆盖选择,也不会收起聚焦或选中的内容。+错误或 TurnOutcomeCard 表面拥有。用户操作组、条目或收起栏时会接管该层级及其所属组,+但不切换该组,因此流式更新和完成不会覆盖选择,也不会收起聚焦或选中的内容。### 9.2 解剖学@@ -1550,11 +1553,13 @@ ToolCallRow 上显示错误,但不会让组或整个回合成为终端失败- 领先的 Lucide 图标反映了操作类型:文件、文件夹、搜索、编辑、终端、Web 或通用工具。-- 多项组标题拥有经过时间以及条目和问题计数,并在完成后保留在转录中。详细模式下- 活动组默认展开,完成时仅在用户未操作时收起;其他已完成组默认收起。紧凑模式的组- 默认收起。单项活动没有组标题。-- 工具/搜索载荷在两种模式下都保持收起,直到用户打开;没有任何行会自动展开,因此+- 多项组标题拥有经过时间以及条目和问题计数,并在完成后保留在转录中。活动组默认展开,+ 完成时仅在用户未操作时收起;其他已完成组默认收起。这些默认值不依赖思考偏好。单项+ 活动没有组标题。+- 工具/搜索载荷保持收起,直到用户打开;没有任何行会自动展开,因此最后一项为思考时绝不会选择更早的工具。活动思考遵循自身披露策略,绝不会展开同级载荷。+- Bash 和 run 行作为独立行渲染,位于所有过程披露之外,即使所有组都收起也保持可见;+ 相邻的 Bash 行保持独立。- 处理组跨越完整可用的辅助列,因此扩展即使标头或有效负载很短,结果详细信息也会保持可用宽度。- 可见标签是自然语言操作(`Read`、`Ran`、`Searched`),@@ -1610,17 +1615,17 @@ pi-ai 结果信封携带 `details` 中的结构化有效负载并重复它| 状态 | 标头处理 | 扩展内容 ||---|---|---|-| 运行中 | 渐进动作配可读文字与脉冲标记;`run` 行还显示旋转器,并让 `Working…` 旁状态点脉冲 | 详细模式展开活动的多项组;没有条目载荷会自动展开。紧凑载荷保持关闭;活动思考遵循自身指示器/披露策略 |+| 运行中 | 渐进动作配可读文字与脉冲标记;`run` 行还显示旋转器,并让 `Working…` 旁状态点脉冲 | 活动多项组默认展开;没有条目载荷会自动展开;活动思考遵循自身指示器/披露策略 || 成功 | 过去时动作加结果芯片;除 `run` 行状态点和 `Done` 外不显示绿色成功徽标 | 先显示结果块,再显示尚未呈现的参数;未操作的活动组在完成时收起,手动组与条目选择保留 || 错误 | 过去时动作加紧凑危险状态;详情默认收起,只在用户请求时展开。只要命令退出码非零,`run` 行就处于此状态,不受调用报告影响(D227) | 先显示错误说明,再显示参数 || 被拒绝 | 静音 `Denied` 状态;载荷在请求前保持关闭 | 可用时显示权限结果 |### 9.6 互动-- 单击条目只展开/收起该结果载荷。紧凑模式载荷默认关闭。两种模式下都没有载荷会自动- 展开,因此只有用户打开的那一行是展开的;失败和被拒行行为相同。-- 单击处理标题只展开/收起该有序活动列表。详细模式的活动组默认展开,完成时仅在用户- 未操作的情况下收起;其他已完成组和紧凑模式组默认收起。展开组不会展开所有条目。+- 单击条目只展开/收起该结果载荷。载荷默认关闭。没有载荷会自动展开,因此只有用户打开+ 的那一行是展开的;失败和被拒行行为相同。+- 单击处理标题只展开/收起该有序活动列表。活动组默认展开,完成时仅在用户未操作的情况下+ 收起;其他已完成组默认收起。展开组不会展开所有条目。- 单击或用键盘激活展开思考、工具详情、委派工作或处理步骤旁的左侧栏,只收起所属披露,不改变相邻状态。条目操作会把所属组和整个过程标记为用户接管,但不会切换祖先;之后的流式更新或完成不能自动反转这些状态。diff --git a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md b/docs/zh-CN/spec/04-ux/09-interaction-patterns.mdindex 119c557b5..d6df92122 100644--- a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md+++ b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md@@ -699,23 +699,25 @@- 工具活动以轻量的收起条目开始。失败和被拒调用在行标题中保留问题状态,载荷不会自动展开。-- 两种模式都为每个已加载的助手回合提供一个整体过程披露,其中包含思考、工具、托管- 搜索和中间进度文字;末尾回答、助手错误和中止后的末尾文字位于过程之外。-- 连续活动片段仅在当前模式下至少有两个可见项时获得组披露。进度文字结束该片段,- 单项活动直接使用自身披露,紧凑模式隐藏的思考不会制造多余组;Task 拓扑保持独立。-- 详细模式下,活动中和已完成的整体过程默认展开。活动普通组默认展开,完成时仅在用户- 未操作的情况下收起;其他已完成组默认收起。紧凑模式下过程与组默认收起,但活动回合- 只要记录过失败或被拒工具,未接管的外层过程会在恢复期间保持展开,并在完成后收起。-- 两种模式下都不会自动展开条目载荷:工具调用、托管搜索或计划卡片行在用户打开之前- 始终只是标题行,包括最后一个活动组的字面最后一项。组与整体过程的默认展开不变,因此- 最后一项为思考时绝不会向前回扫。紧凑模式保持所有条目载荷关闭,隐藏推理正文与摘要,- 只保留活动思考指示器。-- 激活过程、组或条目标题只切换该层级。收起父级会保留子级状态,重新展开时恢复,+- 统一的展示为每个已加载的助手回合提供按时间顺序排列的可折叠过程片段,其中包含思考、+ 工具、托管搜索和中间进度文字;末尾回答、助手错误和中止后的末尾文字位于过程之外。+- 连续活动片段仅在当前思考偏好下至少有两个可见项时获得组披露。进度文字或 Bash 行结束+ 该片段,单项活动直接使用自身披露,被隐藏的思考不会制造多余组;Task 拓扑保持独立。+ Bash 和 run 别名被排除在所有过程披露之外——既不属于回合级过程披露,也不属于组——+ 而是作为独立行渲染,即使所有组都收起也保持可见;相邻的 Bash 行各自保持独立。+- 活动普通组默认展开,完成时仅在用户未操作的情况下收起;其他已完成组默认收起,而记录过+ 失败或被拒工具的未接管活动组会在恢复期间保持展开。这些组默认值不依赖思考偏好。无论+ 任何组是否收起,Bash 行都保持可见。+- 条目载荷都不会自动展开:工具调用、托管搜索或计划卡片行在用户打开之前始终只是标题行,+ 包括最后一个活动组的字面最后一项。组的默认展开不变,因此最后一项为思考时+ 绝不会向前回扫。当 `Show thinking` 关闭时,所有条目载荷保持关闭,已完成的推理正文与+ 摘要被隐藏,同时活动思考指示器保持可见;已存推理仍会保留,重新打开偏好时重新出现。+- 激活组或条目标题只切换该层级。收起父级会保留子级状态,重新展开时恢复,同级组彼此独立;展开父级不是“全部展开”。-- 手动操作条目会把所属组和过程标记为用户接管,但不会切换祖先。流式更新和完成不会+- 手动操作条目会把所属组标记为用户接管,但不会切换该组。流式更新和完成不会重新打开手动收起,也不会收起包含用户已展开、聚焦或选中内容的容器。只要保留会话- 窗格仍存在,选择就跨模式切换、单项变组和重新挂载保留。-- 搜索和导航只打开拥有目标消息的过程与活动组,每个显示请求仅应用一次;条目级精确定位不在本次范围内。紧凑模式中的推理需要显式切换到详细;关闭搜索不会收起已显示路径。+ 窗格仍存在,选择就跨偏好切换、单项变组和重新挂载保留。+- 搜索和导航只打开拥有目标消息的过程片段与活动组,每个显示请求仅应用一次;条目级精确定位不在本次范围内。被偏好隐藏的推理会保持隐藏,直到用户打开 `Show thinking`;关闭搜索不会收起已显示路径。- 待处理权限、提问、计划/目标审批及其他操作卡位于隐藏过程之外,始终可达。- 每个披露使用独立按钮、`aria-expanded` 和 `aria-controls`;收起的后代离开 Tab 与无障碍遍历顺序。减少动态效果会禁用非必要标记和 V 形动画。diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex 247104dd8..05dd0767c 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -1323,22 +1323,22 @@ task-candidate E2E 从请求工作树运行,但使用主工作区已经准备#### E2E-040:嵌套工具活动在转录重新加载后仍然存在- **先决条件**:已配置提供商并打开项目;回合可以包含进度文字、多个搜索/工具/思考条目,以及失败或被拒工具。-- **步骤**:1) 在详细模式流式输出进度段落 A、多项搜索片段、进度段落 B 和多项命令- 片段。2) 检查已展开的整体过程和活动组;在更多输出到达时手动收起活动组。3) 完成- 回合并比较未操作与用户接管的组。4) 展开一个已完成组和其中一个条目,复制输出,- 收起并重新展开该组,再独立打开同级组。5) 分别检查单项片段,以及最后一个活动组的- 字面最后一项为工具/搜索、思考、失败工具和被拒工具。6) 切换到紧凑模式,检查活动- 思考、失败后恢复及完成状态。7) 在保留窗格内重新挂载行,然后重载渲染器并重新打开- 会话。-- **预期**:两种模式都使用一个整体过程披露,末尾回答位于其外。详细模式的活动中和- 已完成过程默认展开;活动多项组展开,并且只在用户未操作时于完成后收起。紧凑模式- 的过程、组和所有载荷默认收起,推理正文隐藏;记录过失败/被拒工具的未操作活动过程- 会在后续恢复期间保持展开。单项没有组包装。没有任何条目载荷会自动展开:工具/搜索- 行在用户打开之前保持标题行,最后一个活动组的字面最后一项也不例外,而思考项保留- 自身的叶子默认值。父级、子级和同级选择彼此独立;- 流式更新和完成不会覆盖用户接管的选择。保留窗格中的重新挂载保留选择;渲染器重启- 重新应用默认值,但工具名称、参数、结果和状态仍会恢复。组/过程标题显示有界运行和- 问题摘要,不会把整个回合标记为失败。+- **步骤**:1) 流式输出进度段落 A、多项搜索片段、进度段落 B,以及带相邻 Bash 行的+ 多项命令片段。2) 检查已展开的活动组;在更多输出到达时手动收起该组。3) 完成回合并+ 比较未操作与用户接管的组,确认所有组都收起时 Bash 行仍保持可见。4) 展开一个已完成组+ 和其中一个条目,复制输出,收起并重新展开该组,再独立打开同级组。5) 分别检查单项片段,+ 以及最后一个活动组的字面最后一项为工具/搜索、思考、失败工具和被拒工具。6) 关闭并重新+ 打开 `Show thinking`,检查活动思考、失败后恢复及完成状态。7) 在保留窗格内重新挂载行,+ 然后重载渲染器并重新打开会话。+- **预期**:按时间顺序排列的可折叠过程片段把末尾回答留在其外。活动组展开,并且只在用户+ 未操作时于完成后收起;其他已完成组默认收起。Bash/run 别名被排除在所有过程披露之外,+ 即使所有组都收起也保持可见。单项没有组包装。没有任何条目载荷会自动展开:工具/搜索行+ 在用户打开之前保持标题行,最后一个活动组的字面最后一项也不例外,而思考项保留自身的+ 叶子默认值。当 `Show thinking` 关闭时,活动思考指示器保持可见,已完成的推理正文与摘要+ 被隐藏,空的纯思考容器被省略;重新打开时恢复。父级、子级和同级选择彼此独立;+ 收起/重新展开父级会保留后代,流式更新和完成不会覆盖用户接管的选择。保留窗格中的重新+ 挂载保留选择;渲染器重启重新应用默认值,但工具名称、参数、结果和状态仍会恢复。组标题+ 显示有界运行和问题摘要,不会把整个回合标记为失败。- **链接规格**:`04-ux/01-ui-ia.md`、`04-ux/07-ui-design-system.md`、`04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md`- **验收**:C(聊天流)、E(工具)、F(持久性)@@ -8673,8 +8673,8 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture#### E2E-CHAT-running-status-survives-output-pauses- **先决条件**:Electron 中的生产 `ChatTranscript`、真实 store 和 React DOM,使用确定性消息/状态转换,无需模型凭据。-- **步骤**:发送一轮,输出部分文字后停止增量,开始并完成工具,切换和清空具体阶段,恢复文字后完成、停止或失败。在详细与紧凑模式重复;验证规划、权限、提问与提案等待、历史阅读及会话切换。-- **预期**:输出暂停和工具完成后仍有且仅有一行本地化、可访问的底部状态。具体阶段优先于规划/目标或工作中。等待用户操作时隐藏;回合结束与历史阅读时移除。会话切换只使用对应会话的状态;已有内容与权限操作保持可用。运行中与含助手错误的回合不挂载空操作栏;默认字号下,部分回答的片段盒底部到状态文字顶部为 24 CSS px。结束后的无错误正文保留复制、分支与重新生成。详细和紧凑模式均需验证。历史阅读和权限卡保留正常消息间距;回合结束后贴底模式继续跟随底部,恢复正常操作栏高度;向上阅读时正文位置和滚动偏移保持不变。+- **步骤**:发送一轮,输出部分文字后停止增量,开始并完成工具,切换和清空具体阶段,恢复文字后完成、停止或失败。分别在 `Show thinking` 开启与关闭时重复;验证规划、权限、提问与提案等待、历史阅读及会话切换。+- **预期**:输出暂停和工具完成后仍有且仅有一行本地化、可访问的底部状态。具体阶段优先于规划/目标或工作中。等待用户操作时隐藏;回合结束与历史阅读时移除。会话切换只使用对应会话的状态;已有内容与权限操作保持可用。运行中与含助手错误的回合不挂载空操作栏;默认字号下,部分回答的片段盒底部到状态文字顶部为 24 CSS px。结束后的无错误正文保留复制、分支与重新生成。需分别在 `Show thinking` 开启与关闭时验证。历史阅读和权限卡保留正常消息间距;回合结束后贴底模式继续跟随底部,恢复正常操作栏高度;向上阅读时正文位置和滚动偏移保持不变。- **链接规格**:`04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md`- **验收**:C(对话与流式)、品质(交互和可访问性)- **里程碑**:M5@@ -9115,27 +9115,32 @@ Follow the [current S3 acceptance scenario](/spec/06-delivery/04-e2e-test-plan#e### E2E-CHAT-turn-process-and-thinking-display- **先决条件:** 一个回合包含进度段落 A、多次搜索及思考、进度段落 B、多条命令及- 思考和最终回答;详细与紧凑显示模式。-- **步骤:** 在详细模式确认活动过程默认展开,让同一回合在无人操作时完成,并确认过程- 收起。另一个回合中,明确展开已完成过程,并确认后续更新仍保留该选择。检查嵌套路径,- 包括相互独立的组/条目切换、父级收起与恢复、单项片段、字面最后一项选择、失败/被拒/- 恢复、保留窗格重新挂载和旧版搜索定位。随后在紧凑模式重复,并覆盖权限/提问/计划/- 目标操作卡、中止的部分回答、助手错误和委派子任务。-- **预期:** 两种模式都使用一个整体过程披露,并把最终回答、助手错误、中止后的末尾- 文字和待处理操作留在过程之外。详细模式的活动过程默认展开;未操作的过程在回合完成时- 收起,用户明确选择的状态继续保留。活动多项组默认展开,未操作组在完成时收起。紧凑模式- 的过程、组和载荷默认收起,隐藏推理;记录过失败/被拒工具的未操作活动过程会在恢复期间- 保持展开,并在完成后收起。单项没有组。没有任何条目载荷会自动展开:工具/搜索行在- 用户打开之前保持收起,而思考项保留自身的叶子默认值。父级、子级和同级- 状态相互独立;窗格拥有的用户选择跨更新、模式切换和重新挂载保留,渲染器重启后重新应用- 默认值。搜索只展开拥有目标消息的过程和活动组,每个请求应用一次;条目级精确定位不在- 本次范围内,紧凑模式推理仍需显式切换到详细模式。已保存模式跨重启保留,缺失或未知设置- 按详细模式处理。+ 思考和最终回答;`Show thinking` 偏好开启与关闭两种状态;旧版消息级转录搜索目标。+- **步骤:** 确认活动组默认展开,让同一回合在无人操作时完成,并确认组收起。另一个+ 回合中,明确展开已完成组,并确认后续更新仍保留该选择。关闭 `Show thinking`,确认+ 活动思考指示器仍然可见、已完成的推理行和摘要消失且不残留空的纯思考容器;再重新打开,+ 确认已完成的推理行恢复。收起所有组,确认 Bash/run 行仍保持可见。检查嵌套路径,包括+ 相互独立的组/条目切换、父级收起与恢复、单项片段、字面最后一项选择、失败/被拒/恢复、+ 保留窗格重新挂载、Bash 行保持独立(包括相邻 Bash 行)且其详情在打开前保持收起,以及+ 旧版搜索定位。+- **预期:** 按时间顺序排列的可折叠过程片段把最终回答、助手错误、中止后的末尾文字和待处理+ 操作留在过程之外。活动组默认展开;未操作的组在回合完成时收起,用户明确选择的状态继续+ 保留。这些组默认值不依赖 `Show thinking` 偏好。Bash/run 别名被排除在所有过程披露之外,+ 作为独立行渲染,即使所有组都收起也保持可见;相邻 Bash 行各自独立,Bash 行的详情在用户+ 打开前保持收起。`Show thinking` 关闭时,活动思考指示器保持可见,已完成的推理行和摘要+ 被隐藏,空的纯思考容器被省略;重新打开时恢复。单项没有组。没有任何条目载荷会自动展开:+ 工具/搜索行在用户打开之前保持收起,而思考项保留自身的叶子默认值。父级、子级和同级+ 状态相互独立;窗格拥有的用户选择跨更新、偏好切换和重新挂载保留,渲染器重启后重新应用+ 默认值。搜索只展开拥有目标消息的过程片段和活动组,每个请求应用一次;条目级精确定位不在+ 本次范围内,被偏好隐藏的推理会保持隐藏,直到用户打开 `Show thinking`。已保存的+ `showThinking` 跨重启保留;缺失值回退到旧版 `thinkingDisplayMode`(`compact` 隐藏,+ `detailed`/未知/缺失显示)。- **2026-09-20 变更的验证范围:** 本次变更只包含多级折叠与活动组呈现;精确转录搜索定位不在本次范围内,保持原有搜索行为。- **自动化:** `pnpm test:e2e:transcript` 覆盖默认及运行中到完成时的过程披露行为;`pnpm test:e2e:transcript-disclosure` 验证手动展开状态保留和视口锚定;- `apps/desktop/test/turn-process.test.mjs` 覆盖默认选择。+ `apps/desktop/test/turn-process.test.mjs` 覆盖过程默认值,+ `apps/desktop/test/thinking-visibility.test.mjs` 覆盖 `showThinking`/旧版解析优先级。- **规格:** 04-ux/06-settings-ia、04-ux/08-component-spec、04-ux/09-interaction-patterns;ADR turn-process-and-thinking-display。### E2E-CONTEXT-estimate-calibration-stays-safediff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex c411554e5..88ab3acb0 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -54,6 +54,7 @@| D656 | 隔离宿主持续拒绝的 outbox 追加,避免整队停摆 | **修订 ADR 0041 / D318 / D444 / D597:当 `session.appendMessage` 或 `session.recordUsage` 返回的错误无法归类为重复消息 ID、`PERMISSION_DENIED:` 毒行或外键孤立行时,不再结束本次 flush,而是在同一 Host 代内按有界退避重试(5 秒起、翻倍、上限 60 秒)。同一队头连续第五次失败后,该追加被移入应用自有的死信文件 `session-message-outbox.dead-letter.json`(保留载荷、sessionId、隔离时间与宿主错误;只保留最新 256 条,超出丢弃最旧并记 warn),随后继续排空后续条目,因此单条被拒追加不再长期占用 FIFO 队头、填满 1024 条上限或导致所有会话写入失败。Host 重启属于新代,会立即重试该队头。隔离条目永不自动重放,`session.delete` 会连同该会话的隔离条目一起删除。协议版本、存储架构与队列文件格式均不变。** | 一条 `stream did not contain valid UTF-8` 追加在队头滞留 14.8 小时,期间 `session.persistence.outbox.is.full` 触发 5990 次,导致所有会话的写入直到重启前全部失败;此前只有三类错误有排空出口,其余错误被永久当作瞬时错误(#1560)。 || D657 | 让内置浏览器打开工作区外的本地文件 | **修订 ADR 0170:通过绝对路径或 `file:` URL 可打开任意已存在的本地普通文件,本地文件页面也可导航到其他已存在的本地文件。相对输入仍以工作区为根;HTTP(S) 页面只保留此前工作区内文件链接的权限。缺失文件、目录与远程文件 authority 仍被阻止。`BrowserPreview` 与 sidecar 继续使用工作区根解析。公开的 `pi.browser.navigate` API 在高风险 `browser.cdp` 权限下采用相同策略。见 ADR 0328、E2E-059、`04-ux/08-component-spec.md` 与 `05-security/01-security.md`。** | 用户需要检查项目外的本地 HTML,而工作区范围内的 Agent 文件工具和远程页面导航仍须保留原有边界(#1627)。 || D659 | 重新打开归档项目后恢复侧栏显示 | **修订 D093 / D455:成功明确激活项目时,清除该规范化路径的渲染层归档标记并持久化,使用户从「项目归档」点击「打开」、通过「添加项目」再次选择同一目录,或打开项目会话后,都能在主页侧边栏看到该项目。仅选择归档详情行而未激活,以及普通会话刷新,都不改变归档状态。不更改 Host/项目/会话存储或协议。见 ADR 0294、E2E-264 与 issue #1653。** | 用户明确重新打开项目后,活动工作区虽已切换,但按路径存储的归档展示标记仍在,导致项目从侧栏隐藏。 |+| D660 | 分段回合过程与独立的思考偏好 | **取代 D633 / D651 与 `turn-process-and-thinking-display` ADR 中记录的 `Detailed` / `Compact` 显示模式行为与单一整体过程披露:回合渲染为按时间顺序排列的可折叠过程片段,Bash 与 run 别名位于所有折叠容器之外(回合级过程披露与任何普通活动组),即使所有组都收起也保持可见,且过程/组折叠默认值不依赖思考偏好。偏好为可选的布尔值 `AppSettings.showThinking`;缺失或非布尔值回退到旧版 `thinkingDisplayMode` 字段(`compact` 隐藏,`detailed`/未知/缺失显示),该旧字段仅为持久化设置兼容性保留。`showThinking` 加入可移植应用字段,因此会像旧字段一样同步;其余 Host 协议、持久化 schema、权限或插件契约不变。见修订后的 ADR、`04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md` 与 E2E-CHAT-turn-process-and-thinking-display。** | 单一扁平容器让较长的工具/搜索序列难以浏览,并把推理可见性与过程折叠挤进同一个二值开关;独立布尔值加上始终可见的 Bash 行,让命令密集的回合保持可读又不遮挡回答。 |## B. 辅助实现默认值@@ -5418,3 +5419,23 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编- 由 `packages/agent-runtime/src/session-affinity.test.ts` 与E2E-PROVIDER-custom-endpoint-session-identity 覆盖。见 issue #1634、`03-runtime/02-agent-runtime.md` §6.3 与 `03-runtime/11-provider-model-system.md`。++## 2026-10-16 —— 分段回合过程与独立的思考偏好(D660)++- D660 取代 D633 / D651 与 `turn-process-and-thinking-display` ADR 中记录的+ `Detailed` / `Compact` 显示模式行为与单一整体过程披露。回合现在渲染为按时间顺序排列的+ 可折叠过程片段;末尾回答、助手错误、中止后的末尾文字和待处理操作面留在这些片段之外。+- Bash 与 run 别名作为独立行渲染,位于所有折叠容器之外——既不属于回合级过程披露,也不+ 属于普通活动组——即使所有组都收起也保持可见。相邻的 Bash 行保持独立,Bash 行的详情在+ 用户打开之前保持收起。+- 组折叠默认值统一且不依赖思考偏好:活动组默认展开,完成时仅在用户未操作时收起;其他+ 已完成组默认收起;记录过失败或被拒工具的未接管活动组会在后续恢复期间保持展开。+- 偏好为可选的布尔值 `AppSettings.showThinking`。当它为 false 时,活动思考指示器保持+ 可见,而已完成的思考行和摘要被隐藏,空的纯思考容器被省略;已存推理仍会保留。缺失或+ 非布尔值回退到旧版 `thinkingDisplayMode` 字段(`compact` 隐藏,`detailed`/未知/缺失+ 显示),该旧字段仅为持久化设置兼容性保留,不再在界面中暴露。+- `showThinking` 加入可移植应用字段,因此会像旧字段一样同步;其余 Host 协议、持久化+ schema、权限或插件契约不变。由 `apps/desktop/test/thinking-visibility.test.mjs` 与+ i18n 目录测试覆盖。见修订后的 ADR、`04-ux/06-settings-ia.md`、+ `04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md` 与+ E2E-CHAT-turn-process-and-thinking-display。diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex cc748564b..becbef304 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -1406,6 +1406,8 @@ sklm: {"thinkingDisplayModeDesc": "Der Modus Detailliert zeigt den Fortschritt in einem ausklappbaren Prozess mit verschachtelten Tool-Gruppen und dem Denkprozess. Der Modus Kompakt startet mit eingeklapptem Prozess und blendet den Denkprozess aus.","thinkingDisplayDetailed": "Detailliert","thinkingDisplayCompact": "Kompakt",+ "showThinking": "Denkprozess anzeigen",+ "showThinkingDesc": "Zeigt den Denkprozess des Modells. Wenn aus, bleibt die Live-Denk-Anzeige sichtbar und abgeschlossene Denkzeilen und Auszüge werden ausgeblendet.","contextUsageDisplay": "Kontextnutzung-Anzeige","contextUsageDisplayRemaining": "Verbleibend","contextUsageDisplayUsed": "Verwendet",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex a5cc9ab40..25bf3b596 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -1420,6 +1420,8 @@ sklm: {thinkingDisplayModeDesc: "Detailed shows progress in an expandable process with nested tool groups and reasoning. Compact starts the process collapsed and hides reasoning.",thinkingDisplayDetailed: "Detailed",thinkingDisplayCompact: "Compact",+ showThinking: "Show thinking",+ showThinkingDesc: "Show the model's reasoning. Off keeps the live thinking indicator visible and hides completed reasoning rows and excerpts.",contextUsageDisplay: "Context usage readout",contextUsageDisplayRemaining: "Remaining",contextUsageDisplayUsed: "Used",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex 022f03524..950c626bc 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -1406,6 +1406,8 @@ sklm: {"thinkingDisplayModeDesc": "Detallado muestra el progreso en un proceso expandible con grupos de herramientas anidados y razonamiento. Compacto inicia el proceso contraído y oculta el razonamiento.","thinkingDisplayDetailed": "Detallado","thinkingDisplayCompact": "Compacto",+ "showThinking": "Mostrar razonamiento",+ "showThinkingDesc": "Muestra el razonamiento del modelo. Desactivado, el indicador de razonamiento en vivo sigue visible y las filas y extractos de razonamiento completados quedan ocultos.","contextUsageDisplay": "Lectura del uso del contexto","contextUsageDisplayRemaining": "Restante","contextUsageDisplayUsed": "Usado",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex ad9241d88..86330cad4 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -1406,6 +1406,8 @@ sklm: {"thinkingDisplayModeDesc": "Le mode détaillé affiche la progression dans un processus dépliable avec des groupes d'outils imbriqués et le raisonnement. Le mode compact démarre avec le processus replié et masque le raisonnement.","thinkingDisplayDetailed": "Détaillé","thinkingDisplayCompact": "Compact",+ "showThinking": "Afficher le raisonnement",+ "showThinkingDesc": "Affiche le raisonnement du modèle. Désactivé, l'indicateur de raisonnement en direct reste visible et les lignes et extraits de raisonnement terminés sont masqués.","contextUsageDisplay": "Affichage de l'usage du contexte","contextUsageDisplayRemaining": "Restant","contextUsageDisplayUsed": "Utilisé",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex f0f708b50..b7e3d7e12 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -1416,6 +1416,8 @@ sklm: {thinkingDisplayModeDesc: "상세 모드는 중첩된 도구 그룹과 사고 과정을 포함한 진행 상황을 펼칠 수 있는 처리 과정에 표시합니다. 간결 모드는 처리 과정을 접힌 상태로 시작하고 사고 과정을 숨깁니다.",thinkingDisplayDetailed: "상세",thinkingDisplayCompact: "간결",+ showThinking: "사고 과정 표시",+ showThinkingDesc: "모델의 사고 과정을 표시합니다. 끄면 실시간 사고 표시기는 계속 보이고 완료된 사고 행과 발췌는 숨겨집니다.",contextUsageDisplay: "컨텍스트 사용량 표시",contextUsageDisplayRemaining: "남음",contextUsageDisplayUsed: "사용됨",diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.tsindex 6cca45532..d271a42fb 100644--- a/packages/i18n/src/locales/pt-BR/index.ts+++ b/packages/i18n/src/locales/pt-BR/index.ts@@ -1379,6 +1379,8 @@ export const ptBR = {thinkingDisplayModeDesc: "Controla como o processo de raciocínio do modelo é exibido na conversa.",thinkingDisplayDetailed: "Detalhado",thinkingDisplayCompact: "Compacto",+ showThinking: "Mostrar raciocínio",+ showThinkingDesc: "Mostra o raciocínio do modelo. Quando desativado, o indicador de raciocínio ao vivo continua visível e as linhas e trechos de raciocínio concluídos ficam ocultos.",contextUsageDisplay: "Indicador de uso do contexto",contextUsageDisplayRemaining: "Restante",contextUsageDisplayUsed: "Usado",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex c5d25f5cc..aced5a0d7 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -1410,6 +1410,8 @@ sklm: {thinkingDisplayModeDesc: "Ayrıntılı mod ilerlemeyi, iç içe araç grupları ve düşünmeyle birlikte genişletilebilir bir işlemde gösterir. Sade mod işlemi daraltılmış olarak başlatır ve düşünmeyi gizler.",thinkingDisplayDetailed: "Ayrıntılı",thinkingDisplayCompact: "Sade",+ showThinking: "Düşünmeyi göster",+ showThinkingDesc: "Modelin düşünmesini gösterir. Kapalıyken canlı düşünme göstergesi görünür kalır; tamamlanan düşünme satırları ve alıntılar gizlenir.",contextUsageDisplay: "Bağlam kullanımı göstergesi",contextUsageDisplayRemaining: "Kalan",contextUsageDisplayUsed: "Kullanılan",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex 338be1d8c..f773afc04 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -1400,6 +1400,8 @@ sklm: {thinkingDisplayModeDesc: "详细模式在可展开的处理过程中显示进度、嵌套工具分组和思考内容。精简模式默认折叠处理过程并隐藏思考内容。",thinkingDisplayDetailed: "详细",thinkingDisplayCompact: "精简",+ showThinking: "显示思考",+ showThinkingDesc: "显示模型的推理内容。关闭后仍显示实时思考指示器,并隐藏已完成的推理行和摘要。",contextUsageDisplay: "上下文用量读数",contextUsageDisplayRemaining: "剩余",contextUsageDisplayUsed: "已用",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex 3a1920d25..c846bf643 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -1400,6 +1400,8 @@ sklm: {thinkingDisplayModeDesc: "詳細模式在可展開的處理過程中顯示進度、巢狀工具群組和思考內容。精簡模式預設摺疊處理過程並隱藏思考內容。",thinkingDisplayDetailed: "詳細",thinkingDisplayCompact: "精簡",+ showThinking: "顯示思考",+ showThinkingDesc: "顯示模型的推理內容。關閉後仍顯示即時思考指示器,並隱藏已完成的推理列和摘要。",contextUsageDisplay: "上下文用量讀數",contextUsageDisplayRemaining: "剩餘",contextUsageDisplayUsed: "已用",diff --git a/packages/shared/src/types/settings.ts b/packages/shared/src/types/settings.tsindex a0f24519b..b233aeb17 100644--- a/packages/shared/src/types/settings.ts+++ b/packages/shared/src/types/settings.ts@@ -88,7 +88,20 @@ export type AppSettings = {* Absent means 1. Range 0.8–1.5 in 0.025 steps. Window zoom is independent.*/fontScale?: number;- /** Transcript presentation only; absent means detailed. Reasoning is retained. */+ /**+ * Show model reasoning in the transcript. Off keeps the live thinking+ * indicator visible and hides completed reasoning rows and excerpts; absent+ * falls back to the legacy `thinkingDisplayMode`. This is a presentation+ * preference only: it never changes model thinking levels, stored reasoning,+ * export, or execution, and it does not control turn-process folding.+ */+ showThinking?: boolean;+ /**+ * @deprecated Retained for persisted-settings compatibility. New writes use+ * `showThinking`; this field is read only as a fallback when `showThinking`+ * is absent. An explicit `compact` hides reasoning; `detailed`, an unknown+ * value, or an absent field shows it.+ */thinkingDisplayMode?: "detailed" | "compact";/*** @deprecated Unreleased D343 px field. Reads migrate into `fontScale`diff --git a/scripts/e2e-transcript-render.mjs b/scripts/e2e-transcript-render.mjsindex cb417f9a2..b3bb69577 100644--- a/scripts/e2e-transcript-render.mjs+++ b/scripts/e2e-transcript-render.mjs@@ -203,6 +203,11 @@ app.whenReady().then(async () => {true,`runtime status slot scenario failed: ${JSON.stringify(result.runtimeSlot?.failures)}`,);+ assert.equal(+ result.turnProcess?.ok,+ true,+ `turn process scenario failed: ${JSON.stringify(result.turnProcess?.checks)}`,+ );assert.equal(result.smoothText?.ok,true,diff --git a/scripts/e2e/transcript-long-history.tsx b/scripts/e2e/transcript-long-history.tsxindex 06264c133..b239c2dde 100644--- a/scripts/e2e/transcript-long-history.tsx+++ b/scripts/e2e/transcript-long-history.tsx@@ -186,7 +186,7 @@ export async function transcriptLongHistoryProbe() {runningSessions: Object.fromEntries(sessions.map((item) => [item.summary.id, true])),isRunning: true, page: "chat", selectingSessionId: undefined,settings: { defaultMode: "agent", theme: "dark", enterToSend: true, onboardingDismissed: true,- ...initial.settings, smoothStreaming: false, thinkingDisplayMode: "detailed" },+ ...initial.settings, smoothStreaming: false, showThinking: true },});// Seed canonical loaded snapshots through the real store subscription/cache// writer, rather than bypassing it with a projection builder or custom store.diff --git a/scripts/e2e/transcript-render.tsx b/scripts/e2e/transcript-render.tsxindex 272c69739..29add30d6 100644--- a/scripts/e2e/transcript-render.tsx+++ b/scripts/e2e/transcript-render.tsx@@ -466,8 +466,9 @@ globalThis.transcriptRenderProbe = async () => {const statusLifecycle = await transcriptStatusProbe();const markdownLinks = await markdownLinkInteractionProbe(i18n);+ const turnProcess = await turnProcessProbe();return {- ok: statusLifecycle.ok && markdownLinks.ok,+ ok: statusLifecycle.ok && markdownLinks.ok && turnProcess.ok,statusLifecycle,markdownLinks,groups,@@ -476,7 +477,7 @@ globalThis.transcriptRenderProbe = async () => {changedToolRenders: 1,taskLifecycleUpdated: true,taskTimingUpdated: true,- turnProcess: await turnProcessProbe(),+ turnProcess,messageEditing: await transcriptEditProbe(),textUpdateDurationMs,};diff --git a/scripts/e2e/transcript-status.tsx b/scripts/e2e/transcript-status.tsxindex 3b4ef9328..43488871d 100644--- a/scripts/e2e/transcript-status.tsx+++ b/scripts/e2e/transcript-status.tsx@@ -106,7 +106,7 @@ export async function transcriptStatusProbe() {const noStatus = (label: string) =>check(!host.querySelector(".transcript-runtime-status > *"), label);try {- for (const mode of ["detailed", "compact"] as const) {+ for (const mode of [true, false] as const) {flushSync(() =>useAppStore.setState({settings: {@@ -114,7 +114,7 @@ export async function transcriptStatusProbe() {theme: "light",enterToSend: true,onboardingDismissed: true,- thinkingDisplayMode: mode,+ showThinking: mode,},agentStatuses: {},pendingPlans: {},diff --git a/scripts/e2e/turn-process.tsx b/scripts/e2e/turn-process.tsxindex a80e5a1d8..ad59ce92d 100644--- a/scripts/e2e/turn-process.tsx+++ b/scripts/e2e/turn-process.tsx@@ -5,7 +5,7 @@ import { I18nextProvider } from "react-i18next";import { en } from "@pi-desktop/i18n";import type { AppSettings, UiMessage } from "@pi-desktop/shared";import { AssistantTurn } from "../../apps/desktop/src/features/chat/transcript/AssistantTurn";-import { ThinkingDisplayModeRow } from "../../apps/desktop/src/components/settings/ThinkingDisplayModeRow";+import { ShowThinkingRow } from "../../apps/desktop/src/components/settings/ShowThinkingRow";import { buildTranscriptEntries } from "../../apps/desktop/src/lib/assistant-turns";import { TranscriptSearchContext } from "../../apps/desktop/src/lib/transcript-search-context";import type { TranscriptSearchTarget } from "../../apps/desktop/src/lib/transcript-reading";@@ -28,7 +28,25 @@ const message = (...extra,});-/** Real mounted React components: disclosure ownership, preferences and search. */+const tool = (+ id: string,+ toolName: string,+ extra: Partial<UiMessage> = {},+): UiMessage =>+ message(id, "tool", "", {+ toolName,+ toolCallId: `call-${id}`,+ toolStatus: "success",+ ...extra,+ });++const run = (id: string, command: string): UiMessage =>+ tool(id, "Bash", {+ toolArgs: { command },+ toolResult: { details: { stdout: "ok", exitCode: 0 } },+ });++/** Real mounted React components: disclosure ownership, preference and search. */export async function turnProcessProbe() {const i18n = createInstance();await i18n.init({@@ -39,13 +57,15 @@ export async function turnProcessProbe() {const container = document.createElement("div");document.body.append(container);const initialSettings = useAppStore.getState().settings;- const settings: AppSettings = {+ const baseSettings: AppSettings = {defaultMode: "agent",theme: "light",enterToSend: true,onboardingDismissed: true,};- flushSync(() => useAppStore.setState({ settings }));+ const setSettings = (patch: Partial<AppSettings> = {}) =>+ flushSync(() => useAppStore.setState({ settings: { ...baseSettings, ...patch } }));+ setSettings();const errors: unknown[] = [];const root = createRoot(container, {onUncaughtError: (error) => errors.push(error),@@ -76,30 +96,38 @@ export async function turnProcessProbe() {);assert(!errors.length, `React error: ${errors.map(String).join("; ")}`);};- const header = () =>- container.querySelector<HTMLButtonElement>(".turn-process > button");- const process = () => container.querySelector<HTMLElement>(".turn-process-body");+ const processHeaders = () =>+ [...container.querySelectorAll<HTMLButtonElement>(".turn-process > button")];+ const firstProcess = () => container.querySelector<HTMLElement>(".turn-process-body");const visible = (element: Element | null) =>Boolean(element?.getBoundingClientRect().height);const click = (element: HTMLElement | null) => {assert(element, "missing click target");flushSync(() => element.click());};+ const row = (id: string) =>+ container.querySelector<HTMLElement>(`[data-message-id="${id}"]`);+ const allCollapsed = () =>+ [...container.querySelectorAll<HTMLElement>("[aria-expanded]")].every(+ (element) => element.getAttribute("aria-expanded") === "false",+ );+const intro = message("intro", "assistant", "Inspecting the files", {thinking: "reasoning detail",status: "complete",});- const read = message("read", "tool", "read output", {- toolName: "Read",- toolCallId: "read-call",- toolStatus: "success",+ const read = tool("read", "Read", {+ toolResult: "read output",toolArgs: { path: "src/example.ts" },});- const progress = message("progress", "assistant", "Found the problem");- const edit = message("edit", "tool", "edit output", {- toolName: "Edit",- toolCallId: "edit-call",- toolStatus: "success",+ const grep = tool("grep", "Grep", {+ toolResult: "grep output",+ toolArgs: { query: "todo" },+ });+ const bash1 = run("bash1", "pnpm test");+ const bash2 = run("bash2", "pnpm build");+ const edit = tool("edit", "Edit", {+ toolResult: "edit output",toolArgs: { path: "src/example.ts" },});const answer = message("answer", "assistant", "The fix is ready.", {@@ -107,289 +135,163 @@ export async function turnProcessProbe() {createdAt: "2026-09-17T00:00:03.000Z",responseDurationMs: 1000,});- const messages = [intro, read, progress, edit, answer];+ const mixed = [intro, read, grep, bash1, bash2, edit, answer];+try {- render(messages);+ // Bash has no process ancestor and stays visible with every disclosure+ // collapsed, even across adjacent calls.+ render(mixed);+ const bash1Row = row("bash1");+ const bash2Row = row("bash2");+ check(Boolean(bash1Row) && Boolean(bash2Row), "both adjacent Bash rows render");check(- container.querySelectorAll(".turn-process").length === 1,- "detailed wraps one process per turn",+ bash1Row?.closest(".turn-process") === null &&+ bash2Row?.closest(".turn-process") === null,+ "no Bash row is inside any turn-process disclosure",);check(- header()?.getAttribute("aria-expanded") === "false" && !visible(process()),- "detailed completed process starts collapsed",+ bash1Row?.closest(".turn-run-row") !== null &&+ bash1Row?.closest(".turn-run-row") !== bash2Row?.closest(".turn-run-row"),+ "adjacent Bash rows each render standalone",);check(- visible(container.querySelector('[data-message-id="answer"]')),- "final answer stays visible",+ bash1Row?.closest(".process-activity-group") === null &&+ bash1Row?.closest(".tool-activity-group") === null,+ "Bash rows are not folded into an activity group",);+ check(allCollapsed(), "the completed process starts fully collapsed");check(- !visible(container.querySelector('[data-message-id="progress"]')),- "completed progress stays hidden until expanded",+ visible(bash1Row) && visible(bash2Row),+ "Bash rows stay visible with every disclosure collapsed",);- render(messages, true, null, "active-process");check(- header()?.getAttribute("aria-expanded") === "true" && visible(process()),- "active detailed process starts open",+ !visible(row("read")) && !visible(row("grep")),+ "non-run work stays inside its collapsed process",);- render(messages, false, null, "active-process");check(- header()?.getAttribute("aria-expanded") === "false" && !visible(process()),- "untouched detailed process collapses on completion",+ bash1Row?.classList.contains("open") !== true,+ "a Bash row keeps its detail closed until opened",);- render(messages);- click(header());+ click(bash1Row?.querySelector<HTMLElement>(".tool-row-header") ?? null);check(- visible(container.querySelector('[data-message-id="progress"]')),- "user can expand completed progress",+ bash1Row?.classList.contains("open") === true,+ "a Bash row opens its own detail on request",);++ // A turn of only Bash calls has no process disclosure at all.+ render([run("only1", "echo 1"), run("only2", "echo 2")], false, null, "only-bash");check(- container.querySelector('[data-message-id="edit"]')?.classList.contains("open") === true,- "detailed opens the last tool",+ container.querySelectorAll(".turn-process").length === 0,+ "a Bash-only turn renders no process disclosure",);check(- container.querySelector('[data-message-id="read"]')?.classList.contains("open") !== true,- "detailed keeps earlier tools collapsed",+ visible(row("only1")) && visible(row("only2")),+ "both Bash-only rows stay visible",);++ // Active process content opens while the turn runs and closes when it stops.+ const activeTurn = [intro, read, grep];+ render(activeTurn, true, null, "active");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",+ firstProcess() !== null &&+ processHeaders()[0]?.getAttribute("aria-expanded") === "true" &&+ visible(firstProcess()),+ "the active process chunk starts open",);+ render(activeTurn, false, null, "active");check(- container.querySelector('[data-message-id="read"]')?.classList.contains("open") !== true,- "detailed keeps a last failed tool collapsed",+ processHeaders()[0]?.getAttribute("aria-expanded") === "false" &&+ !visible(firstProcess()),+ "an untouched process chunk collapses on completion",);- const streaming = message("stream", "assistant", "Live text", {+ // Show thinking off: the live indicator stays, completed reasoning leaves+ // nothing behind, and stored reasoning is never deleted.+ const liveThought = message("live-thought", "assistant", "", {+ thinking: "Reasoning before the answer",status: "streaming",});- render([streaming], true, null, "stream");- check(- !header() && visible(container.querySelector('[data-message-id="stream"]')),- "streamed answer is never delayed behind disclosure",- );- render([streaming, read], true, null, "stream");- check(- header()?.getAttribute("aria-expanded") === "true" &&- visible(container.querySelector('[data-message-id="stream"]')),- "detailed keeps streamed text visible after later tools",- );- render([intro, read, { ...answer, status: "aborted" }], false, null, "aborted");+ setSettings({ showThinking: false });+ render([liveThought], true, null, "thought-off-live");+ const liveHeader = processHeaders()[0];check(- visible(container.querySelector('[data-message-id="answer"]')),- "stopped partial answer remains visible",- );- render(- [- intro,- read,- message("failure", "assistant", "", {- error: { code: "INTERNAL", message: "Connection failed", retryable: true },- }),- ],- false,- null,- "error",- );- check(- visible(container.querySelector('[data-message-id="failure"]')),- "failure remains visible",- );-- flushSync(() =>- useAppStore.setState({- settings: { ...settings, thinkingDisplayMode: "compact" },- }),- );- render(messages, false, null, "compact-group");- check(- container.querySelectorAll(".turn-process").length === 1,- "one process per turn",+ liveHeader?.querySelector(".tool-activity-label")?.textContent?.startsWith(+ i18n.t("chat.thinkingFor", { time: "" }),+ ),+ "show thinking off keeps the live thinking indicator in the header",);check(- header()?.getAttribute("aria-expanded") === "false" && !visible(process()),- "compact completed process starts collapsed",+ Boolean(container.querySelector(".thinking-compact")),+ "show thinking off shows the live thinking row",);+ click(liveHeader);check(- container.querySelector('[data-message-id="edit"]')?.classList.contains("open") !== true,- "compact keeps tool payloads collapsed",+ allCollapsed() &&+ liveHeader?.querySelector(".tool-activity-label")?.textContent?.startsWith(+ i18n.t("chat.thinkingFor", { time: "" }),+ ),+ "the live thinking indicator stays visible with the process closed",);+ render([{ ...liveThought, status: "complete" }], false, null, "thought-off-done");check(- header()?.textContent?.includes("2 tools"),- "process counts tools and progress once",+ !container.querySelector(".turn-process") && !container.querySelector(".thinking"),+ "completed hidden thinking leaves no empty container",);- click(header());check(- visible(container.querySelector('[data-message-id="progress"]')),- "expanding reveals intermediate progress",+ liveThought.thinking === "Reasoning before the answer",+ "hiding thinking never deletes stored reasoning",);+ setSettings({ showThinking: true });+ render([{ ...liveThought, status: "complete" }], false, null, "thought-on-done");check(- process()?.querySelectorAll(".tool-row").length === 2,- "compact expanding retains both tools without thinking",+ Boolean(container.querySelector(".tool-row.thinking")),+ "turning show thinking back on restores the completed reasoning row",);- render(messages, true, null, "compact-group");- render(messages, false, null, "compact-group");check(- header()?.getAttribute("aria-expanded") === "true",- "manual disclosure survives active-to-complete transition",+ container.textContent?.includes("Reasoning before the answer"),+ "the restored row shows the retained reasoning text",);- render([intro, read], true, null, "live");- check(- header()?.getAttribute("aria-expanded") === "false",- "compact live process stays collapsed without a tool failure",- );+ // Search reveal opens the process chunk that owns the named message.+ setSettings();render(- messages,+ mixed,false,- { sessionId: "s", messageId: "progress", query: "problem", requestId: 1 },+ { sessionId: "s", messageId: "read", query: "read", requestId: 1 },"search",);check(- visible(container.querySelector('[data-message-id="progress"]')),- "search reveals folded progress",- );-- const liveThought = message("live-thought", "assistant", "", {- thinking: "Reasoning before the answer",- status: "streaming",- });- const processLabel = () =>- container.querySelector(".tool-activity-label")?.textContent;- render([liveThought], true, null, "thinking-transition");- check(- processLabel()?.startsWith(i18n.t("chat.thinkingFor", { time: "" })),- "active reasoning uses the thinking label",- );- render(- [{ ...liveThought, content: "Answer has started" }],- true,- null,- "thinking-transition",- );- check(- !header() &&- visible(container.querySelector('[data-message-id="live-thought"]')),- "answer streaming ends the thinking label even when reasoning is retained",- );- render(- [- liveThought,- message("separate-answer", "assistant", "Answer text", {- status: "streaming",- }),- ],- true,- null,- "thinking-transition",- );- check(- processLabel()?.startsWith(i18n.t("chat.processingFor", { time: "" })),- "a later answer takes precedence over an earlier streaming thought",- );-- render([streaming, read], true, null, "stream-compact");- check(- process()?.querySelector('[data-message-id="stream"]'),- "later tool moves provisional text into process",- );-- render(- [intro, { ...read, toolStatus: "error", isError: true }, answer],- true,- null,- "tool-error",- );- check(- header()?.getAttribute("aria-expanded") === "true" && visible(process()),- "an active tool failure opens an unclaimed process",+ processHeaders()[0]?.getAttribute("aria-expanded") === "true" &&+ visible(firstProcess()),+ "search reveals the process chunk that owns the target",);+ // The Settings row is a boolean Show thinking toggle.let saved: Partial<AppSettings> | undefined;+ const settings: AppSettings = { ...baseSettings, showThinking: false };flushSync(() =>root.render(<I18nextProvider i18n={i18n}>- <ThinkingDisplayModeRow+ <ShowThinkingRowsettings={settings}saveSettings={async (patch) => {saved = patch;- useAppStore.setState({ settings: { ...settings, ...patch } });}}/></I18nextProvider>,),);- click(container.querySelector<HTMLElement>('[role="radio"][aria-checked="false"]'));+ const toggle = container.querySelector<HTMLElement>('[role="switch"]');check(- saved?.thinkingDisplayMode === "compact",- "settings control saves compact mode",- );-- render(- [intro, { ...read, toolStatus: "error", isError: true }, answer],- true,- null,- "compact-error",+ toggle?.getAttribute("aria-checked") === "false",+ "the Show thinking row reflects the stored preference",);+ click(toggle);check(- header()?.getAttribute("aria-expanded") === "true" && visible(process()),- "compact mode reveals an active tool failure",+ saved?.showThinking === true,+ "the Show thinking row saves the boolean preference",);- const thought = message("thought", "assistant", "", {- thinking: "hidden thinking words",- status: "streaming",- });- render([thought], true, null, "compact");- check(- Boolean(header()) && !container.textContent?.includes("hidden thinking words"),- "compact live thinking has status without reasoning text",- );- click(header());- check(- visible(container.querySelector(".thinking-compact")),- "compact live thinking remains indicator-only when expanded",- );- render([{ ...thought, status: "complete" }], false, null, "compact");- check(- !header() && !container.querySelector(".thinking"),- "completed compact thinking leaves no empty process or thought block",- );- render([{ ...thought, content: "Started answer" }], true, null, "compact");- check(- !container.querySelector(".thinking") &&- visible(container.querySelector('[data-message-id="thought"]')),- "compact thinking ends as soon as answer text starts",- );- render(messages, false, null, "compact-tools");- check(- header()?.getAttribute("aria-expanded") === "false" && !visible(process()),- "compact completed process starts collapsed",- );- click(header());- check(- !container.querySelector(".thinking") &&- process()?.querySelectorAll(".tool-row").length === 2,- "compact keeps tools and progress accessible",- );- flushSync(() =>- useAppStore.setState({- settings: { ...settings, thinkingDisplayMode: "detailed" },- }),- );- check(- Boolean(container.querySelector(".thinking")),- "mode changes update mounted history",- );- check(- messages[0].thinking === "reasoning detail",- "presentation never deletes reasoning data",- );return { ok: true, checks: notes };} finally {flushSync(() => root.unmount());