mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 13:03:42 +00:00
fix(coding-agent): persist user message after fork
When hasAssistant guard returns early, set flushed=false so the next persist (after assistant arrives) writes all entries including the user message.
This commit is contained in:
parent
4990981e47
commit
b5be54b8ef
1 changed files with 5 additions and 1 deletions
|
|
@ -792,7 +792,11 @@ export class SessionManager {
|
|||
if (!this.persist || !this.sessionFile) return;
|
||||
|
||||
const hasAssistant = this.fileEntries.some((e) => e.type === "message" && e.message.role === "assistant");
|
||||
if (!hasAssistant) return;
|
||||
if (!hasAssistant) {
|
||||
// Mark as not flushed so when assistant arrives, all entries get written
|
||||
this.flushed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.flushed) {
|
||||
for (const e of this.fileEntries) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue