-
Notifications
You must be signed in to change notification settings - Fork 153
Description
When an agent is bound to multiple channels, all channels share the same agent workspace directory. Concurrent tasks from different channels operate on the same files and git state, causing work to bleed between tasks.
What happens today:
Agent: "coder"
├── Channel A: "add auth module"
│ └── Worker A → shell/file/exec ──┐
│ ├──► Same workspace dir
├── Channel B: "fix pagination bug" │ Same files, same git branch
│ └── Worker B → shell/file/exec ──┘
│
└── PR from Channel A contains Channel B's changes ❌
I discovered this when two channels were working on separate tasks within the same project concurrently. Everything appeared to be progressing fine until one channel created a PR and noticed it contained code changes from the other channel's task — both workers had been writing to the same branch and files simultaneously.
This affects two scenarios:
- Same project, different tasks — two channels working on different features in the same repo collide on the same branch and files
- Different projects — channels representing entirely separate codebases still share one workspace
Proposed solution: Per-channel working directories
Allow each channel to use it's own sub directory, so workers spawned for a channel, operate in an isolated location.
Same project, isolated by channel:
Agent: "coder"
├── #add-auth → /{channelId}/project-a/ (own branch)
├── #fix-paging → /{channelId}/project-a/ (own branch)
Different projects, isolated by channel:
Agent: "coder"
├── #add-auth → /{channelId}/project-a/ (own branch)
├── #fix-paging → /{channelId}/project-b/ (own branch)
Not sure if this is the best approach, maybe this is more about training the agent with a better skill than having spacebot handle it... I'm willing to make this change, but wanted to out it out here for discussion first to get feedback/consensus on the path forward.