fix(chat): hide internal system messages from webchat (#710)

This commit is contained in:
Kagura
2026-03-30 14:57:26 +08:00
committed by GitHub
Unverified
parent 47c9560b9e
commit ef3cf64484
5 changed files with 129 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import {
enrichWithToolResultFiles,
getMessageText,
hasNonToolAssistantContent,
isInternalMessage,
isToolResultRole,
loadMissingPreviews,
toMs,
@@ -39,7 +40,7 @@ export function createHistoryActions(
const applyLoadedMessages = (rawMessages: RawMessage[], thinkingLevel: string | null) => {
// Before filtering: attach images/files from tool_result messages to the next assistant message
const messagesWithToolImages = enrichWithToolResultFiles(rawMessages);
const filteredMessages = messagesWithToolImages.filter((msg) => !isToolResultRole(msg.role));
const filteredMessages = messagesWithToolImages.filter((msg) => !isToolResultRole(msg.role) && !isInternalMessage(msg));
// Restore file attachments for user/assistant messages (from cache + text patterns)
const enrichedMessages = enrichWithCachedImages(filteredMessages);