diff --git a/internal/supervisor/supervisor.go b/internal/supervisor/supervisor.go index 5cf6e52..1b3ce55 100644 --- a/internal/supervisor/supervisor.go +++ b/internal/supervisor/supervisor.go @@ -71,10 +71,15 @@ func (s *Supervisor) assignWork() { } botCwd := sess.Metadata().Cwd - // Find a claimable task in this bot's project (matching cwd) + // Find a claimable task in this bot's project (matching cwd or subdirectory) for _, bead := range claimable { taskCwd, ok := bead["cwd"].(string) - if !ok || taskCwd != botCwd { + if !ok { + continue + } + + rel, err := filepath.Rel(taskCwd, botCwd) + if err != nil || (rel != "." && filepath.IsAbs(rel)) { continue }