Skip to content

Commit 1eb50ff

Browse files
committed
feat(status): improve status output
1 parent 67b7877 commit 1eb50ff

25 files changed

Lines changed: 2382 additions & 40 deletions

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
- Vocabulary: "makeup" = "mac app".
7070
- When answering questions, respond with high-confidence answers only: verify in code; do not guess.
7171
- Never update the Carbon dependency.
72+
- CLI progress: use `src/cli/progress.ts` (`osc-progress` + `@clack/prompts` spinner); don’t hand-roll spinners/bars.
7273
- Gateway currently runs only as the menubar app; there is no separate LaunchAgent/helper label installed. Restart via the Clawdbot Mac app or `scripts/restart-mac.sh`; to verify/kill use `launchctl print gui/$UID | grep clawdbot` rather than assuming a fixed label. **When debugging on macOS, start/stop the gateway via the app, not ad-hoc tmux sessions; kill any temporary tunnels before handoff.**
7374
- macOS logs: use `./scripts/clawlog.sh` (aka `vtlog`) to query unified logs for the Clawdbot subsystem; it supports follow/tail/category filters and expects passwordless sudo for `/usr/bin/log`.
7475
- If shared guardrails are available locally, review them; otherwise follow this repo's guidance.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Agents/OpenCode Zen: update fallback models + defaults, keep legacy alias mappings. (#669) — thanks @magimetal.
1010
- Providers: unify group history context wrappers across providers with per-provider/per-account `historyLimit` overrides (fallback to `messages.groupChat.historyLimit`). Set `0` to disable. (#672) — thanks @steipete.
1111
- CLI: add `clawdbot update` (safe-ish git checkout update) + `--update` shorthand. (#673) — thanks @fm1randa.
12+
- CLI: improve `clawdbot status` (OS/update/gateway/daemon/agents/sessions) + add `status --all` for full read-only diagnosis with tables, log tails, and scan progress (OSC-9 + spinner).
1213
- Gateway: add OpenAI-compatible `/v1/chat/completions` HTTP endpoint (auth, SSE streaming, per-agent routing). (#680) — thanks @steipete.
1314
- Gateway/Heartbeat: optionally deliver heartbeat `Reasoning:` output (`agents.defaults.heartbeat.includeReasoning`). (#690)
1415
- Docker: allow optional home volume + extra bind mounts in `docker-setup.sh`. (#679) — thanks @gabriel-trigo.

docs/gateway/health.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ read_when:
88
Short guide to verify the WhatsApp Web / Baileys stack without guessing.
99

1010
## Quick checks
11-
- `clawdbot status` — local summary: whether creds exist, auth age, session store path + recent sessions.
11+
- `clawdbot status` — local summary: gateway reachability/mode, update hint, creds/auth age, sessions + recent activity.
12+
- `clawdbot status --all` — full local diagnosis (read-only, color, safe to paste for debugging).
1213
- `clawdbot status --deep` — also probes the running Gateway (WhatsApp connect + Telegram + Discord APIs).
1314
- `clawdbot health --json` — asks the running Gateway for a full health snapshot (WS-only; no direct Baileys socket).
1415
- Send `/status` as a standalone message in WhatsApp/WebChat to get a status reply without invoking the agent.

docs/start/clawd.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ Clawdbot extracts these and sends them as media alongside the text.
206206

207207
```bash
208208
clawdbot status # local status (creds, sessions, queued events)
209+
clawdbot status --all # full diagnosis (read-only, pasteable)
209210
clawdbot status --deep # also probes the running Gateway (WA connect + Telegram)
210211
clawdbot health --json # gateway health snapshot (WS)
211212
```

src/auto-reply/reply.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ export async function getReplyFromConfig(
589589
(agentCfg?.elevatedDefault as ElevatedLevel | undefined) ??
590590
"on")
591591
: "off";
592-
const _providerKey = sessionCtx.Provider?.trim().toLowerCase();
593592
const resolvedBlockStreaming =
594593
opts?.disableBlockStreaming === true
595594
? "off"

src/cli/program.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,8 +1148,9 @@ ${theme.muted("Docs:")} ${formatDocsLink(
11481148

11491149
program
11501150
.command("status")
1151-
.description("Show web session health and recent session recipients")
1151+
.description("Show local status (gateway, agents, sessions, auth)")
11521152
.option("--json", "Output JSON instead of text", false)
1153+
.option("--all", "Full diagnosis (read-only, pasteable)", false)
11531154
.option("--usage", "Show provider usage/quota snapshots", false)
11541155
.option(
11551156
"--deep",
@@ -1164,6 +1165,7 @@ ${theme.muted("Docs:")} ${formatDocsLink(
11641165
`
11651166
Examples:
11661167
clawdbot status # show linked account + session store summary
1168+
clawdbot status --all # full diagnosis (read-only)
11671169
clawdbot status --json # machine-readable output
11681170
clawdbot status --usage # show provider usage/quota snapshots
11691171
clawdbot status --deep # run provider probes (WA + Telegram + Discord + Slack + Signal)
@@ -1187,6 +1189,7 @@ Examples:
11871189
await statusCommand(
11881190
{
11891191
json: Boolean(opts.json),
1192+
all: Boolean(opts.all),
11901193
deep: Boolean(opts.deep),
11911194
usage: Boolean(opts.usage),
11921195
timeoutMs: timeout,

src/cli/progress.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { spinner } from "@clack/prompts";
22
import { createOscProgressController, supportsOscProgress } from "osc-progress";
3-
43
import { theme } from "../terminal/theme.js";
54

65
const DEFAULT_DELAY_MS = 300;
@@ -47,8 +46,7 @@ export function createCliProgress(options: ProgressOptions): ProgressReporter {
4746
typeof options.delayMs === "number" ? options.delayMs : DEFAULT_DELAY_MS;
4847
const canOsc = supportsOscProgress(process.env, stream.isTTY);
4948
const allowSpinner =
50-
!canOsc &&
51-
(options.fallback === undefined || options.fallback === "spinner");
49+
options.fallback === undefined || options.fallback === "spinner";
5250

5351
let started = false;
5452
let label = options.label;
@@ -77,7 +75,8 @@ export function createCliProgress(options: ProgressOptions): ProgressReporter {
7775
if (controller) {
7876
if (indeterminate) controller.setIndeterminate(label);
7977
else controller.setPercent(label, percent);
80-
} else if (spin) {
78+
}
79+
if (spin) {
8180
spin.message(theme.accent(label));
8281
}
8382
};

src/commands/docs.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { isRich, theme } from "../terminal/theme.js";
66

77
const SEARCH_TOOL = "https://docs.clawd.bot/mcp.SearchClawdbot";
88
const SEARCH_TIMEOUT_MS = 30_000;
9-
const RENDER_TIMEOUT_MS = 10_000;
109
const DEFAULT_SNIPPET_MAX = 220;
1110

1211
type DocResult = {
@@ -154,20 +153,6 @@ function renderRichResults(
154153
}
155154

156155
async function renderMarkdown(markdown: string, runtime: RuntimeEnv) {
157-
const width = process.stdout.columns ?? 0;
158-
const args = width > 0 ? ["--width", String(width)] : [];
159-
try {
160-
const res = await runTool("markdansi", args, {
161-
timeoutMs: RENDER_TIMEOUT_MS,
162-
input: markdown,
163-
});
164-
if (res.code === 0 && res.stdout.trim()) {
165-
runtime.log(res.stdout.trimEnd());
166-
return;
167-
}
168-
} catch {
169-
// Fall back to plain Markdown if renderer fails or cannot be installed.
170-
}
171156
runtime.log(markdown.trimEnd());
172157
}
173158

0 commit comments

Comments
 (0)