- Add WorktreeCleanup interface to task service
- Call OnTaskDeleted when a task is deleted to remove worktree dir and branch
- Wire worktree manager to task service in main.go
This ensures that when tasks are deleted, their associated worktrees
and git branches (kandev/{task_id}) are properly cleaned up.
Container runs as root but mounted files are owned by host user.
Git 2.35.2+ rejects this as 'dubious ownership'. Configure git via
environment variables to trust all directories in the container.
Git worktree metadata in .git/worktrees/{name} has a 'commondir' file
that references back to the parent .git directory (typically '../..').
Mounting just the worktrees subdirectory wasn't sufficient - we need
to mount the entire .git directory so that:
1. The worktree's .git file can resolve to .git/worktrees/{name}
2. The commondir reference can resolve back to the main .git
3. Git objects, refs, and other shared data are accessible
Git worktrees store their metadata in the parent repository's
.git/worktrees/{name} directory. The worktree's .git file contains
an absolute path to this directory.
When mounting a worktree into a container, git commands fail because
the .git file references a host path that doesn't exist in the container.
This fix mounts the git worktree metadata directory into the container
at the same path it exists on the host, so git commands work correctly.
- Add WorktreePath and WorktreeBranch fields to TaskDTO
- Add WorktreeLookup interface to TaskController for enriching task responses
- Add GetWorktreeInfo method to worktree.Manager implementing WorktreeLookup
- Wire worktree manager to task controller in main.go
- Add worktree_path and worktree_branch to frontend Task type
- Display worktree path with copy button in TaskTopBar when worktree exists
- Show worktree branch in tooltip for easy reference
- Add worktree package with Manager, Store, Config, and error types
- Integrate worktree creation/reuse into lifecycle manager
- Update executor to pass worktree configuration
- Add WorktreeConfig to common config package
- Enable worktrees by default for agent isolation
- Add unit tests for worktree manager
This allows multiple agents to work on the same repository simultaneously
by creating isolated worktrees for each task. Worktrees persist between
agent runs for task resumption and are only cleaned up when tasks are
explicitly deleted.
- Add typing indicator in TaskChatPanel that shows when agent is working
- Enhanced ToolCallCard component with expandable details section
- Backend now passes tool call args (kind, path, locations, raw_input) to comments
- Add generateUUID fallback for non-secure contexts (HTTP non-localhost)
- Configure Next.js allowedDevOrigins for cross-origin dev access
- Bind dev server to 0.0.0.0 for network access
Backend changes:
- Extract Kind, Locations, RawInput from ACP ToolCall updates
- Add Args field to ToolCallData in watcher
- Pass args through CommentCreator interface to comment metadata
Frontend changes:
- ToolCallCard shows file path, status icons, expandable args
- getToolIcon matches ACP ToolKind values (read, edit, search, execute)
- Typing indicator with animated dots when awaiting agent response
- Replace crypto.randomUUID with fallback utility across all files
- Add Docker reconciliation on lifecycle manager startup to find running containers
- Add container_id field to agent_sessions table for cleanup tracking
- Add GetRecoveredInstances to AgentManagerClient interface
- Sync executor cache with recovered Docker instances on startup
- Add task.execution WebSocket endpoint to check agent running state
- Fix Stop Agent button showing Start Agent after page refresh
- Ensure containers are not leaked when backend restarts
Only broadcast message types that the frontend handles (progress, log, result,
error, status, heartbeat, input_required). Skip internal types like session/update.
- Initialize comments.items array in setCommentsTaskId and addComment
- Fixes race condition where WebSocket notifications arrived before API call completed
- Remove validation requiring repository_url in lifecycleAdapter.LaunchAgent
- Skip workspace mounts in lifecycle manager when no workspace path is provided
- Agents can now run without a pre-existing workspace directory
- Add react-markdown with remark-breaks and remark-gfm for markdown rendering
- Improve WebSocket client with better reconnection handling
- Enhanced task chat panel with markdown support for comments
- Add comment type and metadata support for tool call rendering
- Improve connection status indicator
- Update task page with improved agent controls
- Add WebSocket router for better message handling
- Update state store with enhanced type safety
- Add AgentSession database entity with SQLite persistence
- Implement AgentSession CRUD operations in repository layer
- Update executor to use hybrid cache + database approach
- Add session restoration on startup (LoadActiveSessionsFromDB)
- Link comments to agent sessions via agent_session_id
- Fix SQLite NULL handling for nullable task fields
- Add dev database setup with seed data (make dev, make dev-db-reset)
- Update Makefile with dev targets for development mode
This enables agent sessions to persist across backend restarts,
solving the 'execution not found' error for resumed conversations.
- Add missing repository action constants to pkg/websocket/actions.go
- Update repository_handlers.go to use action constants instead of string literals
- Refactor orchestrator module: create dto/, controller/, handlers/ packages
- Refactor agent module: create dto/, controller/, handlers/ packages
- Update main.go and integration tests to use new Pattern A wiring
- Remove old wshandlers/ directories from both modules
All modules now follow the same architecture:
handlers/ → Parse WS messages, validate, call controller
controller/ → Business logic coordination, convert to/from DTOs
dto/ → Centralized request/response Data Transfer Objects
service/ → Core business logic (unchanged)
- Add comment handlers for WebSocket API (comment.add, comment.list)
- Update e2e-test.sh to focus on comment system testing
- Test multi-turn conversation flow (3 turns)
- Display comment content and metadata in test output
- Reduce test timeouts for faster execution
- Fix various orchestrator and lifecycle manager issues
- Add CODE_REVIEW_ISSUES.md documenting known issues
- Add permission stream support to backend agentctl client
- StreamPermissions() connects to permission WebSocket
- RespondToPermission() sends responses via HTTP POST
- PermissionNotification type for permission request data
- Connect lifecycle manager to permission stream
- handlePermissionStream() receives permission requests
- publishPermissionRequest() forwards to event bus
- RespondToPermission() and RespondToPermissionByTaskID() methods
- Add WebSocket handler for permission.respond action
- Validates task_id, pending_id, option_id
- Routes response through orchestrator → executor → lifecycle manager
- Add permission WebSocket actions
- ActionPermissionRequested for notifications
- ActionPermissionRespond for user responses
- Update executor interface with RespondToPermissionByTaskID()
- Update mock implementations in tests
- Add permission response test to e2e-test.sh
- Fix e2e-test.sh ID extraction (strip newlines)
The full permission flow is now wired up:
agent → agentctl → backend → frontend → user → backend → agentctl → agent
Auto-approve mode is still enabled by default until frontend is ready.
- Add Comment model and CRUD operations (repository, service layers)
- Add WAITING_FOR_INPUT task state for agent input requests
- Add WebSocket actions for comment.add, comment.get, comment.list
- Add ActionCommentAdded and ActionInputRequested notifications
- Update PromptAgent to return PromptResult with stop reason
- Add e2e test for agent input request flow
- Add PR template for the repository
This enables agents to request input from users by returning
stopReason 'needs_input' which transitions the task to
WAITING_FOR_INPUT state and creates an agent comment.
- Add Step 13: Verify Session ID in Task Metadata
- Check that auggie_session_id is present in task metadata after completion
- Update test summary to include session ID verification
- Wire session_info ACP handler in test server (mirrors main.go)
- Update TestOrchestratorSessionInfo to verify auggie_session_id is stored
- Test confirms session ID flows from agent → event bus → task metadata
The session_id must be in the 'data' field, not at the top level,
so the watcher can parse it into protocol.Message and the handler
can find it at msg.Data["session_id"].
The lifecycle manager now publishes a session_info event after creating
an ACP session. This event is handled in main.go to store the session ID
in the task metadata, enabling session resumption for follow-up tasks.