Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt

Use this file to discover all available pages before exploring further.

Two prompt-layer follow-ups for Codex multi_agent_v2. AGENTS.md documents the fork_turns="none" requirement on spawn_agent calls (#240 follow-up) and the deterministic close-loop algorithm for handling wait completion notifications (#241). No new migrations.

Bug Fixes

fork_turns="none" requirement (#240 follow-up)

v0.5.5 removed the SessionStart injection vector that hijacked sub-agent sessions. Marsor707’s local-verification comment on #240 showed a second vector remained:
Without fork_turns="none", the child can see the parent’s own spawn_agent(...) records and then apply the Trellis/AGENTS “wait for spawned subagents” rule to itself, causing a self-wait such as wait_agent({"timeout_ms":480000}).
Default Codex behavior is fork_turns="all" — the child inherits the parent transcript including prior spawn_agent tool calls, and re-applies the wait rule to itself. That’s another path to wait_agent self-deadlock independent of the SessionStart bug. packages/cli/src/templates/markdown/agents.md adds a ### Codex-only — \spawn_agent` parameterssubsection telling the main session to always passfork_turns=“none”. Prompt-layer only — Trellis doesn't interceptspawn_agent`.

Multi-subagent close-loop algorithm (#241)

The existing rule in AGENTS.md:
ALWAYS wait for every spawned subagent to reach a terminal status before yielding…
Was ambiguous. Reproduction from the issue: parent dispatched two trellis-research sub-agents; both completed and wrote {task_dir}/research/*.md; parent received completed notifications but kept calling wait_agent again instead of reading deliverables and closing. User-side appearance: stuck waiting. packages/cli/src/templates/markdown/agents.md adds a ### Codex-only — multi-subagent close-loop subsection with the deterministic algorithm proposed in the issue:
  1. Maintain expected_agents set.
  2. After each wait update: list_agents, verify deliverables for terminal agents, close_agent, remove from set.
  3. Continue waiting only if expected_agents still has running agents.
  4. Never wait on an agent already reported completed.
Both subsections are prompt-layer-only — no script, hook, or configurator behavior changed.

Upgrade

npm install -g @mindfoldhq/trellis@latest
trellis update
AGENTS.md gets two new subsections under ## Subagents. Other platforms see the Codex-only labels and can skip those subsections.