pi-mono/packages/coding-agent/test/session-manager
David Brailovsky ff72faba28 fix(coding-agent): save new session file at the first user message
A new session was only written to disk once the first assistant message
existed. If pi exited during the first turn (Ctrl+C twice while streaming,
or the process was killed), the user's prompt was lost and the session
never appeared in /resume.

The file is now created as soon as the session has a user or assistant
message. A session with only setup entries (model, thinking level) still
stays in memory, so starting pi and quitting without chatting leaves no
file. Forking uses the same rule through a shared helper, so the two paths
cannot drift apart and write the header twice (#1672).

closes #10000
2026-09-25 16:27:51 +02:00
..
build-context.test.ts fix(coding-agent): add entry renderers for session entries 2026-07-01 11:30:26 +02:00
custom-session-id.test.ts fix(coding-agent): allow session id for no-session runs 2026-06-25 14:44:44 +02:00
file-operations.test.ts fix(coding-agent): save new session file at the first user message 2026-09-25 16:27:51 +02:00
labels.test.ts fix(coding-agent): rechain fork paths without labels 2026-06-12 18:50:31 +02:00
load-entries.test.ts feat(coding-agent): ingest external entries in in-memory sessions (#8980) 2026-09-03 10:49:41 +02:00
migration.test.ts chore: pin dependencies and use native TypeScript 2026-05-20 12:46:17 +02:00
save-entry.test.ts chore: pin dependencies and use native TypeScript 2026-05-20 12:46:17 +02:00
tree-traversal.test.ts fix(coding-agent): save new session file at the first user message 2026-09-25 16:27:51 +02:00