diff --git a/frontend/src/features/agents/CustomAgentChatView.test.tsx b/frontend/src/features/agents/CustomAgentChatView.test.tsx index dfbea426..45f84f31 100644 --- a/frontend/src/features/agents/CustomAgentChatView.test.tsx +++ b/frontend/src/features/agents/CustomAgentChatView.test.tsx @@ -383,6 +383,7 @@ describe("CustomAgentChatView", () => { expect(agentBubble).toBeTruthy(); expect(errorBubble).toBeTruthy(); + expect(within(errorBubble!).getByText("Session Codex")).toBeTruthy(); expect( within(agentBubble!).getByText(expectedChatTime(firstDeltaReceivedAtMs)), ).toBeTruthy(); diff --git a/frontend/src/features/agents/CustomAgentChatView.tsx b/frontend/src/features/agents/CustomAgentChatView.tsx index 78aa665b..c2905929 100644 --- a/frontend/src/features/agents/CustomAgentChatView.tsx +++ b/frontend/src/features/agents/CustomAgentChatView.tsx @@ -144,6 +144,23 @@ function describeOpenFailure(e: unknown): string { return message || "Cause technique non disponible."; } +function structuredSessionLabel( + adapter: AgentProfile["structuredAdapter"], +): string | null { + switch (adapter) { + case "codex": + return "Session Codex"; + case "claude": + return "Session Claude"; + case "openCode": + return "Session OpenCode"; + case "openAiCompatible": + return "Session HTTP"; + default: + return null; + } +} + function instrumentationError(e: unknown): Record { if (e && typeof e === "object") { const err = e as GatewayError & { name?: string }; @@ -1018,6 +1035,7 @@ export function CustomAgentChatView({ [agentId, conversationId, projectId], ); const displayTurns = turns; + const sessionLabel = structuredSessionLabel(profile.structuredAdapter); const [requesterDelegation, setRequesterDelegation] = useState({ active: false }); @@ -2162,6 +2180,7 @@ export function CustomAgentChatView({ key={index} turn={turn} requesterName={agentName} + sessionLabel={sessionLabel} expandedProgressKeys={expandedProgressKeys} onToggleProgressExpanded={(key) => setExpandedProgressKeys((prev) => { @@ -2352,11 +2371,13 @@ export function CustomAgentChatView({ function ChatBubble({ turn, requesterName, + sessionLabel, expandedProgressKeys, onToggleProgressExpanded, }: { turn: ChatTurn; requesterName: string; + sessionLabel: string | null; expandedProgressKeys: Set; onToggleProgressExpanded: (key: string) => void; }) { @@ -2406,6 +2427,9 @@ function ChatBubble({ labelClassName="font-semibold text-danger" /> )} + {turn.role === "error" && sessionLabel && ( +

{sessionLabel}

+ )} {turn.role === "unknown" ? "Chunk inconnu reçu: " : ""} {turn.text}