mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 04:31:10 +00:00
fix: remove em dashes from prompt text
This commit is contained in:
@@ -186,7 +186,7 @@ export function formatUserTime(
|
||||
const timePart = use24Hour
|
||||
? `${map.hour}:${map.minute}`
|
||||
: `${map.hour}:${map.minute} ${map.dayPeriod ?? ""}`.trim();
|
||||
return `${map.weekday}, ${map.month} ${dayNum}${suffix}, ${map.year} — ${timePart}`;
|
||||
return `${map.weekday}, ${map.month} ${dayNum}${suffix}, ${map.year} - ${timePart}`;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ function buildCommonSystemParams(workspaceDir: string) {
|
||||
shell: "zsh",
|
||||
},
|
||||
userTimezone: "America/Los_Angeles",
|
||||
userTime: "Monday, March 16th, 2026 — 9:00 PM",
|
||||
userTime: "Monday, March 16th, 2026 - 9:00 PM",
|
||||
userTimeFormat: "12" as const,
|
||||
toolNames,
|
||||
};
|
||||
@@ -568,7 +568,7 @@ async function createMaintenanceScenario(workspaceDir: string): Promise<PromptSc
|
||||
"Store durable memories only in memory/2026-03-15.md (create memory/ if needed).",
|
||||
"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.",
|
||||
"If nothing to store, reply with NO_REPLY.",
|
||||
"Current time: Sunday, March 15th, 2026 — 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
|
||||
"Current time: Sunday, March 15th, 2026 - 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
|
||||
].join("\n");
|
||||
const memoryFlushSystemPrompt = buildSystemPrompt({
|
||||
workspaceDir,
|
||||
@@ -592,7 +592,7 @@ async function createMaintenanceScenario(workspaceDir: string): Promise<PromptSc
|
||||
"## Red Lines",
|
||||
"Do not delete production data.",
|
||||
"",
|
||||
"Current time: Sunday, March 15th, 2026 — 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
|
||||
"Current time: Sunday, March 15th, 2026 - 9:30 PM (America/Los_Angeles) / 2026-03-16 04:30 UTC",
|
||||
].join("\n");
|
||||
const postCompactionSystemPrompt = buildSystemPrompt({
|
||||
workspaceDir,
|
||||
|
||||
@@ -502,7 +502,7 @@ describe("buildAgentSystemPrompt", () => {
|
||||
params: {
|
||||
workspaceDir: "/tmp/openclaw",
|
||||
userTimezone: "America/Chicago",
|
||||
userTime: "Monday, January 5th, 2026 — 3:26 PM",
|
||||
userTime: "Monday, January 5th, 2026 - 3:26 PM",
|
||||
userTimeFormat: "12" as const,
|
||||
},
|
||||
},
|
||||
@@ -511,7 +511,7 @@ describe("buildAgentSystemPrompt", () => {
|
||||
params: {
|
||||
workspaceDir: "/tmp/openclaw",
|
||||
userTimezone: "America/Chicago",
|
||||
userTime: "Monday, January 5th, 2026 — 15:26",
|
||||
userTime: "Monday, January 5th, 2026 - 15:26",
|
||||
userTimeFormat: "24" as const,
|
||||
},
|
||||
},
|
||||
@@ -549,7 +549,7 @@ describe("buildAgentSystemPrompt", () => {
|
||||
const prompt = buildAgentSystemPrompt({
|
||||
workspaceDir: "/tmp/clawd",
|
||||
userTimezone: "America/Chicago",
|
||||
userTime: "Monday, January 5th, 2026 — 3:26 PM",
|
||||
userTime: "Monday, January 5th, 2026 - 3:26 PM",
|
||||
userTimeFormat: "12",
|
||||
});
|
||||
|
||||
|
||||
@@ -43,22 +43,22 @@ export const canPersistInternalVerboseDirective = canPersistInternalDirective;
|
||||
|
||||
export const formatElevatedEvent = (level: ElevatedLevel) => {
|
||||
if (level === "full") {
|
||||
return "Elevated FULL — exec runs on host with auto-approval.";
|
||||
return "Elevated FULL - exec runs on host with auto-approval.";
|
||||
}
|
||||
if (level === "ask" || level === "on") {
|
||||
return "Elevated ASK — exec runs on host; approvals may still apply.";
|
||||
return "Elevated ASK - exec runs on host; approvals may still apply.";
|
||||
}
|
||||
return "Elevated OFF — exec stays in sandbox.";
|
||||
return "Elevated OFF - exec stays in sandbox.";
|
||||
};
|
||||
|
||||
export const formatReasoningEvent = (level: ReasoningLevel) => {
|
||||
if (level === "stream") {
|
||||
return "Reasoning STREAM — emit live <think>.";
|
||||
return "Reasoning STREAM - emit live <think>.";
|
||||
}
|
||||
if (level === "on") {
|
||||
return "Reasoning ON — include <think>.";
|
||||
return "Reasoning ON - include <think>.";
|
||||
}
|
||||
return "Reasoning OFF — hide <think>.";
|
||||
return "Reasoning OFF - hide <think>.";
|
||||
};
|
||||
|
||||
export function enqueueModeSwitchEvents(params: {
|
||||
|
||||
@@ -365,7 +365,7 @@ export async function runPreparedReply(
|
||||
const skillsSnapshot = skillResult.skillsSnapshot;
|
||||
const mediaNote = buildInboundMediaNote(ctx);
|
||||
const mediaReplyHint = mediaNote
|
||||
? "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."
|
||||
? "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."
|
||||
: undefined;
|
||||
let { prefixedCommandBody, queuedBody } = await rebuildPromptBodies();
|
||||
if (!resolvedThinkLevel) {
|
||||
|
||||
@@ -114,7 +114,7 @@ export function buildGroupChatContext(params: { sessionCtx: TemplateContext }):
|
||||
lines.push(`Participants: ${members}.`);
|
||||
}
|
||||
lines.push(
|
||||
"Your replies are automatically sent to this group chat. Do not use the message tool to send to this same group — just reply normally.",
|
||||
"Your replies are automatically sent to this group chat. Do not use the message tool to send to this same group - just reply normally.",
|
||||
);
|
||||
return lines.join(" ");
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ Never modify memory/YYYY-MM-DD.md destructively.
|
||||
expect(result).toContain("memory/2026-03-03.md");
|
||||
expect(result).not.toContain("memory/YYYY-MM-DD.md");
|
||||
expect(result).toContain(
|
||||
"Current time: Tuesday, March 3rd, 2026 — 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
|
||||
"Current time: Tuesday, March 3rd, 2026 - 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ export async function readPostCompactionContext(
|
||||
// would be misleading for deployments that use different section names.
|
||||
const prose = isDefaultSections
|
||||
? "Session was just compacted. The conversation summary above is a hint, NOT a substitute for your startup sequence. " +
|
||||
"Run your Session Startup sequence — read the required files before responding to the user."
|
||||
"Run your Session Startup sequence - read the required files before responding to the user."
|
||||
: `Session was just compacted. The conversation summary above is a hint, NOT a substitute for your full startup sequence. ` +
|
||||
`Re-read the sections injected below (${displayNames.join(", ")}) and follow your configured startup procedure before responding to the user.`;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ describe("buildBareSessionResetPrompt", () => {
|
||||
const nowMs = Date.UTC(2026, 2, 3, 14, 0, 0);
|
||||
const prompt = buildBareSessionResetPrompt(cfg, nowMs);
|
||||
expect(prompt).toContain(
|
||||
"Current time: Tuesday, March 3rd, 2026 — 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
|
||||
"Current time: Tuesday, March 3rd, 2026 - 9:00 AM (America/New_York) / 2026-03-03 14:00 UTC",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user