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:
@@ -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={{
|
||||
|
||||
Reference in New Issue
Block a user