From 5c73ed62d5cff4437e0aad2403f3f83b54f0437d Mon Sep 17 00:00:00 2001 From: 2233admin <57929895+2233admin@users.noreply.github.com> Date: Sat, 14 Mar 2026 10:00:24 +0800 Subject: [PATCH] fix(sessions): create transcript file on chat.inject when missing (#36645) `chat.inject` called `appendAssistantTranscriptMessage` with `createIfMissing: false`, causing a hard error when the transcript file did not exist on disk despite having a valid `transcriptPath` in session metadata. This commonly happens with ACP oneshot/run sessions where the session entry is created but the transcript file is not yet materialized. The fix is a one-character change: `createIfMissing: true`. The `ensureTranscriptFile` helper already handles directory creation and file initialization safely. Fixes #36170 Co-authored-by: Claude Opus 4.6 --- src/gateway/server-methods/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gateway/server-methods/chat.ts b/src/gateway/server-methods/chat.ts index 909d933ae81..3b506c052c0 100644 --- a/src/gateway/server-methods/chat.ts +++ b/src/gateway/server-methods/chat.ts @@ -1471,7 +1471,7 @@ export const chatHandlers: GatewayRequestHandlers = { storePath, sessionFile: entry?.sessionFile, agentId: resolveSessionAgentId({ sessionKey: rawSessionKey, config: cfg }), - createIfMissing: false, + createIfMissing: true, }); if (!appended.ok || !appended.messageId || !appended.message) { respond(