fix(claude): verify the contributed filter through session history

Incorporate #7591 and preserve its production fix. Replace the mocked mapper test with file-backed session history coverage, including supported system events.
This commit is contained in:
paseo-bot[bot]
2026-10-21 17:49:29 +02:00
@@ -6397,17 +6397,17 @@ function convertClaudeHistoryEntryPreamble(
return { shortCircuit: [taskNotificationItem] };
}
// Request-journal records carry message-shaped context, not conversation turns.
if (entry.type !== "user" && entry.type !== "assistant") {
return { shortCircuit: [] };
}
if (entry.isCompactSummary) {
return { shortCircuit: [] };
}
if (entry.type === "user" && isSyntheticHistoryUserEntry(entry)) {
return { shortCircuit: [] };
}
// Only user and assistant records are conversation turns. Claude Code 2.1.x also journals each
// API request as `api-request-blob` records whose message replays the system context.
if (entry.type !== "user" && entry.type !== "assistant") {
return { shortCircuit: [] };
}
const message = entry?.message;
if (!message || !("content" in message)) {