fix(builtin): session lifecycle + frontmatter preamble stripping #441
Reference in New Issue
Block a user
Delete Branch "fix/builtin-session-lifecycle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fix two bugs found during dogfooding the builtin agent:
removeSessionwas called at the end of everyrunBuiltinWithMessages, wiping the session file beforecontinuecould use it---fence, causing parse failureChanges
Bug 1: Session lifecycle
removeSessioncall fromrunBuiltinWithMessages— session files now persist naturallyBug 2: Frontmatter preamble
stripPreamble()inagent.ts— defensively strips text before the first---fence---at position 0Testing
Ref: dogfood thread 06F59MSH1JJ9PPYM49893FW9H8
LGTM ✅
Bug 1: removeSession 移除正确,session JSONL 应保留供 continue 使用。
Bug 2: prompt CRITICAL 指令 + stripPreamble 双保险,tagged log 方便追踪。