hermes-backup/daily/2026-04-28_203212/skills/devops/wealth-sse-transport-fix/SKILL.md
Fix WEALTH container restart loop caused by FastMCP stdio transport blocking on stdin when Docker starts without TTY
npx skillsauth add ariffazil/openclaw-workspace wealth-sse-transport-fixInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
wealth-organ container enters a restart loop:
Up 1 second
Exited (0) 2 seconds ago
Up 1 second
Exited (0) 2 seconds ago
...
monolith.py runs mcp.run() which defaults to stdio transport.
When Docker starts the container without a TTY, stdin closes immediately.
The stdio transport blocks waiting for input → when input never arrives, process exits
→ Docker restarts → loop.
# Before (in monolith.py)
if __name__ == "__main__":
mcp.run()
# After
if __name__ == "__main__":
import os
if os.isatty(0):
mcp.run() # stdio for local dev
else:
mcp.run(transport="sse", show_banner=False) # SSE for container
This makes the transport context-aware: stdio when run locally with a terminal, SSE when run in Docker.
unless-stopped restart policy handles actual crashesRemove the broken pg_isready healthcheck from compose. FastMCP SSE doesn't have a generic /health endpoint — the container process itself is the health indicator.
# Before (BROKEN — pg_isready not in WEALTH container)
healthcheck:
test: ["CMD", "pg_isready", "-U", "arifos"]
# After — remove healthcheck entirely (unless-stopped handles crashes)
# healthcheck: (omit entirely)
# 1. Copy patched monolith.py to VPS
scp /local/monolith.py arifos:/root/WEALTH/internal/
# 2. On VPS: commit
cd /root/WEALTH
git add internal/monolith.py
git commit -m "feat(kernel): harden intelligence v2026.04.29 [SSE + SABAR + V2_ALIAS]"
git push origin main
# 3. Rebuild container
cd /root/compose
docker compose up -d wealth-organ
# 4. Verify stable
docker ps # should show "Up X minutes" not cycling
# Check no restart loop
docker ps # wealth-organ: "Up N minutes"
# Check SSE port is listening inside container
docker exec wealth-organ sh -lc "curl -s --connect-timeout 2 http://localhost:8000/"
# Should return something (FastMCP SSE response or 404), not "connection refused"
# Check from Caddy network
docker exec caddy sh -lc "curl -s --connect-timeout 3 http://wealth-organ:8000/"
/root/wealth/internal/monolith.py — source (SSE patch applied here)/root/compose/docker-compose.yml — WEALTH service definitionwealth-organ — container nametesting
OpenClaw edge agent bridge — operational triage, doctor, restart, and A2A bridge routing for the federation edge (Telegram surface). USE WHEN: "openclaw unhealthy", "gateway down", "edge bot not responding", "a2a bridge disconnected", "watchdog tripped", "openclaw doctor", "openclaw restart". NOT for token/security audit — use FORGE-telegram-audit.
tools
Generate images, videos, TTS, voice clone, and music via MiniMax MCP server. Use when user asks to "draw", "generate image", "create picture", "make a photo", "text to image", "image generation".
testing
Single load-bearing constitutional-judgment skill. Routes all F1–F13, verdict, hold, seal, scope, authority and floor-check calls through the live arif_judge surface. Replaces 7 overlapping predecessors (arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge).
development
MANDATORY LSP grounding gate BEFORE any code mutation on .ts, .py, .js, .tsx, .jsx files. Forces the agent to read real-time compiler diagnostics and structural project context before editing — eliminating blind guesses and anchoring every mutation in F2 (TRUTH). Routes through arifOS kernel (:8088) for centralized gate logic.