From adb3bc2577ace355899f38a7fe729eea8bc0a282 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 9 Jan 2026 15:11:32 +0100 Subject: [PATCH] fix: reset dev gateway setup --- CHANGELOG.md | 3 ++- docs/cli/gateway.md | 2 +- docs/cli/index.md | 2 +- src/cli/gateway-cli.ts | 20 ++++++++++++-------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f38f6e1a3..c6df7cd0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Commands: accept /models as an alias for /model. - Models/Auth: show per-agent auth candidates in `/model status`, and add `clawdbot models auth order {get,set,clear}` (per-agent auth rotation overrides). — thanks @steipete - Debugging: add raw model stream logging flags and document gateway watch mode. +- Gateway: decode dns-sd escaped UTF-8 in discovery output and show scan progress immediately. — thanks @steipete - Agent: add claude-cli/opus-4.5 runner via Claude CLI with resume support (tools disabled). - CLI: move `clawdbot message` to subcommands (`message send|poll|…`), fold Discord/Slack/Telegram/WhatsApp tools into `message`, and require `--provider` unless only one provider is configured. - CLI: improve `logs` output (pretty/plain/JSONL), add gateway unreachable hint, and document logging. @@ -93,7 +94,7 @@ - Gateway/Discovery: include `gatewayPort`/`sshPort`/`cliPath` in wide-area Bonjour records, and add a tailnet DNS fallback for `gateway discover` when split DNS isn’t configured. — thanks @steipete - CLI: add global `--no-color` (and respect `NO_COLOR=1`) to disable ANSI output. — thanks @steipete - CLI: centralize lobster palette + apply it to onboarding/config prompts. — thanks @steipete -- Gateway/CLI: add `clawdbot gateway --dev/--reset` to auto-create a dev config/workspace with a robot identity (no BOOTSTRAP.md). — thanks @steipete +- Gateway/CLI: add `clawdbot gateway --dev/--reset` to auto-create a dev config/workspace with a robot identity (no BOOTSTRAP.md), and reset wipes config/creds/sessions/workspace. — thanks @steipete - Config: fix Minimax hosted onboarding to write `agents.defaults` and allow `msteams` as a heartbeat target. — thanks @steipete ## 2026.1.8 diff --git a/docs/cli/gateway.md b/docs/cli/gateway.md index cbe3e2e13..094a39ce0 100644 --- a/docs/cli/gateway.md +++ b/docs/cli/gateway.md @@ -40,7 +40,7 @@ Notes: - `--tailscale `: expose the Gateway via Tailscale. - `--tailscale-reset-on-exit`: reset Tailscale serve/funnel config on shutdown. - `--dev`: create a dev config + workspace if missing (skips BOOTSTRAP.md). -- `--reset`: recreate the dev config (requires `--dev`). +- `--reset`: reset dev config + credentials + sessions + workspace (requires `--dev`). - `--force`: kill any existing listener on the selected port before starting. - `--verbose`: verbose logs. - `--claude-cli-logs`: only show claude-cli logs in the console (and enable its stdout/stderr). diff --git a/docs/cli/index.md b/docs/cli/index.md index 9734a0951..9dff50831 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -411,7 +411,7 @@ Options: - `--tailscale-reset-on-exit` - `--allow-unconfigured` - `--dev` -- `--reset` +- `--reset` (reset dev config + credentials + sessions + workspace) - `--force` (kill existing listener on port) - `--verbose` - `--ws-log ` diff --git a/src/cli/gateway-cli.ts b/src/cli/gateway-cli.ts index 3888b5ff1..a47303e74 100644 --- a/src/cli/gateway-cli.ts +++ b/src/cli/gateway-cli.ts @@ -5,7 +5,7 @@ import path from "node:path"; import type { Command } from "commander"; import { resolveDefaultAgentWorkspaceDir } from "../agents/workspace.js"; import { gatewayStatusCommand } from "../commands/gateway-status.js"; -import { moveToTrash } from "../commands/onboard-helpers.js"; +import { handleReset } from "../commands/onboard-helpers.js"; import { CONFIG_PATH_CLAWDBOT, type GatewayAuthMode, @@ -165,15 +165,14 @@ async function ensureDevWorkspace(dir: string) { } async function ensureDevGatewayConfig(opts: { reset?: boolean }) { - const configExists = fs.existsSync(CONFIG_PATH_CLAWDBOT); - if (opts.reset && configExists) { - await moveToTrash(CONFIG_PATH_CLAWDBOT, defaultRuntime); + const workspace = resolveDevWorkspaceDir(); + if (opts.reset) { + await handleReset("full", workspace, defaultRuntime); } - const shouldWrite = opts.reset || !configExists; - if (!shouldWrite) return; + const configExists = fs.existsSync(CONFIG_PATH_CLAWDBOT); + if (!opts.reset && configExists) return; - const workspace = resolveDevWorkspaceDir(); await writeConfigFile({ gateway: { mode: "local", @@ -814,7 +813,11 @@ function addGatewayRunCommand( "Create a dev config + workspace if missing (no BOOTSTRAP.md)", false, ) - .option("--reset", "Recreate dev config (requires --dev)", false) + .option( + "--reset", + "Reset dev config + credentials + sessions + workspace (requires --dev)", + false, + ) .option( "--force", "Kill any existing listener on the target port before starting", @@ -986,6 +989,7 @@ export function registerGatewayCli(program: Command) { label: "Scanning for gateways…", indeterminate: true, enabled: opts.json !== true, + delayMs: 0, }, async () => await discoverGatewayBeacons({ timeoutMs }), );