From 1dbc250b1aab0612b59bc3c3bdf07d0a0a4c5758 Mon Sep 17 00:00:00 2001 From: Maho Pan Date: Mon, 27 Apr 2026 10:58:30 -0400 Subject: [PATCH] fix: keep bare reset transcript prompt non-empty --- src/auto-reply/reply/get-reply-run.media-only.test.ts | 6 +++--- src/auto-reply/reply/get-reply-run.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/auto-reply/reply/get-reply-run.media-only.test.ts b/src/auto-reply/reply/get-reply-run.media-only.test.ts index c17dc56a084..fbac41a80d2 100644 --- a/src/auto-reply/reply/get-reply-run.media-only.test.ts +++ b/src/auto-reply/reply/get-reply-run.media-only.test.ts @@ -1018,7 +1018,7 @@ describe("runPreparedReply media-only handling", () => { expect(call?.followupRun.transcriptPrompt).toBe("[OpenClaw heartbeat poll]"); }); - it("keeps bare reset startup instructions out of visible transcript prompt", async () => { + it("uses a non-empty transcript marker while keeping bare reset startup instructions out of visible transcript prompt", async () => { await runPreparedReply( baseParams({ ctx: { @@ -1052,8 +1052,8 @@ describe("runPreparedReply media-only handling", () => { const call = vi.mocked(runReplyAgent).mock.calls.at(-1)?.[0]; expect(call?.commandBody).toContain("A new session was started via /new or /reset."); expect(call?.followupRun.prompt).toContain("A new session was started via /new or /reset."); - expect(call?.transcriptCommandBody).toBe(""); - expect(call?.followupRun.transcriptPrompt).toBe(""); + expect(call?.transcriptCommandBody).toBe("[OpenClaw session new]"); + expect(call?.followupRun.transcriptPrompt).toBe("[OpenClaw session new]"); }); it("keeps reset user notes visible while hiding startup instructions", async () => { diff --git a/src/auto-reply/reply/get-reply-run.ts b/src/auto-reply/reply/get-reply-run.ts index 9660af0633e..df782f06eb2 100644 --- a/src/auto-reply/reply/get-reply-run.ts +++ b/src/auto-reply/reply/get-reply-run.ts @@ -502,7 +502,7 @@ export async function runPreparedReply( const transcriptBodyBase = isHeartbeat ? HEARTBEAT_TRANSCRIPT_PROMPT : isBareSessionReset - ? softResetTail + ? softResetTail || `[OpenClaw session ${startupAction}]` : hasUserBody ? baseBodyFinal : "[User sent media without caption]";