fix(session): ignore internal synthetic turns

This commit is contained in:
YeonGyu-Kim
2026-05-15 23:16:05 +09:00
parent e8de8b79a8
commit c580b8f2ce
14 changed files with 464 additions and 80 deletions
+4 -3
View File
@@ -1,8 +1,9 @@
import type { KeywordType } from "../../config/schema/keyword-detector"
import { isRealUserTextPart } from "../../shared/internal-initiator-marker"
import {
KEYWORD_DETECTORS,
CODE_BLOCK_PATTERN,
INLINE_CODE_PATTERN,
KEYWORD_DETECTORS,
} from "./constants"
export interface DetectedKeyword {
@@ -61,10 +62,10 @@ export function detectKeywordsWithType(
}
export function extractPromptText(
parts: Array<{ type: string; text?: string }>
parts: Array<{ type: string; text?: string; synthetic?: boolean }>
): string {
return parts
.filter((p) => p.type === "text")
.filter(isRealUserTextPart)
.map((p) => p.text || "")
.join(" ")
}