Two prompt-layer follow-ups for CodexDocumentation Index
Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt
Use this file to discover all available pages before exploring further.
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:
WithoutDefault Codex behavior isfork_turns="none", the child can see the parent’s ownspawn_agent(...)records and then apply the Trellis/AGENTS “wait for spawned subagents” rule to itself, causing a self-wait such aswait_agent({"timeout_ms":480000}).
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:
- Maintain
expected_agentsset. - After each
waitupdate:list_agents, verify deliverables for terminal agents,close_agent, remove from set. - Continue waiting only if
expected_agentsstill has running agents. - Never
waiton an agent already reportedcompleted.
Upgrade
AGENTS.md gets two new subsections under ## Subagents. Other platforms see the Codex-only labels and can skip those subsections.