diff --git a/src/cli/cli-name.ts b/src/cli/cli-name.ts index 7b943f590..c3e5bea9b 100644 --- a/src/cli/cli-name.ts +++ b/src/cli/cli-name.ts @@ -1,10 +1,10 @@ import path from "node:path"; export const DEFAULT_CLI_NAME = "moltbot"; -export const LEGACY_CLI_NAME = "moltbot"; +export const LEGACY_CLI_NAME = "clawdbot"; const KNOWN_CLI_NAMES = new Set([DEFAULT_CLI_NAME, LEGACY_CLI_NAME]); -const CLI_PREFIX_RE = /^(?:((?:pnpm|npm|bunx|npx)\s+))?(moltbot|moltbot)\b/; +const CLI_PREFIX_RE = /^(?:((?:pnpm|npm|bunx|npx)\s+))?(moltbot|clawdbot)\b/; export function resolveCliName( argv: string[] = process.argv, diff --git a/src/cli/command-format.ts b/src/cli/command-format.ts index 156a5cd2f..cd93be3d7 100644 --- a/src/cli/command-format.ts +++ b/src/cli/command-format.ts @@ -1,7 +1,7 @@ import { normalizeProfileName } from "./profile-utils.js"; import { replaceCliName, resolveCliName } from "./cli-name.js"; -const CLI_PREFIX_RE = /^(?:pnpm|npm|bunx|npx)\s+(?:moltbot|moltbot)\b|^(?:moltbot|moltbot)\b/; +const CLI_PREFIX_RE = /^(?:pnpm|npm|bunx|npx)\s+(?:moltbot|clawdbot)\b|^(?:moltbot|clawdbot)\b/; const PROFILE_FLAG_RE = /(?:^|\s)--profile(?:\s|=|$)/; const DEV_FLAG_RE = /(?:^|\s)--dev(?:\s|$)/; diff --git a/src/infra/update-check.ts b/src/infra/update-check.ts index 8e10d412b..24c5c374d 100644 --- a/src/infra/update-check.ts +++ b/src/infra/update-check.ts @@ -129,10 +129,9 @@ export async function checkGitUpdateStatus(params: { ).catch(() => null); const upstream = upstreamRes && upstreamRes.code === 0 ? upstreamRes.stdout.trim() : null; - const dirtyRes = await runCommandWithTimeout( - ["git", "-C", root, "status", "--porcelain", "--", ":!dist/control-ui/"], - { timeoutMs }, - ).catch(() => null); + const dirtyRes = await runCommandWithTimeout(["git", "-C", root, "status", "--porcelain"], { + timeoutMs, + }).catch(() => null); const dirty = dirtyRes && dirtyRes.code === 0 ? dirtyRes.stdout.trim().length > 0 : null; const fetchOk = params.fetch diff --git a/src/infra/update-runner.ts b/src/infra/update-runner.ts index 0735edb39..2e8ef5e0e 100644 --- a/src/infra/update-runner.ts +++ b/src/infra/update-runner.ts @@ -676,17 +676,6 @@ export async function runGatewayUpdate(opts: UpdateRunnerOptions = {}): Promise< ); steps.push(uiBuildStep); - // Restore dist/control-ui/ to committed state to prevent dirty repo after update - // (ui:build regenerates assets with new hashes, which would block future updates) - const restoreUiStep = await runStep( - step( - "restore control-ui", - ["git", "-C", gitRoot, "checkout", "--", "dist/control-ui/"], - gitRoot, - ), - ); - steps.push(restoreUiStep); - const doctorStep = await runStep( step( "moltbot doctor", diff --git a/src/telegram/monitor.ts b/src/telegram/monitor.ts index c3b3a5a2f..f828ca1ca 100644 --- a/src/telegram/monitor.ts +++ b/src/telegram/monitor.ts @@ -78,6 +78,7 @@ const NETWORK_ERROR_SNIPPETS = [ "fetch failed", "network", "timeout", + "timed out", "socket", "econnreset", "econnrefused", diff --git a/src/telegram/network-errors.test.ts b/src/telegram/network-errors.test.ts index db582355f..d83338609 100644 --- a/src/telegram/network-errors.test.ts +++ b/src/telegram/network-errors.test.ts @@ -31,6 +31,11 @@ describe("isRecoverableTelegramNetworkError", () => { expect(isRecoverableTelegramNetworkError(new Error("Undici: socket failure"))).toBe(true); }); + it("detects grammY getUpdates timeout format", () => { + const err = new Error("Request to 'getUpdates' timed out after 500 seconds"); + expect(isRecoverableTelegramNetworkError(err)).toBe(true); + }); + it("skips message matches for send context", () => { const err = new TypeError("fetch failed"); expect(isRecoverableTelegramNetworkError(err, { context: "send" })).toBe(false); diff --git a/src/telegram/network-errors.ts b/src/telegram/network-errors.ts index bb3432432..11bda6aa6 100644 --- a/src/telegram/network-errors.ts +++ b/src/telegram/network-errors.ts @@ -36,6 +36,7 @@ const RECOVERABLE_MESSAGE_SNIPPETS = [ "client network socket disconnected", "socket hang up", "getaddrinfo", + "timed out", ]; function normalizeCode(code?: string): string {