fix: keep bare reset transcript prompt non-empty

This commit is contained in:
Maho Pan
2026-04-27 10:58:30 -04:00
committed by Peter Steinberger
parent 03bfdbb052
commit 1dbc250b1a
2 changed files with 4 additions and 4 deletions

View File

@@ -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 () => {

View File

@@ -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]";