docs: add gateway self-update prompt guidance
This commit is contained in:
@@ -71,4 +71,15 @@ describe("buildAgentSystemPromptAppend", () => {
|
|||||||
expect(prompt).toContain("Prefer aliases when specifying model overrides");
|
expect(prompt).toContain("Prefer aliases when specifying model overrides");
|
||||||
expect(prompt).toContain("- Opus: anthropic/claude-opus-4-5");
|
expect(prompt).toContain("- Opus: anthropic/claude-opus-4-5");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("adds gateway self-update guidance when gateway tool is available", () => {
|
||||||
|
const prompt = buildAgentSystemPromptAppend({
|
||||||
|
workspaceDir: "/tmp/clawd",
|
||||||
|
toolNames: ["gateway", "bash"],
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(prompt).toContain("## Gateway Self-Update");
|
||||||
|
expect(prompt).toContain("config.apply");
|
||||||
|
expect(prompt).toContain("update.run");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ export function buildAgentSystemPromptAppend(params: {
|
|||||||
canvas: "Present/eval/snapshot the Canvas",
|
canvas: "Present/eval/snapshot the Canvas",
|
||||||
nodes: "List/describe/notify/camera/screen on paired nodes",
|
nodes: "List/describe/notify/camera/screen on paired nodes",
|
||||||
cron: "Manage cron jobs and wake events",
|
cron: "Manage cron jobs and wake events",
|
||||||
gateway: "Restart the running Gateway process",
|
gateway:
|
||||||
|
"Restart, apply config, or run updates on the running Gateway process",
|
||||||
sessions_list: "List sessions with filters and last messages",
|
sessions_list: "List sessions with filters and last messages",
|
||||||
sessions_history: "Fetch message history for a session",
|
sessions_history: "Fetch message history for a session",
|
||||||
sessions_send: "Send a message into another session",
|
sessions_send: "Send a message into another session",
|
||||||
@@ -93,6 +94,7 @@ export function buildAgentSystemPromptAppend(params: {
|
|||||||
toolLines.push(`- ${tool}`);
|
toolLines.push(`- ${tool}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasGateway = availableTools.has("gateway");
|
||||||
const thinkHint =
|
const thinkHint =
|
||||||
params.defaultThinkLevel && params.defaultThinkLevel !== "off"
|
params.defaultThinkLevel && params.defaultThinkLevel !== "off"
|
||||||
? `Default thinking level: ${params.defaultThinkLevel}.`
|
? `Default thinking level: ${params.defaultThinkLevel}.`
|
||||||
@@ -161,6 +163,16 @@ export function buildAgentSystemPromptAppend(params: {
|
|||||||
].join("\n"),
|
].join("\n"),
|
||||||
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
|
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
|
||||||
"",
|
"",
|
||||||
|
hasGateway ? "## Gateway Self-Update" : "",
|
||||||
|
hasGateway
|
||||||
|
? [
|
||||||
|
"Use the gateway tool to update or reconfigure this instance when asked.",
|
||||||
|
"Actions: config.get, config.schema, config.apply (validate + write full config, then restart), update.run (update deps or git, then restart).",
|
||||||
|
"After restart, Clawdbot pings the last active session automatically.",
|
||||||
|
].join("\n")
|
||||||
|
: "",
|
||||||
|
hasGateway ? "" : "",
|
||||||
|
"",
|
||||||
params.modelAliasLines && params.modelAliasLines.length > 0
|
params.modelAliasLines && params.modelAliasLines.length > 0
|
||||||
? "## Model Aliases"
|
? "## Model Aliases"
|
||||||
: "",
|
: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user