Enable multiple task instances with unique tmux sessions#72
Merged
Conversation
Each `task -l` instance now gets its own isolated tmux sessions based on PID.
This allows running multiple task app instances simultaneously without conflicts.
Changes:
- Added session ID management using TASK_SESSION_ID env var
- Updated task-ui session naming: task-ui-{PID}
- Updated task-daemon session naming: task-daemon-{PID}
- Session ID propagates through daemon and executor processes
- Updated copilot system prompt to reference dynamic session name
- All tmux commands now use instance-specific session names
Each instance maintains complete isolation:
- Separate UI session (task-ui-{PID})
- Separate daemon session (task-daemon-{PID})
- Independent Claude task windows
- No session name conflicts between instances
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Resolved conflicts by:
- Keeping instance-specific session naming (task-ui-{PID}, task-daemon-{PID})
- Adopting main's removal of copilot pane split
- Adopting main's --chrome flag for Claude commands
- Removing unused buildCopilotClaudeCommand function
The merge maintains the core functionality of multiple task instances
while incorporating the latest changes from main.
Co-Authored-By: Claude Sonnet 4.5 <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
Fixes the issue where every
task -lcommand used the same tmux session, preventing multiple task instances from running simultaneously.Each task instance now gets its own isolated tmux sessions based on process ID, allowing users to run multiple task app instances in parallel without conflicts.
Changes
Session ID Management
getSessionID()function that generates unique session IDs based on PIDTASK_SESSION_IDenvironment variableDynamic Session Naming
task-uitotask-ui-{PID}task-daemontotask-daemon-{PID}Updated Components
How It Works
task -lstarts withoutTASK_SESSION_ID, it generates one based on its PIDtask-ui-12345task-daemon-12345Instance Isolation
Each instance now maintains complete isolation:
Testing
Files Changed
cmd/task/main.go(98 insertions, 46 deletions)internal/executor/executor.go(51 insertions, 46 deletions)🤖 Generated with Claude Code