Skip to content

Commit 267ebc3

Browse files
committed
fix: remove em dashes from prompt text
1 parent dcfc1f1 commit 267ebc3

9 files changed

Lines changed: 18 additions & 18 deletions

src/agents/date-time.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function formatUserTime(
186186
const timePart = use24Hour
187187
? `${map.hour}:${map.minute}`
188188
: `${map.hour}:${map.minute} ${map.dayPeriod ?? ""}`.trim();
189-
return `${map.weekday}, ${map.month} ${dayNum}${suffix}, ${map.year} ${timePart}`;
189+
return `${map.weekday}, ${map.month} ${dayNum}${suffix}, ${map.year} - ${timePart}`;
190190
} catch {
191191
return undefined;
192192
}

src/agents/prompt-composition-scenarios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function buildCommonSystemParams(workspaceDir: string) {
6262
shell: "zsh",
6363
},
6464
userTimezone: "America/Los_Angeles",
65-
userTime: "Monday, March 16th, 2026 9:00 PM",
65+
userTime: "Monday, March 16th, 2026 - 9:00 PM",
6666
userTimeFormat: "12" as const,
6767
toolNames,
6868
};
@@ -568,7 +568,7 @@ async function createMaintenanceScenario(workspaceDir: string): Promise<PromptSc
568568
"Store durable memories only in memory/2026-03-15.md (create memory/ if needed).",
569569
"Treat workspace bootstrap/reference files such as MEMORY.md, SOUL.md, TOOLS.md, and AGENTS.md as read-only during this flush; never overwrite, replace, or edit them.",
570570
"If nothing to store, reply with NO_REPLY.",
571-
"Current time: Sunday, March 15th, 2026 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
571+
"Current time: Sunday, March 15th, 2026 - 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
572572
].join("\n");
573573
const memoryFlushSystemPrompt = buildSystemPrompt({
574574
workspaceDir,
@@ -592,7 +592,7 @@ async function createMaintenanceScenario(workspaceDir: string): Promise<PromptSc
592592
"## Red Lines",
593593
"Do not delete production data.",
594594
"",
595-
"Current time: Sunday, March 15th, 2026 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
595+
"Current time: Sunday, March 15th, 2026 - 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
596596
].join("\n");
597597
const postCompactionSystemPrompt = buildSystemPrompt({
598598
workspaceDir,

src/agents/system-prompt.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ describe("buildAgentSystemPrompt", () => {
502502
params: {
503503
workspaceDir: "/tmp/openclaw",
504504
userTimezone: "America/Chicago",
505-
userTime: "Monday, January 5th, 2026 3:26 PM",
505+
userTime: "Monday, January 5th, 2026 - 3:26 PM",
506506
userTimeFormat: "12" as const,
507507
},
508508
},
@@ -511,7 +511,7 @@ describe("buildAgentSystemPrompt", () => {
511511
params: {
512512
workspaceDir: "/tmp/openclaw",
513513
userTimezone: "America/Chicago",
514-
userTime: "Monday, January 5th, 2026 15:26",
514+
userTime: "Monday, January 5th, 2026 - 15:26",
515515
userTimeFormat: "24" as const,
516516
},
517517
},
@@ -549,7 +549,7 @@ describe("buildAgentSystemPrompt", () => {
549549
const prompt = buildAgentSystemPrompt({
550550
workspaceDir: "/tmp/clawd",
551551
userTimezone: "America/Chicago",
552-
userTime: "Monday, January 5th, 2026 3:26 PM",
552+
userTime: "Monday, January 5th, 2026 - 3:26 PM",
553553
userTimeFormat: "12",
554554
});
555555

src/auto-reply/reply/directive-handling.shared.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ export const canPersistInternalVerboseDirective = canPersistInternalDirective;
4343

4444
export const formatElevatedEvent = (level: ElevatedLevel) => {
4545
if (level === "full") {
46-
return "Elevated FULL exec runs on host with auto-approval.";
46+
return "Elevated FULL - exec runs on host with auto-approval.";
4747
}
4848
if (level === "ask" || level === "on") {
49-
return "Elevated ASK exec runs on host; approvals may still apply.";
49+
return "Elevated ASK - exec runs on host; approvals may still apply.";
5050
}
51-
return "Elevated OFF exec stays in sandbox.";
51+
return "Elevated OFF - exec stays in sandbox.";
5252
};
5353

5454
export const formatReasoningEvent = (level: ReasoningLevel) => {
5555
if (level === "stream") {
56-
return "Reasoning STREAM emit live <think>.";
56+
return "Reasoning STREAM - emit live <think>.";
5757
}
5858
if (level === "on") {
59-
return "Reasoning ON include <think>.";
59+
return "Reasoning ON - include <think>.";
6060
}
61-
return "Reasoning OFF hide <think>.";
61+
return "Reasoning OFF - hide <think>.";
6262
};
6363

6464
export function enqueueModeSwitchEvents(params: {

src/auto-reply/reply/get-reply-run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ export async function runPreparedReply(
365365
const skillsSnapshot = skillResult.skillsSnapshot;
366366
const mediaNote = buildInboundMediaNote(ctx);
367367
const mediaReplyHint = mediaNote
368-
? "To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg (spaces ok, quote if needed) or a safe relative path like MEDIA:./image.jpg. Avoid absolute paths (MEDIA:/...) and ~ paths they are blocked for security. Keep caption in the text body."
368+
? "To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg (spaces ok, quote if needed) or a safe relative path like MEDIA:./image.jpg. Avoid absolute paths (MEDIA:/...) and ~ paths - they are blocked for security. Keep caption in the text body."
369369
: undefined;
370370
let { prefixedCommandBody, queuedBody } = await rebuildPromptBodies();
371371
if (!resolvedThinkLevel) {

src/auto-reply/reply/groups.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function buildGroupChatContext(params: { sessionCtx: TemplateContext }):
114114
lines.push(`Participants: ${members}.`);
115115
}
116116
lines.push(
117-
"Your replies are automatically sent to this group chat. Do not use the message tool to send to this same group just reply normally.",
117+
"Your replies are automatically sent to this group chat. Do not use the message tool to send to this same group - just reply normally.",
118118
);
119119
return lines.join(" ");
120120
}

src/auto-reply/reply/post-compaction-context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Never modify memory/YYYY-MM-DD.md destructively.
234234
expect(result).toContain("memory/2026-03-03.md");
235235
expect(result).not.toContain("memory/YYYY-MM-DD.md");
236236
expect(result).toContain(
237-
"Current time: Tuesday, March 3rd, 2026 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
237+
"Current time: Tuesday, March 3rd, 2026 - 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
238238
);
239239
});
240240

src/auto-reply/reply/post-compaction-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export async function readPostCompactionContext(
136136
// would be misleading for deployments that use different section names.
137137
const prose = isDefaultSections
138138
? "Session was just compacted. The conversation summary above is a hint, NOT a substitute for your startup sequence. " +
139-
"Run your Session Startup sequence read the required files before responding to the user."
139+
"Run your Session Startup sequence - read the required files before responding to the user."
140140
: `Session was just compacted. The conversation summary above is a hint, NOT a substitute for your full startup sequence. ` +
141141
`Re-read the sections injected below (${displayNames.join(", ")}) and follow your configured startup procedure before responding to the user.`;
142142

src/auto-reply/reply/session-reset-prompt.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("buildBareSessionResetPrompt", () => {
1717
const nowMs = Date.UTC(2026, 2, 3, 14, 0, 0);
1818
const prompt = buildBareSessionResetPrompt(cfg, nowMs);
1919
expect(prompt).toContain(
20-
"Current time: Tuesday, March 3rd, 2026 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
20+
"Current time: Tuesday, March 3rd, 2026 - 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
2121
);
2222
});
2323

0 commit comments

Comments
 (0)