feat: multi-work is able to delegate to root
CI / verify (pull_request) Successful in 9s

This commit is contained in:
2026-09-18 20:13:54 +02:00
parent 8b6836f5a4
commit 52e98c9d78
9 changed files with 376 additions and 88 deletions
+37 -13
View File
@@ -1,13 +1,15 @@
# Multi-work
`multi-work` is a **primary-only** agent for coordinating independent work in
Herdr-managed Git worktrees. Like `coordinate`, it uses the configured `deep-lo`
model and effort, falling back to `good-lo` when `deep-lo` is unavailable. No
extra custom model assignment is required.
the current Herdr root checkout or new Herdr-managed Git worktrees. Like
`coordinate`, it uses the configured `deep-lo` model and effort, falling back
to `good-lo` when `deep-lo` is unavailable. No extra custom model assignment is
required.
```text
multi-work (root checkout)
├── fast-lo (local retrieval)
├── coordinate (current root checkout)
└── coordinate (new Herdr worktree)
└── existing leaf workers (that worktree)
```
@@ -56,7 +58,24 @@ plugins or project configuration.
## Delegation
Multi-work retains the native tool name, `subagent`. It adds one argument:
Multi-work retains the native tool name, `subagent`. For work in the current root
checkout, omit `worktree`:
```js
subagent({
agent: "coordinate",
description: "Implement local change",
prompt: "Goal, owned files, constraints, and acceptance checks...",
background: true,
});
```
The child is bound to the verified root workspace before its prompt is admitted.
No Herdr workspace is created and neither the child nor parent is moved. Root-local
children share a checkout, so parallel assignments must have disjoint file ownership.
Their placement metadata uses `branch: "root"` to identify the shared root checkout;
it is not a claim about the root's current Git branch.
Use a worktree when edits may overlap or require branch isolation:
```js
subagent({
@@ -86,17 +105,22 @@ checkout path; the tool parses and verifies the returned checkout/workspace.
Creation explicitly preserves focus with `--no-focus`.
For focused retrieval, use native `subagent` with `agent: "fast-lo"` and no
`worktree`. Resume an owned coordinate child with its `sessionID` and **omit**
`worktree`. Resumes verify parent, agent, checkout, branch, and live Herdr ownership.
`worktree`. A new coordinate call without `worktree` means root-local work. Resume
an owned coordinate child with its `sessionID` and **omit**
`worktree`. Resumes verify parent, agent, assigned checkout, and live Herdr ownership;
worktree resumes also verify the branch.
Bound coordinate children cannot be repurposed through native delegation.
Neither multi-work nor coordinate has general shell/edit permissions. Multi-work
also rejects non-reading/non-delegation tools at execution, including Code Mode,
even if a session permission override would expose them. Worktree preparation
requires effective `herdr_worktree: allow`, evaluated against the canonical root
directory using ordered agent and session rules. `ask` fails explicitly because
the public plugin API cannot request custom-tool approval. Native subagent
permissions are still asserted by OpenCode before preparation starts.
even if a session permission override would expose them. Creating or resuming
worktree-backed delegation requires effective `herdr_worktree: allow`, evaluated
against the canonical root directory using ordered agent and session rules. `ask`
fails explicitly because the public plugin API cannot request custom-tool approval.
Native subagent permissions are still asserted by OpenCode before preparation
starts. Root-local delegation performs no Herdr creation and therefore does not
require `herdr_worktree`; worker edit/shell permissions remain inherited and
enforced normally.
Worktree permissions inherit the base plugin's **effective build-permission
snapshot**, including configuration applied after plugin transforms. Its existing
@@ -118,8 +142,8 @@ child ID, and confirm its actual session location before allowing the task promp
A move-request acknowledgement alone is insufficient. Confirmation is bounded to
30 seconds and remains interruptible. The parent session does not move.
Coordinate is child-capable only through an owned, ready worktree binding. Prompt
admission and model-context guards reject unbound or moved coordinate children.
Coordinate is child-capable only through an owned, ready multi-work binding. Prompt
admission and model-context guards reject unbound or relocated coordinate children.
Multi-work cannot be a child, and the existing workers remain leaves.
Normal delegation cards and child navigation recognize the retained `subagent`