feat: enhance repair command to recreate core agents and default workspace#324
Open
aronchick wants to merge 1 commit intodlorenc:mainfrom
Open
feat: enhance repair command to recreate core agents and default workspace#324aronchick wants to merge 1 commit intodlorenc:mainfrom
aronchick wants to merge 1 commit intodlorenc:mainfrom
Conversation
…space Improve the repair command to be more comprehensive by ensuring core agents and a default workspace exist after cleanup. This enhancement aligns with ROADMAP.md P1 "Agent restart" by making repair more robust and reducing the need for manual intervention. Changes: - CLI: Add ensureCoreAgents() and ensureDefaultWorkspace() helpers - CLI: Update localRepair() to recreate missing core agents - CLI: Create default workspace "my-default-2" if none exist - Daemon: Add ensureCoreAgents() and ensureDefaultWorkspace() methods - Daemon: Update handleRepairState() to recreate missing agents - Both: Improve output to show what was removed and what was created - Tests: Add comprehensive tests for all scenarios Key Features: 1. Recreates missing supervisor agent if absent 2. Recreates missing merge-queue (non-fork) or pr-shepherd (fork) 3. Creates default workspace if no workspaces exist 4. Does not duplicate existing agents/workspaces 5. Provides detailed output showing: - Removed: dead agents - Cleaned: orphaned resources - Created: core agents and workspaces Test Coverage: - TestRepairEnsuringCoreAgents: Verifies core agents are created - TestRepairEnsuringPRShepherdInForkMode: Fork mode verification - TestRepairDoesNotDuplicateAgents: Prevents duplicates Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
3 tasks
4 tasks
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
Enhance the
repaircommand to be more comprehensive by ensuring core agents and a default workspace exist after cleanup. This addresses ROADMAP.md P1 "Agent restart" by making repair more robust and reducing the need for manual intervention.Changes
CLI (
internal/cli/cli.go)ensureCoreAgents()helper to check and create missing core agentscreateCoreAgent()to create individual core agents (supervisor, merge-queue, pr-shepherd)ensureDefaultWorkspace()to create default workspace if none existlocalRepair()to call these helpers after cleanupDaemon (
internal/daemon/daemon.go)ensureCoreAgents()method mirroring CLI logicspawnCoreAgent()to spawn individual core agentsensureDefaultWorkspace()to create default workspace via tmuxhandleRepairState()to recreate missing agentsTests (
internal/cli/cli_test.go)TestRepairEnsuringCoreAgents: Verifies supervisor and merge-queue creationTestRepairEnsuringPRShepherdInForkMode: Verifies fork mode behaviorTestRepairDoesNotDuplicateAgents: Ensures existing agents aren't replacedBehavior
Before
After
Key Features
Testing
All tests pass including new comprehensive repair tests:
$ go test ./... ok github.com/dlorenc/multiclaude/internal/cli 10.200s ok github.com/dlorenc/multiclaude/internal/daemon 3.809sAlignment with ROADMAP.md
This change aligns with ROADMAP.md P1 "Agent restart": making the repair command more robust so agents can be automatically restored without manual intervention. This improves the "Reliable worker lifecycle" goal.
🤖 Generated with Claude Code