Open
Conversation
Implements the PM Daemon design from docs/internal/docs/PM-DAEMON-DESIGN.md. The PM Daemon is an LLM-powered AI agent that runs as a persistent loop on each seed node, providing a 24/7 project manager interface via Telegram. **New Services:** - services/telegram.ts - Telegram Bot API client (long-polling, exponential backoff) - services/node-registry.ts - Multi-node registry with health checks - services/pm-commands.ts - Slash command router (/status, /loops, /start, /stop, etc.) - services/pm-monitor.ts - Monitor loop (detects completions, errors, stalls) - services/pm-brain.ts - Claude Code session manager via doppler subprocess **Configuration:** - src/config/nodes.yaml - Node registry template - .env.example - Added PM_DAEMON_ENABLED, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID - CLAUDE.md - PM daemon persona/system prompt **Changes:** - src/types/index.ts - Added PM daemon types (Telegram, NodeRegistry, MonitorEvent, etc.) - src/index.ts - Conditional PM daemon startup when PM_DAEMON_ENABLED=true **Doppler Secrets (seed/prd):** - TELEGRAM_BOT_TOKEN - Bot token for @SimulationapiBot - TELEGRAM_CHAT_ID - Allowed chat ID for operator - PM_DAEMON_ENABLED - Enables PM daemon on all nodes Co-Authored-By: Claude <noreply@anthropic.com>
Previously spawned a new Claude Code session per message (stateless). Now maintains a persistent virtual session with conversation history. Changes: - pmBrain.start() called on PM daemon startup - pmBrain.stop() called on shutdown - Each message includes last 20 messages for context - Max 100 messages stored (with system prompt preserved) - Processing lock prevents concurrent messages This gives the PM "memory" - it remembers previous context and can reference earlier parts of the conversation. Co-Authored-By: Claude <noreply@anthropic.com>
Two types of Claude sessions: 1. Persistent session (main brain) - One long-running doppler run -- claude process - Communicates via stdin/stdout pipes - Maintains conversation memory - Auto-restarts on crash 2. Spawned workers (for isolated tasks) - Fresh claude -p instances for one-off tasks - Don't affect persistent session memory - Can run multiple in parallel Changes: - Added PersistentClaudeSession class with stdin/stdout handling - pmBrain.processMessage() uses persistent session - pmBrain.spawnWorker() spawns fresh instances - pmBrain.spawnWorkers() for parallel execution Co-Authored-By: Claude <noreply@anthropic.com>
Removed all the manual conversation tracking that I overengineered. Claude Code already has built-in memory and context management. What it does now: - Spawn ONE persistent doppler run -- claude process - Pipe stdin/stdout for communication - Claude handles all memory (no manual tracking needed) - Monitor loop injects context as messages - Spawned workers available for parallel tasks 600+ lines → 410 lines Co-Authored-By: Claude <noreply@anthropic.com>
PM daemon services now live in src/services/daemon/: - telegram.ts - pm-brain.ts - pm-commands.ts pm-monitor.ts - node-registry.ts Core services remain in src/services/: - git.ts -ralph.ts -setup.ts Co-Authored-By: Claude <noreply@anthropic.com>
- Add real-time bidirectional WebSocket for peeking into running Claude sessions - Store process handles (stdin/stdout) for active Ralph loops - Add WS endpoint: /api/ralph-loops/:id/ws - Stream Claude stdout → WebSocket for visibility - Relay WebSocket messages → Claude stdin for oversight - Remove node-registry (deferred to multi-node architecture) - Update PM daemon to single-node mode - Add NODE-REGISTRY-DESIGN.md for future multi-node reference Co-Authored-By: Claude <noreply@anthropic.com>
- Rename pm-brain.ts → daemon-layer-agent.ts - Update class name: PmBrainService → DaemonLayerAgentService - Update imports and references in index.ts Co-Authored-By: Claude <noreply@anthropic.com>
- Install @ebowwa/lane from npm using bun install - Symlink ~/.lane-install/node_modules/.bin/lane to ~/.local/bin/lane - Avoids broken bun -g and unnecessary git clone - Update tests for npm-based installation Co-Authored-By: Claude <noreply@anthropic.com>
- Add TailscaleService for status, IPs, peers - Add /api/tailscale/* endpoints to node-agent HTTP API - Add ConnectionInfo types for connectivity monitoring - Update pm-commands, pm-monitor, telegram with minor enhancements - Remove old ralph-iterative session state Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
API Endpoints Added
GET /api/tailscale/status- Tailscale connection statusGET /api/tailscale/ips- All Tailscale IPsGET /api/tailscale/peers- All mesh peersGET /api/tailscale/peers/online- Online peers onlyChanges
🤖 Generated with Claude Code