feat(KB-189): suppress duplicate agent badges on consecutive inline entries

- Add showBadge logic to skip badge on consecutive inline entries from same agent/type
- Always show badge on block-level entries (tool, tool_result, tool_error)
- Re-show badge on agent transitions and type changes within inline entries
- Add 7 test cases covering deduplication, transitions, block-level, and no-agent scenarios
This commit is contained in:
Dustin Byrne
2026-03-28 21:51:40 -04:00
parent 478ba72044
commit 51c4afdcae
2 changed files with 92 additions and 1 deletions

View File

@@ -68,7 +68,13 @@ export function AgentLogViewer({ entries, loading }: AgentLogViewerProps) {
}}
>
{entries.map((entry, i) => {
const agentBadge = entry.agent ? (
const prev = entries[i - 1];
const isBlockLevel = entry.type === "tool" || entry.type === "tool_result" || entry.type === "tool_error";
const showBadge = entry.agent
? isBlockLevel || i === 0 || prev?.agent !== entry.agent || prev?.type !== entry.type
: false;
const agentBadge = showBadge ? (
<span
className="agent-log-agent-badge"
style={{