fix(hooks): preserve metadata-marked human prompts

This commit is contained in:
haelyra
2026-08-28 16:28:12 -04:00
parent 77c358dd3f
commit 1d19789c75
2 changed files with 39 additions and 1 deletions
+4 -1
View File
@@ -49,7 +49,10 @@ function extractSessionSummary(transcriptPath) {
const cleaned = stripAnsi(text).trim();
// Skip harness noise: local command echoes, caveats, system reminders.
const isNoise = /^<(local-command-caveat|local-command-stdout|command-name|command-message|command-args|system-reminder|task-notification)/i.test(cleaned);
if (cleaned && !isToolResult && !isNoise && !entry.isMeta) {
// `isMeta` is also used for genuine channel- and plugin-originated
// human prompts. Exclude known structured noise above instead of
// discarding every metadata-marked user turn.
if (cleaned && !isToolResult && !isNoise) {
userMessages.push(cleaned.slice(0, 200));
}
}