Skip to content

squads run: worktree provisioning ignores repo referenced in --task, uses squad's primary repo field #1092

Description

@kokevidaurre

Repro

`squads run app/substrate-worker --task "Work squads-api#162 — ..." --force`

`app` squad's SQUAD.md declares `repo: agents-squads/squads-app` + `also_owns: [agents-squads/squads-api]`. `substrate-worker`'s own role doc says it builds squads-api specifically. The task directive explicitly named `squads-api#162`.

Actual

Agent session only had filesystem access to a `squads-app` worktree — no `squads-api` worktree existed among allowed paths (`ls` on the parent `agents-squads/` dir was sandbox-blocked). Agent correctly refused to work around it (no ad-hoc clone) and stopped:

"Found the blocker: squads-api#162 ... is genuine FastAPI backend work — but this session only has filesystem access to the squads-app worktree ... This looks like a dispatch error — the task was routed to an app-substrate-worker worktree that's actually a squads-app checkout, when squads-api#162 needs a squads-api checkout."

Expected

Worktree provisioning should resolve the repo from the `#` pattern in the `--task` directive (or from the agent's own declared working repo when it differs from the squad's primary `repo:` field, via `also_owns`), not always default to the squad's primary repo.

Impact

Blocks any `also_owns`-repo work dispatched via `--task` — affects `app` squad's entire squads-api wiring lane (app-api-contract spec, squads-api#162-168).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions