Support split worktree agent launches

Expose the workspace id from worktree creation and let agent creation attach to an existing workspace, so callers can split worktree setup from agent launch without reusing the caller workspace.

Keep worktreeSlug as the worktree path slug and add branchName for branch-off targets.
This commit is contained in:
Mohamed Boudra
2026-06-20 19:38:57 +07:00
parent 2c4e443ad7
commit 0718e7c914
7 changed files with 137 additions and 15 deletions
+4 -1
View File
@@ -59,7 +59,10 @@ Create the agent via Paseo with a `[Handoff] <task>` title, the briefing as init
Use `workspace` for placement:
- No worktree: `workspace: { kind: "current" }`.
- Worktree: `workspace: { kind: "create", source: { kind: "worktree", target: { kind: "branch-off", worktreeSlug: "<short-task-branch>" } } }`.
- Worktree: `workspace: { kind: "create", source: { kind: "worktree", target: { kind: "branch-off", worktreeSlug: "<short-task-slug>", branchName: "fix/<short-task-slug>" } } }`.
- Existing worktree already created by `create_worktree`: `workspace: { kind: "existing", workspaceId: "<returned-workspace-id>" }`.
Do not use `workspace: { kind: "current", cwd: "<worktreePath>" }` to place a handoff in a worktree; that keeps the agent in the caller's workspace with only a different runtime cwd.
Leave `notifyOnFinish` omitted unless the user explicitly wants no callback.