fix: remove config.schema from agent gateway tool (#7382)

Merged via squash.

Prepared head SHA: f34a778069
Co-authored-by: kakuteki <61647657+kakuteki@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Hinata Kaga (samon)
2026-03-06 13:53:08 +09:00
committed by GitHub
parent 4d9134fe9c
commit 8c85ad540a
5 changed files with 7 additions and 9 deletions

View File

@@ -444,7 +444,9 @@ describe("buildAgentSystemPrompt", () => {
expect(prompt).toContain("## OpenClaw Self-Update");
expect(prompt).toContain("config.apply");
expect(prompt).toContain("config.patch");
expect(prompt).toContain("update.run");
expect(prompt).not.toContain("config.schema");
});
it("includes skills guidance when skills prompt is present", () => {

View File

@@ -482,8 +482,7 @@ export function buildAgentSystemPrompt(params: {
? [
"Get Updates (self-update) is ONLY allowed when the user explicitly asks for it.",
"Do not run config.apply or update.run unless the user explicitly requests an update or config change; if it's not explicit, ask first.",
"Use config.schema to fetch the current JSON Schema (includes plugins/channels) before making config changes or answering config-field questions; avoid guessing field names/types.",
"Actions: config.get, config.schema, config.apply (validate + write full config, then restart), update.run (update deps or git, then restart).",
"Actions: config.get, config.apply (validate + write full config, then restart), config.patch (partial update, merges with existing), update.run (update deps or git, then restart).",
"After restart, OpenClaw pings the last active session automatically.",
].join("\n")
: "",

View File

@@ -34,7 +34,6 @@ function resolveBaseHashFromSnapshot(snapshot: unknown): string | undefined {
const GATEWAY_ACTIONS = [
"restart",
"config.get",
"config.schema",
"config.apply",
"config.patch",
"update.run",
@@ -48,7 +47,7 @@ const GatewayToolSchema = Type.Object({
// restart
delayMs: Type.Optional(Type.Number()),
reason: Type.Optional(Type.String()),
// config.get, config.schema, config.apply, update.run
// config.get, config.apply, update.run
gatewayUrl: Type.Optional(Type.String()),
gatewayToken: Type.Optional(Type.String()),
timeoutMs: Type.Optional(Type.Number()),
@@ -172,10 +171,6 @@ export function createGatewayTool(opts?: {
const result = await callGatewayTool("config.get", gatewayOpts, {});
return jsonResult({ ok: true, result });
}
if (action === "config.schema") {
const result = await callGatewayTool("config.schema", gatewayOpts, {});
return jsonResult({ ok: true, result });
}
if (action === "config.apply") {
const { raw, baseHash, sessionKey, note, restartDelayMs } =
await resolveConfigWriteParams();