gateway-diagnose
Diagnose gateway failures by reading daemon logs, session transcripts, Redis state, and OTEL telemetry. Full Telegram path triage: daemon process → Redis channel → command queue → pi session → model API → Telegram delivery. Use when: 'gateway broken', 'telegram not working', 'why is gateway down', 'gateway not responding', 'check gateway logs', 'what happened to gateway', 'gateway diagnose', 'gateway errors', 'review gateway logs', 'fallback activated', 'gateway stuck', or any request to understand why the gateway failed. Distinct from the gateway skill (operations) — this skill is diagnostic.
What this skill does
# Gateway Diagnosis Structured diagnostic workflow for the joelclaw gateway daemon. Runs top-down from process health to message delivery, stopping at the first failure layer. **Default time range: 1 hour.** Override by asking "check gateway logs for the last 4 hours" or similar. ## CLI Commands (use these first) ```bash # Automated health check — runs all layers, returns structured findings joelclaw gateway diagnose [--hours 1] [--lines 100] # Session context — what happened recently? Exchanges, tools, errors. joelclaw gateway review [--hours 1] [--max 20] ``` Start with `diagnose` to find the failure layer. It now reports disabled launchd state for `com.joel.gateway` explicitly (instead of a generic process failure), and distinguishes `redis_degraded` from a truly dead gateway. Use `review` to understand what the gateway was doing when it broke. Only drop to manual log reading (below) when the CLI output isn't enough. ## Autonomous Monitor (cross-channel) Gateway health is now checked automatically by Inngest function `check/gateway-health` on heartbeat fan-out event `gateway/health.check.requested`. What it monitors: - **General gateway failure**: critical `joelclaw gateway diagnose` layers (`process`, `cli-status`, `e2e-test`, `redis-state`) - **Specific channel degradation**: OTEL severe action counts for `telegram-channel`, `discord-channel`, `imessage-channel`, `slack-channel` What it does: - Tracks failure streaks in Redis to suppress one-off noise - Auto-restarts gateway on sustained general failure (cooldown-protected) - Sends immediate Telegram alert only on sustained unresolved failures - Emits OTEL with component `check-gateway-health`, action `gateway.health.checked` ## Artifact Locations | Artifact | Path | What's in it | |----------|------|-------------| | **Daemon stdout** | `/tmp/joelclaw/gateway.log` | Startup info, event flow, responses, fallback messages | | **Daemon stderr** | `/tmp/joelclaw/gateway.err` | Errors, stack traces, retries, fallback activations — **check this first** | | **PID file** | `/tmp/joelclaw/gateway.pid` | Current daemon process ID | | **Session ID** | `~/.joelclaw/gateway.session` | Current pi session ID | | **Session transcripts** | `~/.joelclaw/sessions/gateway/*.jsonl` | Full pi session history (most recent by mtime) | | **Gateway working dir** | `~/.joelclaw/gateway/` | Has `.pi/settings.json` for compaction config | | **Launchd plist** | `~/Library/LaunchAgents/com.joel.gateway.plist` | Service config, env vars, log paths | | **Start script** | `~/.joelclaw/scripts/gateway-start.sh` | Secret leasing, env setup, bun invocation | | **Tripwire** | `/tmp/joelclaw/last-heartbeat.ts` | Last heartbeat timestamp (updated every 15 min) | | **WS port** | `/tmp/joelclaw/gateway.ws.port` | WebSocket port for TUI attach (default 3018) | ## Diagnostic Procedure Run these steps in order. Stop and report at the first failure. ### Layer -1: Substrate health (Colima + k8s) ```bash colima status --json kubectl get nodes -o wide kubectl get pods -n joelclaw redis-0 inngest-0 ``` **Failure patterns:** - `colima is not running` or kubectl EOF/refused → gateway/Redis symptoms are secondary. Bring Colima back first. - Node not `Ready` or core pods not `Running` → fix cluster substrate before touching gateway. ### Layer 0: Process Health ```bash # Is launchd service disabled? launchctl print-disabled gui/$(id -u) | rg "com\\.joel\\.gateway" # Exact launchd service state (+ pid, last exit code) launchctl print gui/$(id -u)/com.joel.gateway # Is daemon process running outside launchd? ps aux | grep "/packages/gateway/src/daemon.ts" | grep -v grep # Optional PID file cross-check (missing PID file is non-fatal) cat /tmp/joelclaw/gateway.pid ``` **Failure patterns:** - `"com.joel.gateway" => disabled` → launchd service disabled (`joelclaw gateway enable` or `joelclaw gateway restart` to recover) - launchctl service missing + no daemon process → gateway down - launchd PID differs from PID file → stale PID file (degraded, not fatal) - daemon process alive but launchd service missing/disabled → manual run or launchd drift ### Layer 1: CLI Status ```bash joelclaw gateway status ``` **Check:** - `mode` — `normal` vs `redis_degraded` - `degradedCapabilities` — explicit list of what Redis loss is breaking - `sessionPressure` — context %, compaction age, session age, next action, next threshold summary, thread counts, fallback state/activations/failures, pressure reasons, alert state - `supersession` — latest-wins interruptibility state for human turns (active superseded request, last source/time/drop count, batching window, pending sources, last batch flush) - `operatorTracing` — canonical Telegram operator action ack/dispatch/completion/timeout summary across callbacks + direct commands - `callbackTracing` — compatibility alias for the same snapshot while older surfaces catch up - `channels` — reusable runtime health/ownership snapshots for Telegram, Discord, iMessage, and Slack - `channelHealth` — summarized degraded/muted channel state plus last degrade/recover event - `activeSessions` — should have `gateway` with `alive: true` - `pending: 0` — if >0, messages are backing up (session busy or stuck) Interpretation: - `mode: redis_degraded` means the daemon/session can still be usable while the Redis bridge is sick. - Do not call that a full outage unless process/session layers are also failing. - `joelclaw gateway diagnose` now emits a dedicated `session-pressure` layer so pressure risk is inspectable even when Redis/process layers are healthy. - `interruptibility` tells you whether a newer human message already superseded the stale turn, and whether direct human channels are currently sitting inside the short batching window before dispatch, so a brief pause can be intentional instead of another silent failure. - `operator-tracing` tells you whether Telegram operator callbacks and direct commands are acking, completing, failing, or timing out honestly, with route + trace id surfaces for the last completed/failed/timed-out action. Queued Telegram agent commands now stay open until the downstream gateway turn really finishes, and external callback-route consumers can now close traces via Redis trace-result handoff instead of being marked done at publish time. - `channel-health` tells you whether a channel is intentionally owner/passive/fallback, truly connected, or quietly half-dead. It now also shows muted known issues and the last degrade/recover event. Telegram `fallback` with `leaseEnabled=false` is expected when poll leasing is disabled locally; do not call that degraded by itself — but if polling is actually down and only retrying after `getUpdates` conflicts, diagnose now marks that contract degraded instead of pretending fallback is healthy. - `channel-healing` tells you whether the watchdog currently has a restart policy armed, what the degraded streak/cooldown is, whether the last heal attempt succeeded or blew up, and what manual repair summary/commands apply when the policy is `manual`. Muted degraded channels should now read as manual repair too — if you still see `restart` on a muted broken channel, the contract is lying. ### Layer 2: Error Log (the money log) ```bash # Default: last 100 lines. Adjust for time range. tail -100 /tmp/joelclaw/gateway.err ``` **Known error patterns:** | Pattern | Meaning | Root Cause | |---------|---------|-----------| | `Agent is already processing` | Command queue tried to prompt while session streaming | Queue is not using follow-up behavior while streaming, or session is genuinely wedged | | `dropped consecutive duplicate` | Inbound prompt was suppressed before model dispatch | Dedup collision (often from hashing channel preamble instead of message body) | | `fallback activated` | Model timeout or consecutive failures triggered model swap | Primary model API down or slow | | `Authentication failed for "anthropic"` | Prompt rejected before model stream sta
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.