story-kit: merge 290_story_show_agent_output_stream_in_expanded_work_item_detail_panel

This commit is contained in:
Dave
2026-03-18 15:28:08 +00:00
parent 68bf179407
commit 83ccfece81
3 changed files with 129 additions and 205 deletions
+2 -50
View File
@@ -13,7 +13,6 @@ const { useCallback, useEffect, useRef, useState } = React;
interface AgentState {
agentName: string;
status: AgentStatusValue;
log: string[];
sessionId: string | null;
worktreePath: string | null;
baseBranch: string | null;
@@ -120,7 +119,6 @@ export function AgentPanel({
const current = prev[key] ?? {
agentName,
status: "pending" as AgentStatusValue,
log: [],
sessionId: null,
worktreePath: null,
baseBranch: null,
@@ -144,14 +142,6 @@ export function AgentPanel({
},
};
}
case "output":
return {
...prev,
[key]: {
...current,
log: [...current.log, event.text ?? ""],
},
};
case "done":
return {
...prev,
@@ -168,17 +158,12 @@ export function AgentPanel({
[key]: {
...current,
status: "failed",
log: [
...current.log,
`[ERROR] ${event.message ?? "Unknown error"}`,
],
terminalAt: current.terminalAt ?? Date.now(),
},
};
case "thinking":
// Thinking traces are internal model state — never display them.
return prev;
default:
// output, thinking, and other events are not displayed in the sidebar.
// Agent output streams appear in the work item detail panel instead.
return prev;
}
});
@@ -204,7 +189,6 @@ export function AgentPanel({
agentMap[key] = {
agentName: a.agent_name,
status: a.status,
log: [],
sessionId: a.session_id,
worktreePath: a.worktree_path,
baseBranch: a.base_branch,
@@ -261,9 +245,6 @@ export function AgentPanel({
}
};
// Agents that have streaming content to show
const activeAgents = Object.values(agents).filter((a) => a.log.length > 0);
return (
<div
style={{
@@ -420,35 +401,6 @@ export function AgentPanel({
</div>
)}
{/* Per-agent streaming output */}
{activeAgents.map((agent) => (
<div
key={`stream-${agent.agentName}`}
data-testid={`agent-stream-${agent.agentName}`}
style={{
display: "flex",
flexDirection: "column",
gap: "4px",
}}
>
{agent.log.length > 0 && (
<div
data-testid={`agent-output-${agent.agentName}`}
style={{
fontSize: "0.8em",
fontFamily: "monospace",
color: "#ccc",
whiteSpace: "pre-wrap",
wordBreak: "break-word",
lineHeight: "1.5",
}}
>
{agent.log.join("")}
</div>
)}
</div>
))}
{actionError && (
<div
style={{