diff --git a/src/auto-reply/reply/commands.ts b/src/auto-reply/reply/commands.ts index d996f6569..7299a846d 100644 --- a/src/auto-reply/reply/commands.ts +++ b/src/auto-reply/reply/commands.ts @@ -19,6 +19,12 @@ import { waitForEmbeddedPiRunEnd, } from "../../agents/pi-embedded.js"; import type { ClawdbotConfig } from "../../config/config.js"; +import { + getConfigOverrides, + resetConfigOverrides, + setConfigOverride, + unsetConfigOverride, +} from "../../config/runtime-overrides.js"; import { resolveAgentIdFromSessionKey, resolveSessionFilePath, @@ -40,12 +46,6 @@ import { enqueueSystemEvent } from "../../infra/system-events.js"; import { parseAgentSessionKey } from "../../routing/session-key.js"; import { resolveSendPolicy } from "../../sessions/send-policy.js"; import { normalizeE164 } from "../../utils.js"; -import { - getConfigOverrides, - resetConfigOverrides, - setConfigOverride, - unsetConfigOverride, -} from "../../config/runtime-overrides.js"; import { resolveCommandAuthorization } from "../command-auth.js"; import { normalizeCommandBody, @@ -627,7 +627,10 @@ export async function handleCommands(params: { return { shouldContinue: false }; } if (debugCommand.action === "error") { - return { shouldContinue: false, reply: { text: `⚠️ ${debugCommand.message}` } }; + return { + shouldContinue: false, + reply: { text: `⚠️ ${debugCommand.message}` }, + }; } if (debugCommand.action === "show") { const overrides = getConfigOverrides(); @@ -641,7 +644,9 @@ export async function handleCommands(params: { const json = JSON.stringify(overrides, null, 2); return { shouldContinue: false, - reply: { text: `⚙️ Debug overrides (memory-only):\n\`\`\`json\n${json}\n\`\`\`` }, + reply: { + text: `⚙️ Debug overrides (memory-only):\n\`\`\`json\n${json}\n\`\`\``, + }, }; } if (debugCommand.action === "reset") { @@ -662,7 +667,9 @@ export async function handleCommands(params: { if (!result.removed) { return { shouldContinue: false, - reply: { text: `⚙️ No debug override found for ${debugCommand.path}.` }, + reply: { + text: `⚙️ No debug override found for ${debugCommand.path}.`, + }, }; } return { diff --git a/src/auto-reply/reply/debug-commands.ts b/src/auto-reply/reply/debug-commands.ts index cda091d47..e8104fae4 100644 --- a/src/auto-reply/reply/debug-commands.ts +++ b/src/auto-reply/reply/debug-commands.ts @@ -27,7 +27,7 @@ function parseDebugValue(raw: string): { value?: unknown; error?: string } { } if ( - (trimmed.startsWith("\"") && trimmed.endsWith("\"")) || + (trimmed.startsWith('"') && trimmed.endsWith('"')) || (trimmed.startsWith("'") && trimmed.endsWith("'")) ) { try { @@ -58,7 +58,8 @@ export function parseDebugCommand(raw: string): DebugCommand | null { case "reset": return { action: "reset" }; case "unset": { - if (!args) return { action: "error", message: "Usage: /debug unset path" }; + if (!args) + return { action: "error", message: "Usage: /debug unset path" }; return { action: "unset", path: args }; } case "set": { diff --git a/src/config/runtime-overrides.test.ts b/src/config/runtime-overrides.test.ts index 98a7703c6..d7630d865 100644 --- a/src/config/runtime-overrides.test.ts +++ b/src/config/runtime-overrides.test.ts @@ -1,6 +1,4 @@ -import { describe, expect, it, beforeEach } from "vitest"; - -import type { ClawdbotConfig } from "./types.js"; +import { beforeEach, describe, expect, it } from "vitest"; import { applyConfigOverrides, getConfigOverrides, @@ -8,6 +6,7 @@ import { setConfigOverride, unsetConfigOverride, } from "./runtime-overrides.js"; +import type { ClawdbotConfig } from "./types.js"; describe("runtime overrides", () => { beforeEach(() => { diff --git a/src/config/runtime-overrides.ts b/src/config/runtime-overrides.ts index a473f9949..98a3081a0 100644 --- a/src/config/runtime-overrides.ts +++ b/src/config/runtime-overrides.ts @@ -81,13 +81,19 @@ export function resetConfigOverrides(): void { overrides = {}; } -export function setConfigOverride(pathRaw: string, value: unknown): { +export function setConfigOverride( + pathRaw: string, + value: unknown, +): { ok: boolean; error?: string; } { const path = parsePath(pathRaw); if (!path) { - return { ok: false, error: "Invalid path. Use dot notation (e.g. foo.bar)." }; + return { + ok: false, + error: "Invalid path. Use dot notation (e.g. foo.bar).", + }; } setOverrideAtPath(overrides, path, value); return { ok: true };