feat: display ask_clarification tool messages directly in frontend

Simplify clarification message handling by having the frontend detect and
display ask_clarification tool messages directly, instead of relying on
backend to add an extra AIMessage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hetaoBackend
2026-01-29 01:25:05 +08:00
parent a010953880
commit d4bfed271b
3 changed files with 44 additions and 12 deletions

View File

@@ -53,6 +53,17 @@ export function MessageList({
/>
);
}
if (group.type === "assistant:clarification") {
const message = group.messages[0];
if (message && hasContent(message)) {
return (
<MessageResponse key={group.id} rehypePlugins={rehypePlugins}>
{extractContentFromMessage(message)}
</MessageResponse>
);
}
return null;
}
if (group.type === "assistant:present-files") {
const files: string[] = [];
for (const message of group.messages) {