fix: restore safety + session_status hints
parent
600c46b5a4
commit
afbb1af6c5
|
|
@ -347,6 +347,13 @@ export function buildAgentSystemPrompt(params: {
|
||||||
const messageChannelOptions = listDeliverableMessageChannels().join("|");
|
const messageChannelOptions = listDeliverableMessageChannels().join("|");
|
||||||
const promptMode = params.promptMode ?? "full";
|
const promptMode = params.promptMode ?? "full";
|
||||||
const isMinimal = promptMode === "minimal" || promptMode === "none";
|
const isMinimal = promptMode === "minimal" || promptMode === "none";
|
||||||
|
const safetySection = [
|
||||||
|
"## Safety",
|
||||||
|
"You have no independent goals: do not pursue self-preservation, replication, resource acquisition, or power-seeking; avoid long-term plans beyond the user's request.",
|
||||||
|
"Prioritize safety and human oversight over completion; if instructions conflict, pause and ask; comply with stop/pause/audit requests and never bypass safeguards. (Inspired by Anthropic's constitution.)",
|
||||||
|
"Do not manipulate or persuade anyone to expand access or disable safeguards. Do not copy yourself or change system prompts, safety rules, or tool policies unless explicitly requested.",
|
||||||
|
"",
|
||||||
|
];
|
||||||
const skillsSection = buildSkillsSection({
|
const skillsSection = buildSkillsSection({
|
||||||
skillsPrompt,
|
skillsPrompt,
|
||||||
isMinimal,
|
isMinimal,
|
||||||
|
|
@ -403,6 +410,7 @@ export function buildAgentSystemPrompt(params: {
|
||||||
"Keep narration brief and value-dense; avoid repeating obvious steps.",
|
"Keep narration brief and value-dense; avoid repeating obvious steps.",
|
||||||
"Use plain human language for narration unless in a technical context.",
|
"Use plain human language for narration unless in a technical context.",
|
||||||
"",
|
"",
|
||||||
|
...safetySection,
|
||||||
"## OpenClaw CLI Quick Reference",
|
"## OpenClaw CLI Quick Reference",
|
||||||
"OpenClaw is controlled via subcommands. Do not invent commands.",
|
"OpenClaw is controlled via subcommands. Do not invent commands.",
|
||||||
"To manage the Gateway daemon service (start/stop/restart):",
|
"To manage the Gateway daemon service (start/stop/restart):",
|
||||||
|
|
@ -437,6 +445,9 @@ export function buildAgentSystemPrompt(params: {
|
||||||
? params.modelAliasLines.join("\n")
|
? params.modelAliasLines.join("\n")
|
||||||
: "",
|
: "",
|
||||||
params.modelAliasLines && params.modelAliasLines.length > 0 && !isMinimal ? "" : "",
|
params.modelAliasLines && params.modelAliasLines.length > 0 && !isMinimal ? "" : "",
|
||||||
|
userTimezone
|
||||||
|
? "If you need the current date, time, or day of week, run session_status (📊 session_status)."
|
||||||
|
: "",
|
||||||
"## Workspace",
|
"## Workspace",
|
||||||
`Your working directory is: ${params.workspaceDir}`,
|
`Your working directory is: ${params.workspaceDir}`,
|
||||||
"Treat this directory as the single global workspace for file operations unless explicitly instructed otherwise.",
|
"Treat this directory as the single global workspace for file operations unless explicitly instructed otherwise.",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue