Skip to content

Commit 370eaba

Browse files
dzianisvengineer
andcommitted
fix(session): recover orphaned assistant messages on startup (#59)
When the server crashes or restarts while a session is actively executing tool calls, in-memory session state is lost but the database retains stale incomplete messages. This leaves sessions permanently stuck in a 'Thinking' state with no way to recover. Add Session.recover() that runs during InstanceBootstrap to: - find assistant messages with no time.completed - force running/pending tool parts to error status - mark orphaned messages as completed - emit bus events so connected frontends update Closes anomalyco#19023 Co-authored-by: engineer <[email protected]>
1 parent 3e8d555 commit 370eaba

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎packages/opencode/src/project/bootstrap.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Instance } from "./instance"
1212
import { Log } from "@/util/log"
1313
import { ShareNext } from "@/share/share-next"
1414
import { Session } from "@/session"
15-
import { GC } from "@/util/gc"
1615

1716
export async function InstanceBootstrap() {
1817
Log.Default.info("bootstrapping", { directory: Instance.directory })

0 commit comments

Comments
 (0)