name: Slack Agents description: Manage pi-mono Slack agents (mom bots). Activate when user mentions slack agent, pilot, pilot sandbox, zip agent, revive agent, start agent, stop agent, agent status, pi-mono agents, or needs to manage running Slack bot instances.
Slack Agents Management
Multi-agent Slack bot architecture based on pi-mono (Mario Zechner's mom package).
Architecture Overview
pi-mono/ # Primary fork (Pilot agent)
└── packages/mom/
├── run.sh # Direct start script
├── start-pilot.sh # Tmux launcher
├── .env # Slack tokens + Anthropic key
├── data/ # Workspace (mounted to container)
└── logs/ # Daily log files
pi-mono-zip/ # Worktree of pi-mono (Zip agent)
└── packages/mom/
├── run.sh
├── start-zip.sh # Tmux launcher
├── .env
├── data/
└── logs/
Note: pi-mono-zip is a git worktree of pi-mono, not a separate clone.
Current Agents
| Agent | Container | Repo | Workspace | Tmux Session |
|---|---|---|---|---|
| Pilot | pilot-sandbox | pi-mono | Fatcatsdev Slack | pilot |
| Zip | zip-sandbox | pi-mono-zip | Personal Slack | zip |
| Mom | mom-sandbox | (Mario's) | Mario's Slack | - |
Common Operations
Check Agent Status
# List all agent containers
docker ps --format 'table {{.Names}}\t{{.Status}}' | grep -E 'sandbox|mom'
# List tmux sessions
tmux list-sessions | grep -E 'pilot|zip'
# Check if bot process is running
pgrep -af "mom/dist/main.js"
Start an Agent (preferred: tmux)
# Pilot (in tmux session)
cd ~/code/pi-mono/packages/mom && ./start-pilot.sh
# Zip (in tmux session)
cd ~/code/pi-mono-zip/packages/mom && ./start-zip.sh
# Attach to running session
tmux attach -t pilot
tmux attach -t zip
Start an Agent (direct, no tmux)
cd ~/code/pi-mono/packages/mom && ./run.sh
cd ~/code/pi-mono-zip/packages/mom && ./run.sh
Stop an Agent
# Kill tmux session (also kills the process)
tmux kill-session -t pilot
tmux kill-session -t zip
# Or kill the node process directly
pkill -f "pi-mono/packages/mom/dist/main.js" # Pilot
pkill -f "pi-mono-zip/packages/mom/dist/main.js" # Zip
View Logs
# Today's log
tail -f ~/code/pi-mono/packages/mom/logs/mom-$(date +%Y-%m-%d).log
# Recent activity
tail -100 ~/code/pi-mono-zip/packages/mom/logs/mom-$(date +%Y-%m-%d).log
# Or attach to tmux session to see live output
tmux attach -t pilot
Restart Container (if needed)
docker restart pilot-sandbox
docker restart zip-sandbox
Environment Setup
Each agent needs .env with:
MOM_SLACK_APP_TOKEN=xapp-... # Socket mode token
MOM_SLACK_BOT_TOKEN=xoxb-... # Bot OAuth token
ANTHROPIC_API_KEY=sk-ant-... # Or ANTHROPIC_OAUTH_TOKEN
Adding a New Agent
-
Create worktree (preferred) or clone:
cd ~/code/pi-mono git worktree add ../pi-mono-newagent -b newagent-deploy -
Configure container name in run.sh:
CONTAINER_NAME="newagent-sandbox" -
Create tmux launcher (copy from existing):
cp start-pilot.sh ../pi-mono-newagent/packages/mom/start-newagent.sh # Edit SESSION="newagent" -
Create Slack app:
- https://api.slack.com/apps
- Enable Socket Mode
- Add bot scopes (see packages/mom/docs/slack-bot-minimal-guide.md)
- Generate tokens
-
Configure .env:
cd ~/code/pi-mono-newagent/packages/mom cp .env.example .env # Edit with tokens -
Build and run:
cd ~/code/pi-mono-newagent npm install npm run build cd packages/mom ./start-newagent.sh
Troubleshooting
Agent not responding
- Check container:
docker ps | grep sandbox - Check tmux:
tmux list-sessions - Check logs for errors
- Restart:
tmux kill-session -t pilot && ./start-pilot.sh
"Container not found"
# Recreate container (data preserved in ./data/)
docker rm pilot-sandbox 2>/dev/null
./run.sh # Will recreate
Token errors
- Verify tokens in .env
- Check Slack app is installed to workspace
- Ensure Socket Mode is enabled
Future Direction
This architecture enables:
- Multiple isolated agents per workspace
- Shared codebase with per-agent config (worktrees)
- Independent sandboxed execution environments
- Named tmux sessions for easy management
- Centralized management from TinyBat VPS