diff --git a/agent-team/systemd/agent-team-coordinator.service b/agent-team/systemd/agent-team-coordinator.service index 20d25d2..3261b3d 100644 --- a/agent-team/systemd/agent-team-coordinator.service +++ b/agent-team/systemd/agent-team-coordinator.service @@ -13,8 +13,10 @@ # systemctl status agent-team-coordinator.service # journalctl -u agent-team-coordinator.service -e -f # -# Secrets come from the EnvironmentFile (leading '-' = optional, no failure if -# absent), ~/secrev.env (mode 600, NOT in git): +# Secrets come from the EnvironmentFile(s) (leading '-' = optional, no failure if +# absent). Two files are loaded, mirroring the sea-haven-secrev unit: +# +# ~/secrev.env (mode 600, NOT in git) - the agent-team runtime keys: # CLAUDE_CODE_OAUTH_TOKEN -> subscription OAuth (from `claude setup-token`). # A raw ANTHROPIC_API_KEY must NOT be set on this # box; it would silently win and meter to API @@ -24,7 +26,18 @@ # REQUIRED for Socket Mode; opens the inbound # WebSocket that receives answers. Without it the # coordinator can post but never hear replies. +# serve() starts the inbound SlackListener only when +# the transport is live Slack AND this token is set. # SLACK_CHANNEL_ID -> target channel for clarifier questions. +# AGENT_TEAM_SLACK_OWNER_IDS -> comma-separated authorized answerer ids +# (AUTHZ-01). The listener FAILS CLOSED if unset. +# +# ~/orchestrator/.env (mode 600, NOT in git) - the P2 review-loop provider key: +# The production serve() wires the GPT-4.1 cross-review loop, which shells the +# local orchestrator run.py -> cross_reviewer once a task reaches REVIEW. That +# sub-process needs the non-Claude provider key from ~/orchestrator/.env (same +# file the sea-haven-secrev unit loads). Optional ('-') so the daemon still +# starts if it is absent; the review path then fails loudly only at REVIEW. [Unit] Description=Sea Haven agent-team Plane-2 coordinator daemon @@ -36,7 +49,11 @@ Type=simple User=adam WorkingDirectory=/home/adam/orchestrator/agent-team EnvironmentFile=-/home/adam/secrev.env -ExecStart=/usr/bin/env python3 run-team.py serve +EnvironmentFile=-/home/adam/orchestrator/.env +# Use the agent-team venv interpreter (where the runtime deps are installed by +# the DEPLOY-R720 / PROVISIONING-RUNBOOK step), NOT the bare system python3 that +# `/usr/bin/env python3` would resolve under systemd's PATH (D-7). +ExecStart=/home/adam/orchestrator/agent-team/.venv/bin/python run-team.py serve Restart=on-failure RestartSec=5 # Hardening - matches the level the sea-haven-secrev unit relies on, scoped for a