Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Make live Assistant tool evidence inspectable

rcourtmancaf1e4afe5cb
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 23bb30c393..84ba227f8a 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -744,6 +744,22 @@ runtime cost control, and shared AI transport surfaces.
typed message parts through terminal success/failed states; Pulse adapts
that lifecycle shape by making skipped policy/runtime tool calls visible as
terminal transcript rows.
+ The 2026-06-07 live-tool-evidence slice rechecked OpenCode `origin/dev`
+ commit `31c099be435d59bd6749ace7a9f2bb2245e6d3fa`:
+ `packages/core/src/session/event.ts` lines 307-366 define live tool input
+ and bounded progress events, `packages/core/src/session/message-updater.ts`
+ lines 247-293 mutates the same assistant tool part from pending input to
+ running progress, and `packages/ui/src/components/basic-tool.tsx` lines
+ 90 and 246-253 keep pending/running tools as active compact rows rather than
+ expanding details by default. Pulse adapts that source model for
+ infrastructure operations by keeping the compact live row primary while
+ allowing an operator to expand pending/running tool rows for copyable raw
+ input and current progress evidence; raw provider envelopes stay behind
+ Details and are used there when structured arguments are still placeholder
+ `{}` / `[]`. The local dev `/fixture pending-tool` stream is the canonical
+ no-provider browser proof fixture for this live pending-tool Details window
+ and must keep a paced running state long enough to exercise the row before
+ it resolves.
The 2026-06-07 skipped-evidence slice rechecked OpenCode `origin/dev`
commit `31c099be435d59bd6749ace7a9f2bb2245e6d3fa`:
`packages/core/src/session/event.ts` lines 307-336 define replayable tool
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 8015650173..735bcb3693 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -565,7 +565,12 @@ payload shape change when the portal presents compact client rows.
At least one fixture-backed Assistant tool sequence must exercise the
skipped-tool lifecycle by resolving a visible `tool_start` row through
`tool_cancel` instead of hiding the activity. At least one fixture-backed
- Assistant tool sequence must exercise compacted provider artifact
+ Assistant tool sequence must exercise live pending/running tool evidence by
+ emitting placeholder structured input plus raw provider-style input on
+ `tool_start`, mutating that same row through `tool_progress`, and pacing the
+ running state long enough for browser proof to inspect and copy both the
+ completed input and current progress before `tool_end`. At least one
+ fixture-backed Assistant tool sequence must exercise compacted provider artifact
suppression by emitting compacted pre-tool content before a governed tool row
and final normal answer content. At least one fixture-backed Assistant tool
sequence must exercise a buffered `tool_start` -> `tool_end` burst with no
diff --git a/frontend-modern/src/api/__tests__/aiChat.test.ts b/frontend-modern/src/api/__tests__/aiChat.test.ts
index 6ee16301e6..5429a1600f 100644
--- a/frontend-modern/src/api/__tests__/aiChat.test.ts
+++ b/frontend-modern/src/api/__tests__/aiChat.test.ts
@@ -241,6 +241,54 @@ describe('AIChatAPI', () => {
});
});
+ it('runs the pending-tool dev stream fixture without opening a provider request', async () => {
+ const onEvent = vi.fn();
+
+ await AIChatAPI.chat(
+ '/fixture pending-tool',
+ undefined,
+ 'openrouter:deepseek/deepseek-chat',
+ onEvent,
+ );
+
+ expect(apiFetchMock).not.toHaveBeenCalled();
+ expect(onEvent.mock.calls.map(([event]) => event.type)).toEqual([
+ 'session',
+ 'workflow_state',
+ 'tool_start',
+ 'tool_progress',
+ 'tool_end',
+ 'content',
+ 'done',
+ ]);
+ expect(onEvent.mock.calls[2][0]).toMatchObject({
+ type: 'tool_start',
+ data: {
+ id: 'fixture-tool-pending',
+ name: 'pulse_read',
+ input: '{}',
+ raw_input: expect.stringContaining('ls /dev | wc'),
+ },
+ });
+ expect(onEvent.mock.calls[3][0]).toMatchObject({
+ type: 'tool_progress',
+ data: {
+ id: 'fixture-tool-pending',
+ name: 'pulse_read',
+ phase: 'running',
+ message: 'Running command.',
+ raw_input: expect.stringContaining('lsblk -d -o NAME,TYPE,SIZE'),
+ },
+ });
+ expect(onEvent.mock.calls[6][0]).toMatchObject({
+ type: 'done',
+ data: {
+ session_id: 'dev-fixture-pending-tool',
+ model: 'openrouter:deepseek/deepseek-chat',
+ },
+ });
+ });
+
it('runs the provider-retry dev stream fixture without opening a provider request', async () => {
const onEvent = vi.fn();
diff --git a/frontend-modern/src/api/aiChatDevStreamFixture.ts b/frontend-modern/src/api/aiChatDevStreamFixture.ts
index ab9d3c2546..1df7c193b5 100644
--- a/frontend-modern/src/api/aiChatDevStreamFixture.ts
+++ b/frontend-modern/src/api/aiChatDevStreamFixture.ts
@@ -4,6 +4,7 @@ export const AI_CHAT_DEV_STREAM_FIXTURE_PROMPTS = [
'/fixture devices',
'/fixture assistant-stream',
'/fixture tool-burst',
+ '/fixture pending-tool',
'/fixture provider-retry',
'/fixture compacted-artifact',
'/fixture skipped-tool',
@@ -248,6 +249,70 @@ const buildToolBurstFixtureEvents = (model?: string): AIChatStreamEvent[] => [
},
];
+const buildPendingToolFixtureEvents = (model?: string): AIChatStreamEvent[] => [
+ {
+ type: 'session',
+ data: { id: 'dev-fixture-pending-tool' },
+ },
+ {
+ type: 'workflow_state',
+ data: {
+ phase: 'request_start',
+ message: 'Preparing Pulse context.',
+ },
+ },
+ {
+ type: 'tool_start',
+ data: {
+ id: 'fixture-tool-pending',
+ name: 'pulse_read',
+ input: '{}',
+ raw_input: 'pulse_read(target_host="current_resource", command="ls /dev | wc',
+ },
+ },
+ {
+ type: 'tool_progress',
+ data: {
+ id: 'fixture-tool-pending',
+ name: 'pulse_read',
+ phase: 'running',
+ message: 'Running command.',
+ input:
+ '{"target_host":"current_resource","command":"ls /dev | wc -l && lsblk -d -o NAME,TYPE,SIZE"}',
+ raw_input:
+ 'pulse_read(target_host="current_resource", command="ls /dev | wc -l && lsblk -d -o NAME,TYPE,SIZE")',
+ },
+ },
+ {
+ type: 'tool_end',
+ data: {
+ id: 'fixture-tool-pending',
+ name: 'pulse_read',
+ input:
+ '{"target_host":"current_resource","command":"ls /dev | wc -l && lsblk -d -o NAME,TYPE,SIZE"}',
+ raw_input:
+ 'pulse_read(target_host="current_resource", command="ls /dev | wc -l && lsblk -d -o NAME,TYPE,SIZE")',
+ output: ['4358', 'NAME TYPE SIZE', 'sda disk 1.8T', 'nvme0n1 disk 931.5G'].join('\n'),
+ success: true,
+ },
+ },
+ {
+ type: 'content',
+ data: {
+ text: 'The pending-tool fixture kept the running tool row inspectable before completion.',
+ },
+ },
+ {
+ type: 'done',
+ data: {
+ session_id: 'dev-fixture-pending-tool',
+ model: assistantFixtureModel(model),
+ input_tokens: 88,
+ output_tokens: 34,
+ },
+ },
+];
+
const buildProviderRetryFixtureEvents = (): AIChatStreamEvent[] => [
{
type: 'session',
@@ -377,6 +442,9 @@ const buildFixtureEvents = (prompt: string, model?: string): AIChatStreamEvent[]
if (normalized === '/fixture tool-burst') {
return buildToolBurstFixtureEvents(model);
}
+ if (normalized === '/fixture pending-tool') {
+ return buildPendingToolFixtureEvents(model);
+ }
if (normalized === '/fixture provider-retry') {
return buildProviderRetryFixtureEvents();
}
@@ -396,6 +464,10 @@ const fixtureStepDelay = (
) {
return 1600;
}
+ if (normalizedPrompt === '/fixture pending-tool' && event.type === 'tool_progress') {
+ return 2200;
+ }
+ if (normalizedPrompt === '/fixture pending-tool') return defaultDelayMs;
if (normalizedPrompt !== '/fixture tool-burst') return defaultDelayMs;
if (event.type === 'tool_start') return 0;
return defaultDelayMs;
diff --git a/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx b/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx
index e3722f5f2e..c4389dfd4d 100644
--- a/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx
+++ b/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx
@@ -47,12 +47,13 @@ interface ToolCancellationBlockProps {
tool: ToolCancellation;
}
-type ToolDetailKind = 'input' | 'output' | 'reason';
+type ToolDetailKind = 'input' | 'output' | 'progress' | 'reason';
interface ToolDetailsPanelProps {
id: string;
input?: string;
output?: string;
+ progress?: string;
reason?: string;
}
@@ -183,15 +184,24 @@ const ToolCommandPreview: Component<ToolCommandPreviewProps> = (props) => (
const normalizeDetailText = (value?: string) => value?.trim() ?? '';
+const toolDetailInputText = (input: string, rawInput?: string) => {
+ const text = input.trim();
+ const raw = rawInput?.trim() ?? '';
+ if (raw && (!text || text === '{}' || text === '[]')) return raw;
+ return text || raw;
+};
+
const detailTitle = (kind: ToolDetailKind) => {
if (kind === 'input') return 'Input';
if (kind === 'output') return 'Output';
+ if (kind === 'progress') return 'Progress';
return 'Reason';
};
const detailCopyTarget = (kind: ToolDetailKind) => {
if (kind === 'input') return 'tool input';
if (kind === 'output') return 'tool output';
+ if (kind === 'progress') return 'tool progress';
return 'skip reason';
};
@@ -206,10 +216,12 @@ const ToolDetailsPanel: Component<ToolDetailsPanelProps> = (props) => {
const items: Array<{ kind: ToolDetailKind; text: string }> = [];
const input = normalizeDetailText(props.input);
const output = normalizeDetailText(props.output);
+ const progress = normalizeDetailText(props.progress);
const reason = normalizeDetailText(props.reason);
if (input) items.push({ kind: 'input', text: input });
if (output) items.push({ kind: 'output', text: output });
+ if (progress) items.push({ kind: 'progress', text: progress });
if (reason) items.push({ kind: 'reason', text: reason });
return items;
});
@@ -275,6 +287,7 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =>
const toolLabel = createMemo(() => getToolLabel(props.tool.name));
const inputText = createMemo(() => toolValueText(props.tool.input));
+ const detailInputText = createMemo(() => toolDetailInputText(inputText(), props.tool.rawInput));
const outputText = createMemo(() => toolValueText(props.tool.output));
const inputSummary = createMemo(() =>
parseToolInputSummary(inputText(), props.tool.name, props.tool.rawInput),
@@ -289,7 +302,7 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =>
const hiddenOutputSummary = createMemo(() =>
outputPreview() ? '' : formatHiddenOutputSummary(outputText()),
);
- const hasInput = createMemo(() => inputText().trim().length > 0);
+ const hasInput = createMemo(() => detailInputText().trim().length > 0);
const hasOutput = createMemo(() => hasReadableToolOutput(outputText()));
const hasDetails = createMemo(() => hasInput() || hasOutput());
createEffect(() => {
@@ -444,7 +457,7 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =>
<Show when={showDetails() && hasDetails()}>
<ToolDetailsPanel
id={detailsId}
- input={hasInput() ? inputText() : ''}
+ input={hasInput() ? detailInputText() : ''}
output={hasOutput() ? outputText() : ''}
/>
</Show>
@@ -460,8 +473,11 @@ interface PendingToolBlockProps {
}
export const PendingToolBlock: Component<PendingToolBlockProps> = (props) => {
+ const [showDetails, setShowDetails] = createSignal(false);
+ const detailsId = createUniqueId();
const toolLabel = createMemo(() => getToolLabel(props.tool.name));
const inputText = createMemo(() => toolValueText(props.tool.input));
+ const detailInputText = createMemo(() => toolDetailInputText(inputText(), props.tool.rawInput));
const parsedInputSummary = createMemo(() =>
parseToolInputSummary(inputText(), props.tool.name, props.tool.rawInput),
);
@@ -487,6 +503,20 @@ export const PendingToolBlock: Component<PendingToolBlockProps> = (props) => {
return 'pending';
});
const progressText = createMemo(() => (props.tool.progress || '').trim());
+ const hasInput = createMemo(() => detailInputText().trim().length > 0);
+ const hasProgress = createMemo(() => progressText().length > 0);
+ const hasDetails = createMemo(() => hasInput() || hasProgress());
+ const summaryControlTitle = () => (showDetails() ? 'Hide tool details' : 'Show tool details');
+ const toggleDetails = () => {
+ if (!hasDetails()) return;
+ setShowDetails(!showDetails());
+ };
+ const handleSummaryKeyDown = (event: KeyboardEvent) => {
+ if (!hasDetails()) return;
+ if (event.key !== 'Enter' && event.key !== ' ') return;
+ event.preventDefault();
+ toggleDetails();
+ };
const activityIconClass = createMemo(() => {
if (status() === 'waiting') return 'h-3 w-3 shrink-0 text-amber-500 dark:text-amber-300';
return 'h-3 w-3 shrink-0 animate-spin text-blue-500 dark:text-blue-400';
@@ -504,39 +534,70 @@ export const PendingToolBlock: Component<PendingToolBlockProps> = (props) => {
});
return (
- <div class="my-1 rounded-md border border-blue-200 bg-blue-50/70 px-2.5 py-2 text-[11px] dark:border-blue-900/60 dark:bg-blue-950/20">
- <div class="flex min-w-0 items-start gap-2">
- <div class="pt-0.5">
- <Show
- when={status() === 'waiting'}
- fallback={<LoaderCircleIcon class={activityIconClass()} aria-label={statusLabel()} />}
- >
- <ClockIcon class={activityIconClass()} aria-label={statusLabel()} />
- </Show>
- </div>
+ <div class="my-1 overflow-hidden rounded-md border border-blue-200 bg-blue-50/70 text-[11px] dark:border-blue-900/60 dark:bg-blue-950/20">
+ <div
+ class={`px-2.5 py-2 ${
+ hasDetails()
+ ? 'cursor-pointer transition-colors hover:bg-blue-100/60 focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:ring-inset dark:hover:bg-blue-950/30'
+ : ''
+ }`}
+ role={hasDetails() ? 'button' : undefined}
+ tabIndex={hasDetails() ? 0 : undefined}
+ aria-expanded={hasDetails() ? showDetails() : undefined}
+ aria-controls={hasDetails() ? detailsId : undefined}
+ title={hasDetails() ? summaryControlTitle() : undefined}
+ onClick={toggleDetails}
+ onKeyDown={handleSummaryKeyDown}
+ >
+ <div class="flex min-w-0 items-start gap-2">
+ <div class="pt-0.5">
+ <Show
+ when={status() === 'waiting'}
+ fallback={<LoaderCircleIcon class={activityIconClass()} aria-label={statusLabel()} />}
+ >
+ <ClockIcon class={activityIconClass()} aria-label={statusLabel()} />
+ </Show>
+ </div>
- <div class="min-w-0 flex-1">
- <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
- <span class="shrink-0 font-mono text-[9px] font-semibold uppercase tracking-wider text-muted">
- {toolLabel()}
- </span>
- <span class="shrink-0 text-[10px] font-medium text-muted">{statusLabel()}</span>
- <Show when={elapsedLabel()}>
- <span class="shrink-0 text-[10px] text-muted">{elapsedLabel()}</span>
+ <div class="min-w-0 flex-1">
+ <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
+ <span class="shrink-0 font-mono text-[9px] font-semibold uppercase tracking-wider text-muted">
+ {toolLabel()}
+ </span>
+ <span class="shrink-0 text-[10px] font-medium text-muted">{statusLabel()}</span>
+ <Show when={elapsedLabel()}>
+ <span class="shrink-0 text-[10px] text-muted">{elapsedLabel()}</span>
+ </Show>
+ <Show when={hasDetails()}>
+ <ChevronRightIcon
+ class={`h-3.5 w-3.5 shrink-0 text-muted transition-transform ${
+ showDetails() ? 'rotate-90' : ''
+ }`}
+ aria-hidden="true"
+ />
+ </Show>
+ </div>
+ <ToolInputSummary summary={inputSummary()} />
+ <Show when={commandPreview()}>
+ <ToolCommandPreview preview={commandPreview()} />
</Show>
</div>
- <ToolInputSummary summary={inputSummary()} />
- <Show when={commandPreview()}>
- <ToolCommandPreview preview={commandPreview()} />
- </Show>
</div>
+
+ <Show when={progressText()}>
+ <div class="mt-1 min-w-0 pl-[calc(0.875rem+0.5rem)] text-[10px] leading-snug text-muted">
+ <span class="block whitespace-pre-wrap break-words" title={progressText()}>
+ {progressText()}
+ </span>
+ </div>
+ </Show>
</div>
- <Show when={progressText()}>
- <div class="mt-1 min-w-0 pl-[calc(0.875rem+0.5rem)] text-[10px] leading-snug text-muted">
- <span class="block whitespace-pre-wrap break-words" title={progressText()}>
- {progressText()}
- </span>
- </div>
+ <Show when={showDetails() && hasDetails()}>
+ <ToolDetailsPanel
+ id={detailsId}
+ input={hasInput() ? detailInputText() : ''}
+ progress={hasProgress() ? progressText() : ''}
+ />
</Show>
</div>
);
@@ -550,6 +611,7 @@ export const ToolCancellationBlock: Component<ToolCancellationBlockProps> = (pro
const detailsId = createUniqueId();
const toolLabel = createMemo(() => getToolLabel(props.tool.name));
const inputText = createMemo(() => toolValueText(props.tool.input));
+ const detailInputText = createMemo(() => toolDetailInputText(inputText(), props.tool.rawInput));
const parsedInputSummary = createMemo(() =>
parseToolInputSummary(inputText(), props.tool.name, props.tool.rawInput),
);
@@ -566,7 +628,7 @@ export const ToolCancellationBlock: Component<ToolCancellationBlockProps> = (pro
return preview;
});
const reason = createMemo(() => props.tool.reason?.trim() || 'Skipped before execution');
- const hasInput = createMemo(() => inputText().trim().length > 0);
+ const hasInput = createMemo(() => detailInputText().trim().length > 0);
const hasReason = createMemo(() => reason().trim().length > 0);
const hasDetails = createMemo(() => hasInput() || hasReason());
const summaryControlTitle = () => (showDetails() ? 'Hide tool details' : 'Show tool details');
@@ -638,7 +700,7 @@ export const ToolCancellationBlock: Component<ToolCancellationBlockProps> = (pro
<Show when={showDetails() && hasDetails()}>
<ToolDetailsPanel
id={detailsId}
- input={hasInput() ? inputText() : ''}
+ input={hasInput() ? detailInputText() : ''}
reason={hasReason() ? reason() : ''}
/>
</Show>
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx
index 6529f4afa6..d70af82143 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx
@@ -879,6 +879,104 @@ describe('PendingToolBlock', () => {
expect(screen.getByText('Waiting for approval.')).toBeInTheDocument();
expect(container.querySelector('svg.animate-spin')).toBeNull();
});
+
+ it('makes the pending tool row the details trigger when input or progress exists', () => {
+ render(() => (
+ <PendingToolBlock tool={makePending({ status: 'running', progress: 'Reading devices.' })} />
+ ));
+
+ const trigger = getToolDetailsTrigger();
+ expect(trigger).toBeInTheDocument();
+ expect(trigger).toHaveAttribute('role', 'button');
+ expect(trigger).toHaveAttribute('aria-expanded', 'false');
+ });
+
+ it('shows pending tool input and progress when details are opened', () => {
+ const input = '{"action":"exec","target_host":"current_resource","command":"ls /dev | wc -l"}';
+ const progress = 'Running read-only command.';
+ const { container } = render(() => (
+ <PendingToolBlock tool={makePending({ name: 'pulse_read', input, progress })} />
+ ));
+
+ const trigger = getToolDetailsTrigger();
+ fireEvent.click(trigger);
+
+ expect(trigger).toHaveAttribute('aria-expanded', 'true');
+ expect(trigger).toHaveAttribute('title', 'Hide tool details');
+ expect(screen.getByText('Input')).toBeInTheDocument();
+ expect(screen.getByText('Progress')).toBeInTheDocument();
+ const rawDetails = Array.from(container.querySelectorAll('pre'))
+ .map((pre) => pre.textContent || '')
+ .join('\n');
+ expect(rawDetails).toContain(input);
+ expect(rawDetails).toContain(progress);
+ });
+
+ it('uses raw streamed input in pending tool details while structured arguments are placeholders', () => {
+ const rawInput = 'pulse_read(target_host="current_resource", command="ls /dev | wc';
+ const { container } = render(() => (
+ <PendingToolBlock
+ tool={makePending({
+ name: 'pulse_read',
+ input: '{}',
+ rawInput,
+ progress: 'Receiving tool arguments.',
+ })}
+ />
+ ));
+
+ fireEvent.click(getToolDetailsTrigger());
+
+ const rawDetails = Array.from(container.querySelectorAll('pre'))
+ .map((pre) => pre.textContent || '')
+ .join('\n');
+ expect(rawDetails).toContain(rawInput);
+ expect(rawDetails).not.toContain('{}');
+ });
+
+ it('copies pending tool input and progress from the details panel', async () => {
+ const writeText = vi.fn().mockResolvedValue(undefined);
+ Object.defineProperty(navigator, 'clipboard', {
+ value: { writeText },
+ configurable: true,
+ });
+ const input = '{"action":"exec","target_host":"current_resource","command":"ls /dev | wc -l"}';
+ const progress = 'Running read-only command.';
+
+ render(() => <PendingToolBlock tool={makePending({ name: 'pulse_read', input, progress })} />);
+ fireEvent.click(getToolDetailsTrigger());
+ fireEvent.click(screen.getByRole('button', { name: 'Copy tool input' }));
+
+ await waitFor(() => {
+ expect(writeText).toHaveBeenCalledWith(input);
+ });
+ await waitFor(() => {
+ expect(screen.getByRole('button', { name: 'Copied tool input' })).toBeInTheDocument();
+ });
+
+ fireEvent.click(screen.getByRole('button', { name: 'Copy tool progress' }));
+ await waitFor(() => {
+ expect(writeText).toHaveBeenLastCalledWith(progress);
+ });
+ await waitFor(() => {
+ expect(screen.getByRole('button', { name: 'Copied tool progress' })).toBeInTheDocument();
+ });
+ });
+
+ it('toggles pending tool details from the keyboard', () => {
+ render(() => (
+ <PendingToolBlock tool={makePending({ status: 'running', progress: 'Running command.' })} />
+ ));
+
+ const trigger = getToolDetailsTrigger();
+ fireEvent.keyDown(trigger, { key: 'Enter' });
+ expect(trigger).toHaveAttribute('aria-expanded', 'true');
+ expect(screen.getByText('Progress')).toBeInTheDocument();
+
+ fireEvent.keyDown(trigger, { key: ' ' });
+ expect(trigger).toHaveAttribute('aria-expanded', 'false');
+ expect(screen.queryByText('Progress')).not.toBeInTheDocument();
+ });
});
describe('ToolCancellationBlock', () => {