@mindfoldhq/trellis 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.5.6",
|
|
3
|
+
"description": "Patch: Codex multi_agent_v2 spawn-loop guidance — fork_turns=\"none\" + completion close-loop algorithm.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Bug Fixes:**\n- fix(agents): document `fork_turns=\"none\"` requirement on Codex `spawn_agent` calls (#240 follow-up). 0.5.5 removed the SessionStart injection vector that hijacked sub-agent sessions, but [Marsor707's local verification](https://github.com/mindfold-ai/Trellis/issues/240#issuecomment-4393264022) showed a second vector remained: with default `fork_turns=\"all\"`, the child inherits the parent transcript and sees prior `spawn_agent(...)` records, then applies the \"wait for spawned subagents\" rule to itself — `wait_agent` self-deadlock. `markdown/agents.md` now documents the rule under a new \"Codex-only — `spawn_agent` parameters\" subsection.\n- fix(agents): document multi-subagent close-loop algorithm (#241). The existing rule \"ALWAYS wait for every spawned subagent to reach a terminal status\" was ambiguous — LLMs read it as \"received completed → wait again\" instead of \"received completed → `list_agents` / verify deliverables / `close_agent` / remove from expected set / wait only on still-running\". `markdown/agents.md` now has a \"Codex-only — multi-subagent close-loop\" subsection with the deterministic algorithm proposed in the issue.\n\nBoth changes are prompt-layer-only — no script / hook / configurator behavior changed.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "Patch on top of 0.5.5. Run `trellis update` (no `--migrate` needed). Updates `AGENTS.md` only — Codex users get clearer multi_agent_v2 guidance; other platforms see the new subsections labeled `Codex-only` and can ignore them."
|
|
9
|
+
}
|
|
@@ -27,6 +27,31 @@ If you're using Codex or another agent-capable tool, additional project-scoped h
|
|
|
27
27
|
- Long-running or blocking tasks where a worker can run independently
|
|
28
28
|
- Isolation for risky changes or checks
|
|
29
29
|
|
|
30
|
+
### Codex-only — `spawn_agent` parameters
|
|
31
|
+
|
|
32
|
+
When calling `spawn_agent`, ALWAYS pass `fork_turns="none"`. Without it the child inherits the parent transcript and sees your prior `spawn_agent(...)` records, then applies the "wait for spawned subagents" rule to itself — causing `wait_agent` self-deadlock.
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
spawn_agent(agent_type="trellis-implement", message="...", fork_turns="none")
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Codex-only — multi-subagent close-loop
|
|
39
|
+
|
|
40
|
+
When `wait` returns a `completed` notification, treat it as an event signal — not as "all done". Run this loop:
|
|
41
|
+
|
|
42
|
+
1. Maintain an `expected_agents` set of dispatched sub-agent thread IDs.
|
|
43
|
+
2. After each `wait` update:
|
|
44
|
+
1. Call `list_agents` to inspect ALL live agents' status.
|
|
45
|
+
2. For each agent now in a terminal state:
|
|
46
|
+
- Verify its promised deliverable exists (e.g. `{task_dir}/research/*.md`).
|
|
47
|
+
- Read or summarize as needed.
|
|
48
|
+
- `close_agent` to release the slot.
|
|
49
|
+
- Remove from `expected_agents`.
|
|
50
|
+
3. If `expected_agents` still contains running agents → keep waiting.
|
|
51
|
+
4. If `expected_agents` is empty → continue main flow.
|
|
52
|
+
3. Never `wait` on an agent that has already reported `completed`.
|
|
53
|
+
4. If a `completed` agent is missing its deliverable, treat it as failed — surface that in your report instead of re-waiting.
|
|
54
|
+
|
|
30
55
|
Managed by Trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `trellis update`.
|
|
31
56
|
|
|
32
57
|
<!-- TRELLIS:END -->
|
package/package.json
CHANGED