feat: add isContextOnly flag to extraction messages to prevent repeated extraction

- buildExtractionMessages marks messages with isContextOnly (seq < startIdx)
- formatExtractionTranscript inserts section dividers for mixed context/target
- extractor.js Layer 1 prompt splits context review vs extraction target with guidance
- Add tests/extraction-context-only-flag.mjs (7 test cases)
This commit is contained in:
Youzini-afk
2026-04-12 12:45:55 +08:00
parent 84eaecbecc
commit a8e3169002
4 changed files with 208 additions and 21 deletions

View File

@@ -286,6 +286,7 @@ export function buildExtractionMessages(chat, startIdx, endIdx, settings) {
rawContent: String(msg?.mes ?? ""),
name: String(msg?.name ?? "").trim(),
speaker: String(msg?.name ?? "").trim(),
isContextOnly: index < startIdx,
});
}