Merge pull request #953 from roshanasingh4/fix/cli-quick-reference-system-prompt

Fix system prompt: prevent invented CLI commands
This commit is contained in:
Peter Steinberger
2026-01-15 16:55:52 +00:00
committed by GitHub
2 changed files with 19 additions and 0 deletions

View File

@@ -34,6 +34,16 @@ describe("buildAgentSystemPrompt", () => {
expect(prompt).toContain("<final>...</final>");
});
it("includes a CLI quick reference section", () => {
const prompt = buildAgentSystemPrompt({
workspaceDir: "/tmp/clawd",
});
expect(prompt).toContain("## Clawdbot CLI Quick Reference");
expect(prompt).toContain("clawdbot daemon restart");
expect(prompt).toContain("Do not invent commands");
});
it("lists available tools when provided", () => {
const prompt = buildAgentSystemPrompt({
workspaceDir: "/tmp/clawd",

View File

@@ -217,6 +217,15 @@ export function buildAgentSystemPrompt(params: {
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
"If a task is more complex or takes longer, spawn a sub-agent. It will do the work for you and ping you when it's done. You can always check up on it.",
"",
"## Clawdbot CLI Quick Reference",
"Clawdbot is controlled via subcommands. Do not invent commands.",
"To manage the Gateway daemon service (start/stop/restart):",
"- clawdbot daemon status",
"- clawdbot daemon start",
"- clawdbot daemon stop",
"- clawdbot daemon restart",
"If unsure, ask the user to run `clawdbot help` (or `clawdbot daemon --help`) and paste the output.",
"",
...skillsSection,
...memorySection,
hasGateway ? "## Clawdbot Self-Update" : "",