From 1b79730db85e1668bba0ec554f2485761b574161 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 15 Jan 2026 01:53:14 +0000 Subject: [PATCH] style: apply oxfmt fixes --- .../pi-embedded-helpers.formatassistanterrortext.test.ts | 4 +++- src/agents/pi-embedded-runner/run/payloads.test.ts | 2 +- src/agents/pi-embedded-runner/run/payloads.ts | 4 +++- src/auto-reply/reply/commands-config-writes.test.ts | 2 +- src/channels/plugins/config-writes.test.ts | 8 ++------ src/channels/plugins/config-writes.ts | 5 +---- src/cli/security-cli.ts | 1 - src/commands/status-all.ts | 4 ++-- src/security/audit.ts | 6 +++++- src/telegram/bot-handlers.ts | 4 +--- src/wizard/onboarding.ts | 3 +-- 11 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts b/src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts index f2edda1f6..5c874aff8 100644 --- a/src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts +++ b/src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts @@ -37,6 +37,8 @@ describe("formatAssistantErrorText", () => { const msg = makeAssistantError( '{"type":"error","error":{"message":"Something exploded","type":"server_error"}}', ); - expect(formatAssistantErrorText(msg)).toBe("The AI service returned an error. Please try again."); + expect(formatAssistantErrorText(msg)).toBe( + "The AI service returned an error. Please try again.", + ); }); }); diff --git a/src/agents/pi-embedded-runner/run/payloads.test.ts b/src/agents/pi-embedded-runner/run/payloads.test.ts index 5b9e406f9..934620c6c 100644 --- a/src/agents/pi-embedded-runner/run/payloads.test.ts +++ b/src/agents/pi-embedded-runner/run/payloads.test.ts @@ -4,7 +4,7 @@ import { buildEmbeddedRunPayloads } from "./payloads.js"; describe("buildEmbeddedRunPayloads", () => { const errorJson = - '{"type":"error","error":{"details":null,"type":"overloaded_error","message":"Overloaded"},"request_id":"req_011CX7DwS7tSvggaNHmefwWg"}'; + '{"type":"error","error":{"details":null,"type":"overloaded_error","message":"Overloaded"},"request_id":"req_011CX7DwS7tSvggaNHmefwWg"}'; const errorJsonPretty = `{ "type": "error", "error": { diff --git a/src/agents/pi-embedded-runner/run/payloads.ts b/src/agents/pi-embedded-runner/run/payloads.ts index 9b0b8e9d2..1ca91f594 100644 --- a/src/agents/pi-embedded-runner/run/payloads.ts +++ b/src/agents/pi-embedded-runner/run/payloads.ts @@ -60,7 +60,9 @@ export function buildEmbeddedRunPayloads(params: { const rawErrorFingerprint = rawErrorMessage ? getApiErrorPayloadFingerprint(rawErrorMessage) : null; - const normalizedRawErrorText = rawErrorMessage ? normalizeTextForComparison(rawErrorMessage) : null; + const normalizedRawErrorText = rawErrorMessage + ? normalizeTextForComparison(rawErrorMessage) + : null; if (errorText) replyItems.push({ text: errorText, isError: true }); const inlineToolResults = diff --git a/src/auto-reply/reply/commands-config-writes.test.ts b/src/auto-reply/reply/commands-config-writes.test.ts index 5a9568408..7c55c3a01 100644 --- a/src/auto-reply/reply/commands-config-writes.test.ts +++ b/src/auto-reply/reply/commands-config-writes.test.ts @@ -49,7 +49,7 @@ describe("handleCommands /config configWrites gating", () => { commands: { config: true, text: true }, channels: { whatsapp: { allowFrom: ["*"], configWrites: false } }, } as ClawdbotConfig; - const params = buildParams("/config set messages.ackReaction=\":)\"", cfg); + const params = buildParams('/config set messages.ackReaction=":)"', cfg); const result = await handleCommands(params); expect(result.shouldContinue).toBe(false); expect(result.reply?.text).toContain("Config writes are disabled"); diff --git a/src/channels/plugins/config-writes.test.ts b/src/channels/plugins/config-writes.test.ts index f69acf0a4..107f42221 100644 --- a/src/channels/plugins/config-writes.test.ts +++ b/src/channels/plugins/config-writes.test.ts @@ -24,9 +24,7 @@ describe("resolveChannelConfigWrites", () => { }, }, }; - expect( - resolveChannelConfigWrites({ cfg, channelId: "slack", accountId: "work" }), - ).toBe(false); + expect(resolveChannelConfigWrites({ cfg, channelId: "slack", accountId: "work" })).toBe(false); }); it("matches account ids case-insensitively", () => { @@ -40,8 +38,6 @@ describe("resolveChannelConfigWrites", () => { }, }, }; - expect( - resolveChannelConfigWrites({ cfg, channelId: "slack", accountId: "work" }), - ).toBe(false); + expect(resolveChannelConfigWrites({ cfg, channelId: "slack", accountId: "work" })).toBe(false); }); }); diff --git a/src/channels/plugins/config-writes.ts b/src/channels/plugins/config-writes.ts index 98d351c12..5c547475c 100644 --- a/src/channels/plugins/config-writes.ts +++ b/src/channels/plugins/config-writes.ts @@ -7,10 +7,7 @@ type ChannelConfigWithAccounts = { accounts?: Record; }; -function resolveAccountConfig( - accounts: ChannelConfigWithAccounts["accounts"], - accountId: string, -) { +function resolveAccountConfig(accounts: ChannelConfigWithAccounts["accounts"], accountId: string) { if (!accounts || typeof accounts !== "object") return undefined; if (accountId in accounts) return accounts[accountId]; const matchKey = Object.keys(accounts).find( diff --git a/src/cli/security-cli.ts b/src/cli/security-cli.ts index e1a167e7c..e8f686b3d 100644 --- a/src/cli/security-cli.ts +++ b/src/cli/security-cli.ts @@ -88,4 +88,3 @@ export function registerSecurityCli(program: Command) { defaultRuntime.log(lines.join("\n")); }); } - diff --git a/src/commands/status-all.ts b/src/commands/status-all.ts index 55e941059..4c9a4667b 100644 --- a/src/commands/status-all.ts +++ b/src/commands/status-all.ts @@ -340,8 +340,8 @@ export async function statusAllCommand( }, { Item: "Security", Value: "Run: clawdbot security audit --deep" }, gatewaySelfLine - ? { Item: "Gateway self", Value: gatewaySelfLine } - : { Item: "Gateway self", Value: "unknown" }, + ? { Item: "Gateway self", Value: gatewaySelfLine } + : { Item: "Gateway self", Value: "unknown" }, daemon ? { Item: "Daemon", diff --git a/src/security/audit.ts b/src/security/audit.ts index f421b11a5..589b4e113 100644 --- a/src/security/audit.ts +++ b/src/security/audit.ts @@ -77,7 +77,11 @@ function normalizeAllowFromList(list: Array | undefined | null) function classifyChannelWarningSeverity(message: string): SecurityAuditSeverity { const s = message.toLowerCase(); - if (s.includes('dms: open') || s.includes('grouppolicy="open"') || s.includes('dmpolicy="open"')) { + if ( + s.includes("dms: open") || + s.includes('grouppolicy="open"') || + s.includes('dmpolicy="open"') + ) { return "critical"; } if (s.includes("allows any") || s.includes("anyone can dm") || s.includes("public")) { diff --git a/src/telegram/bot-handlers.ts b/src/telegram/bot-handlers.ts index 4603dda25..79927220e 100644 --- a/src/telegram/bot-handlers.ts +++ b/src/telegram/bot-handlers.ts @@ -95,9 +95,7 @@ export const registerTelegramHandlers = ({ runtime.log?.(warn(`[telegram] Group migrated: "${chatTitle}" ${oldChatId} → ${newChatId}`)); if (!resolveChannelConfigWrites({ cfg, channelId: "telegram", accountId })) { - runtime.log?.( - warn("[telegram] Config writes disabled; skipping group config migration."), - ); + runtime.log?.(warn("[telegram] Config writes disabled; skipping group config migration.")); return; } diff --git a/src/wizard/onboarding.ts b/src/wizard/onboarding.ts index 0a01bbc6b..64ee88804 100644 --- a/src/wizard/onboarding.ts +++ b/src/wizard/onboarding.ts @@ -60,8 +60,7 @@ async function requireRiskAcknowledgement(params: { ); const ok = await params.prompter.confirm({ - message: - "I understand this is powerful and inherently risky. Continue?", + message: "I understand this is powerful and inherently risky. Continue?", initialValue: false, }); if (!ok) {