Background
`apps/main/src/routes/agents.ts:128` rejects `multiagent.agents` entries of `{type:"self"}` with 422:
"multiagent.agents: \"type\":\"self\" is not yet supported"
AMA allows `{type:"self"}` as a sentinel meaning "the agent that owns this configuration" — used for recursive self-invocation. It needs the parent agent's id, which we don't have at create time before the row is inserted.
Work
Two-pass insert:
- Generate the new agent's id up-front (already done via `ids.agentId()`)
- Resolve any `{type:"self"}` entries in `callable_agents` to `{type:"agent", id: , version: 1}` before passing to store
Same pattern works for update — substitute existing id.
Limit: at most one `self` per roster (per AMA spec).
Why deferred from #PR
Small change but its own logical slice; this PR's multiagent work focuses on the wire transform.
References
`apps/main/src/routes/agents.ts:123-163` (multiagentToCallableAgents helper)
Background
`apps/main/src/routes/agents.ts:128` rejects `multiagent.agents` entries of `{type:"self"}` with 422:
AMA allows `{type:"self"}` as a sentinel meaning "the agent that owns this configuration" — used for recursive self-invocation. It needs the parent agent's id, which we don't have at create time before the row is inserted.
Work
Two-pass insert:
Same pattern works for update — substitute existing id.
Limit: at most one `self` per roster (per AMA spec).
Why deferred from #PR
Small change but its own logical slice; this PR's multiagent work focuses on the wire transform.
References
`apps/main/src/routes/agents.ts:123-163` (multiagentToCallableAgents helper)