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 namedevelopment
Governed intelligence skill for AAA as the abstraction, attestation, and abduction control plane across arifOS, APEX, A-FORGE, GEOX, WEALTH, WELL, and the ariffazil profile repository. Use when the user asks to explain or design AAA, route agentic work, reduce chaos/entropy in an arifOS federation task, create AREP/task declarations, classify risk, plan multi-repo changes, review governance boundaries, or translate human intent into evidence-backed, authority-safe, recursively agentic workflows. Provides deterministic F1-F13 floor checking, bounded abduction, and FederationReceipt composition.
development
Check every skill’s “use when” and “do not use when” clauses for collisions, missing negatives, and vague verbs like “help,” “assist,” or “improve.” Load when linting, reviewing, or validating trigger boundaries.
development
Bootstrap, design, and package new skills. Load when capturing user intent for a new skill or drafting its initial instruction framework.
content-media
Diagnose which federation services are up, down, or drifting. Produce a prioritized remediation plan.