mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-05 07:54:38 +00:00
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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user