Command Palette

Search for a command to run...

Назад к скиллам
скилл № 65579

pan-dashboard-restart

Safely restart the Overdeck dashboard server (production Node 22 dist) using a detached process. Use when pan up / pan restart hang, the dashboard…

БесплатноБез исполняемых скриптов
eltmonот eltmon★ 36 звёзд на GitHub

Установить pan-dashboard-restart в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Overdeck Dashboard Restart (production-safe)

The dashboard the browser talks to is the pre-built dist/dashboard/server.js running under Node 22, started from the primary repo checkout (NOT a workspaces/feature-* copy). It serves both the built frontend and the API on one port. Never run the production server via npm run dev, tsx, vite, or Bun — that violates the dashboard-node22-only rule (node-pty native addon + circular ESM). pan dev is the development path (vite HMR for the frontend + Node server); pan up is the production path.

The supervisor sidecar (overdeck-supervisor.service, port 3012) owns the dashboard lifecycle: it health-checks the server and respawns it as a systemd unit with the full env from config.yaml. Restart through it (POST :3012/restart-dashboard with the internal token) — a manually spawned server is a duplicate it will replace, and racing it costs minutes of churn. The manual detached start below is the fallback for when the supervisor itself is down, and it must carry the Traefik env block (gotcha 7).

When to use this skill

pan up / pan restart is the normal path. Reach for this manual procedure only when:

  • pan up / pan restart hangs for more than ~20s and never returns (it health-checks one port while the server binds another — see Gotcha 2).
  • The dashboard is churning: "Connection lost / Reconnecting", servers respawning, received SIGTERM loops.
  • Two dashboard servers exist (single-deacon-invariant duel) or the live server's cwd is a workspaces/feature-* path.

Critical gotchas (these cost a multi-hour incident)

  1. Never pkill -f a pattern that appears in your own command. pkill -f 'dashboard/server.js' matches your own shell's argv and kills it mid-run (exit 144). Always kill by explicit PID found via ss/ps.
  2. pan up/pan restart health-check the configured port (dashboardApiPort, default 3011 — or 3010 on some setups), but the server binds process.env.PORT. If PORT differs, the wrapper waits forever on the wrong port, never daemonizes, and leaves the server parented to a stuck wrapper — kill that wrapper and the dashboard dies with it. Detached start (below) avoids this entirely.
  3. Exactly ONE server. Two servers = two deacons racing the same ~/.overdeck state (the duel), and the PAN-1625 janitor reaps/churns extras. A single port-owner is left alone.
  4. Work-agent tmux sessions survive a dashboard restart — they are separate processes on the overdeck socket. Restarting the dashboard does NOT kill agents; the new deacon reconciles them as running.
  5. Run from the primary repo, not a workspace. If readlink /proc/<pid>/cwd is a workspaces/feature-* path, a workspace dashboard hijacked the port — kill it and restart from the primary checkout.
  6. The supervisor sidecar owns the dashboard lifecycle. overdeck-supervisor.service (port 3012) health-checks the dashboard and respawns it as a systemd unit with the full env from config.yaml. A manual server you spawn yourself is a duplicate it will replace — so restart THROUGH the supervisor (below) instead of racing it, and never kill a systemd-parented server that carries OVERDECK_TRAEFIK_* env: that is the supervisor's correctly-configured replacement, not a stray.
  7. A bare node dist/dashboard/server.js launch 403s the domain on dists without the config fallback. getTrustedOrigins() reads the launch env; no OVERDECK_TRAEFIK_* → only loopback is trusted → /ws/* 403s https://overdeck.localhost → the dashboard hangs on "Reconnecting to the dashboard…" while localhost:3011 works. /api/health returns 200 the whole time because it does no origin validation. Newer dists fall back to config.yaml (commit e86d125071), but always launch WITH the env block below — it costs nothing and works on every dist.

Procedure

cd ~/Projects/overdeck   # the PRIMARY checkout

# 0. Domain comes from config.yaml — the same source pan up / the supervisor use
DOMAIN=$(awk '/^traefik:/{f=1} f && /^  domain:/{print $2; exit}' ~/.overdeck/config.yaml)
DOMAIN=${DOMAIN:-overdeck.localhost}

# 1. Rebuild ONLY if you changed server/lib source (the Node 22 dist is what runs)
npm run build

# 2. PREFERRED: restart through the supervisor (it owns the lifecycle, sets the
#    correct env from config.yaml, and systemd-manages the result). Skip to step 3
#    only when port 3012 refuses connections. The supervisor restarts only for the
#    internal token (PAN-5714); without it the answer is 401 unauthorized.
curl -s -X POST http://127.0.0.1:3012/restart-dashboard \
  -H "x-overdeck-internal-token: $(cat ~/.overdeck/internal-token)"   # → 202 Accepted

# 3. Supervisor down? Manual detached start — WITH the Traefik env block (gotcha 7).
#    Kill the old server by EXPLICIT PID (never pkill -f self-matching).
OLD=$(ss -ltnp 2>/dev/null | grep -E ':3011\b' | grep node | grep -oE 'pid=[0-9]+' | head -1 | cut -
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

  1. 01Bash
  2. 02Read

FAQ

Что делает скилл pan-dashboard-restart?

Safely restart the Overdeck dashboard server (production Node 22 dist) using a detached process. Use when pan up / pan restart hang, the dashboard churns/reconnects in a loop, two dashboards are dueling, or the server is running from a workspace path / wrong port.

Как установить скилл pan-dashboard-restart?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pan-dashboard-restart запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить pan-dashboard-restart с