

























@@ -1017,6 +1017,85 @@ describe("runPreparedReply media-only handling", () => {
10171017expect(call?.transcriptCommandBody).toBe("[OpenClaw heartbeat poll]");
10181018expect(call?.followupRun.transcriptPrompt).toBe("[OpenClaw heartbeat poll]");
10191019});
1020+1021+it("keeps bare reset startup instructions out of visible transcript prompt", async () => {
1022+await runPreparedReply(
1023+baseParams({
1024+ctx: {
1025+Body: "/new",
1026+RawBody: "/new",
1027+CommandBody: "/new",
1028+Provider: "webchat",
1029+Surface: "webchat",
1030+ChatType: "direct",
1031+},
1032+sessionCtx: {
1033+Body: "",
1034+BodyStripped: "",
1035+Provider: "webchat",
1036+Surface: "webchat",
1037+ChatType: "direct",
1038+},
1039+command: {
1040+surface: "webchat",
1041+channel: "webchat",
1042+isAuthorizedSender: true,
1043+abortKey: "session-key",
1044+ownerList: [],
1045+senderIsOwner: true,
1046+rawBodyNormalized: "/new",
1047+commandBodyNormalized: "/new",
1048+} as never,
1049+}),
1050+);
1051+1052+const call = vi.mocked(runReplyAgent).mock.calls.at(-1)?.[0];
1053+expect(call?.commandBody).toContain("A new session was started via /new or /reset.");
1054+expect(call?.followupRun.prompt).toContain("A new session was started via /new or /reset.");
1055+expect(call?.transcriptCommandBody).toBe("");
1056+expect(call?.followupRun.transcriptPrompt).toBe("");
1057+});
1058+1059+it("keeps reset user notes visible while hiding startup instructions", async () => {
1060+await runPreparedReply(
1061+baseParams({
1062+ctx: {
1063+Body: "/reset summarize my workspace",
1064+RawBody: "/reset summarize my workspace",
1065+CommandBody: "/reset summarize my workspace",
1066+Provider: "webchat",
1067+Surface: "webchat",
1068+ChatType: "direct",
1069+},
1070+sessionCtx: {
1071+Body: "",
1072+BodyStripped: "",
1073+Provider: "webchat",
1074+Surface: "webchat",
1075+ChatType: "direct",
1076+},
1077+command: {
1078+surface: "webchat",
1079+channel: "webchat",
1080+isAuthorizedSender: true,
1081+abortKey: "session-key",
1082+ownerList: [],
1083+senderIsOwner: true,
1084+rawBodyNormalized: "/reset summarize my workspace",
1085+commandBodyNormalized: "/reset summarize my workspace",
1086+softResetTriggered: true,
1087+softResetTail: "summarize my workspace",
1088+} as never,
1089+}),
1090+);
1091+1092+const call = vi.mocked(runReplyAgent).mock.calls.at(-1)?.[0];
1093+expect(call?.commandBody).toContain("A new session was started via /new or /reset.");
1094+expect(call?.commandBody).toContain("summarize my workspace");
1095+expect(call?.transcriptCommandBody).toBe("summarize my workspace");
1096+expect(call?.followupRun.transcriptPrompt).toBe("summarize my workspace");
1097+});
1098+10201099it("uses inbound origin channel for run messageProvider", async () => {
10211100await runPreparedReply(
10221101baseParams({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。