From c1fce7a9cf50a599eb05a7fa4e967cb71aefd908 Mon Sep 17 00:00:00 2001 From: weishu Date: Sun, 21 Dec 2025 22:02:58 +0800 Subject: [PATCH] fix(web): handle codex content type in message normalization Add isCodexContent() helper and check for failed normalization of codex content to properly skip unsupported codex message types during decryption --- web/src/chat/normalize.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/chat/normalize.ts b/web/src/chat/normalize.ts index c882c655..e3f2d863 100644 --- a/web/src/chat/normalize.ts +++ b/web/src/chat/normalize.ts @@ -29,6 +29,10 @@ function isSkippableAgentContent(content: unknown): boolean { return Boolean(data.isMeta) || Boolean(data.isCompactSummary) } +function isCodexContent(content: unknown): boolean { + return isObject(content) && content.type === 'codex' +} + type RoleWrappedRecord = { role: string content: unknown @@ -404,6 +408,9 @@ export function normalizeDecryptedMessage(message: DecryptedMessage): Normalized return null } const normalized = normalizeAgentRecord(message.id, message.localId, message.createdAt, record.content, record.meta) + if (!normalized && isCodexContent(record.content)) { + return null + } return normalized ? { ...normalized, status: message.status, originalText: message.originalText } : {