
Request lifecycle
bash short-circuits any npm run dev the model tries to issue.
Two project types
Project type is locked at session creation — it picks the sandbox template image, the system prompt variant, and which tools are registered.
Hard rules (load-bearing — don’t “simplify”)
- One while loop, one agent. The build loop is a single agent, not a swarm — parallel tool calls go through
Promise.all. The one delegation that exists is bounded and read-only:spawn_subagenthands an investigation to up to four research agents that cannot write. See Subagents. - Stream everything — tool-call start, file write chunks, thinking, status.
ask_userstores aresolveand fires when the frontend POSTs/vibe/answer.- Route to a larger-context model at 75 %, compact at 90 %. Compacting earlier thrashes memory; later trips provider context-overflow rejections.
.mana/memory.mdsurvives compaction — it lives on disk in the sandbox.- 3-attempt cap per error in self-heal. Past that, the error surfaces.
- No placeholder text. Real content only.
- Templates come from GitHub via
git clone --depth 1. - Dev server is started by the orchestrator, not the agent.
bashshort-circuitsnpm run dev. toolCalls.clear()fires onfinish_reasonof"tool_calls"OR"stop"— some providers send tool calls withstop.- Failover only activates for the default provider. Explicitly chosen models are not silently swapped on failure.