feat: integrate supervisor into edge container #344

Closed
opened 2026-04-07 08:33:48 +00:00 by dev-bot · 1 comment
Collaborator

Goal

Run the supervisor agent inside the edge container alongside the dispatcher and Caddy. The edge container already has the Docker socket and infrastructure access the supervisor needs.

See #232 for full design rationale.

Changes

docker/edge/Dockerfile

Add claude binary. The binary is bind-mounted at runtime (same pattern as agents container), but the Dockerfile may need supporting packages. Current Dockerfile already has bash, jq, curl, git, docker-cli.

docker-compose.yml (edge service)

Add to the edge service:

  • Claude binary bind-mount: /home/johba/.local/share/claude/versions/2.1.84:/usr/local/bin/claude:ro
  • OAuth credentials: ${HOME}/.claude.json:/root/.claude.json:ro and ${HOME}/.claude:/root/.claude:ro
  • Env vars: FORGE_SUPERVISOR_TOKEN, ANTHROPIC_API_KEY (or rely on OAuth)
  • CLAUDE_MODEL: claude-sonnet-4-6

docker/edge/entrypoint-edge.sh

Add supervisor loop in background, same pattern as the dispatcher:

# Start supervisor loop in background
while true; do
  bash /opt/disinto/supervisor/supervisor-run.sh /opt/disinto/projects/disinto.toml 2>&1 | tee -a /opt/disinto-logs/supervisor.log || true
  sleep 1200  # 20 minutes
done &

This goes between the dispatcher start and the Caddy exec, following the existing pattern at line 17: bash /opt/disinto/docker/edge/dispatcher.sh &

Do NOT use cron — the while-true loop inherits env vars from PID 1.

state/.supervisor-active

Create the guard file so check_active passes.

Prior art

  • dispatcher.sh: while-true loop with sleep 60, sources lib/env.sh — supervisor follows the same pattern
  • planner-run.sh: cleanest reference for the standard *-run.sh agent pattern (guards, formula loading, context building, agent_run, journal)
  • supervisor-run.sh: already follows the standard pattern, just needs the LOG_FILE fix from the cleanup issue

Dependencies

Depends on the supervisor cleanup issue (LOG_FILE fix, dead file removal)

Acceptance criteria

  • Supervisor runs inside edge container on a 20-minute loop
  • Docker container health checks work (docker ps, docker stats via socket)
  • System metrics (RAM, disk, load) collected via /proc
  • Forgejo/Woodpecker API checks work
  • Health journal written to ops repo after each run
  • disinto up starts supervisor, disinto down stops it
  • No host-level services or cron jobs added

Dependencies

Depends on #343

## Goal Run the supervisor agent inside the edge container alongside the dispatcher and Caddy. The edge container already has the Docker socket and infrastructure access the supervisor needs. See #232 for full design rationale. ## Changes ### docker/edge/Dockerfile Add claude binary. The binary is bind-mounted at runtime (same pattern as agents container), but the Dockerfile may need supporting packages. Current Dockerfile already has bash, jq, curl, git, docker-cli. ### docker-compose.yml (edge service) Add to the edge service: - Claude binary bind-mount: `/home/johba/.local/share/claude/versions/2.1.84:/usr/local/bin/claude:ro` - OAuth credentials: `${HOME}/.claude.json:/root/.claude.json:ro` and `${HOME}/.claude:/root/.claude:ro` - Env vars: FORGE_SUPERVISOR_TOKEN, ANTHROPIC_API_KEY (or rely on OAuth) - CLAUDE_MODEL: claude-sonnet-4-6 ### docker/edge/entrypoint-edge.sh Add supervisor loop in background, same pattern as the dispatcher: # Start supervisor loop in background while true; do bash /opt/disinto/supervisor/supervisor-run.sh /opt/disinto/projects/disinto.toml 2>&1 | tee -a /opt/disinto-logs/supervisor.log || true sleep 1200 # 20 minutes done & This goes between the dispatcher start and the Caddy exec, following the existing pattern at line 17: `bash /opt/disinto/docker/edge/dispatcher.sh &` Do NOT use cron — the while-true loop inherits env vars from PID 1. ### state/.supervisor-active Create the guard file so check_active passes. ## Prior art - dispatcher.sh: while-true loop with sleep 60, sources lib/env.sh — supervisor follows the same pattern - planner-run.sh: cleanest reference for the standard *-run.sh agent pattern (guards, formula loading, context building, agent_run, journal) - supervisor-run.sh: already follows the standard pattern, just needs the LOG_FILE fix from the cleanup issue ## Dependencies Depends on the supervisor cleanup issue (LOG_FILE fix, dead file removal) ## Acceptance criteria - [ ] Supervisor runs inside edge container on a 20-minute loop - [ ] Docker container health checks work (docker ps, docker stats via socket) - [ ] System metrics (RAM, disk, load) collected via /proc - [ ] Forgejo/Woodpecker API checks work - [ ] Health journal written to ops repo after each run - [ ] disinto up starts supervisor, disinto down stops it - [ ] No host-level services or cron jobs added ## Dependencies Depends on #343
dev-bot added the
backlog
label 2026-04-07 08:33:48 +00:00
dev-bot self-assigned this 2026-04-07 09:09:03 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-07 09:09:04 +00:00
dev-qwen added
blocked
and removed
in-progress
labels 2026-04-07 09:09:22 +00:00
Collaborator

Stale in-progress issue detected

Field Value
Detection reason no_active_session_no_open_pr
Timestamp 2026-04-07T09:09:22Z

Status: This issue was labeled in-progress but no active tmux session exists.
Action required: A maintainer should triage this issue.

### Stale in-progress issue detected | Field | Value | |---|---| | Detection reason | `no_active_session_no_open_pr` | | Timestamp | `2026-04-07T09:09:22Z` | **Status:** This issue was labeled `in-progress` but no active tmux session exists. **Action required:** A maintainer should triage this issue.
dev-bot removed their assignment 2026-04-07 09:28:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#344
No description provided.