rowboat/apps/x/packages/core
Ramnique Singh b62ed6a2f4 feat(x): spawn-agent — run sub-agents as headless child turns
Adds the agent-as-tool capability deferred in turn-runtime-design §29.2:
a `spawn-agent` builtin that runs a sub-agent in its own standalone
headless turn and returns its final answer to the parent. Multiple
spawn calls in one assistant batch run concurrently (previous commit).

- RequestedAgent is now a union: by-id (unchanged shape) | inline
  {name, instructions, model?, tools?}. Inline definitions persist
  verbatim in turn_created and resolve to the same immutable snapshot.
- Agent resolution splits by variant: DispatchingAgentResolver narrows
  the union once; InlineAgentResolver materializes inline specs
  (builtin catalog validation, headless default profile when tools are
  omitted); RealAgentResolver keeps the by-id path byte-identical. The
  builtin→ToolDescriptor conversion is extracted to a shared helper.
- The spawn handler (RealToolRegistry branch → runSpawnedAgent) runs
  the child via HeadlessAgentRunner on the parent's model by default,
  clamps the model-call budget at 20, cascades the parent's abort
  signal, and records {kind:"subagent", childTurnId} as durable tool
  progress — the only parent→child link; no parentTurnId is added to
  the schema. Task-level failures return as conversational isError
  results, never terminal.
- Depth is capped at 1: both resolvers strip spawn-agent from children
  (inline always; by-id via the new subagent composition flag) and the
  handler refuses child-shaped parents outright.
- Renderer: spawn-agent calls render as a SubAgentBlock — a collapsed
  status card that expands to the child's live transcript
  (CompactConversation over sessions:getTurn, polled at 1s while
  running; standalone child turns don't reach the session bus).
- The BuiltinTools entry gives copilot (and other catalog-attached
  agents) the tool automatically; its execute is the degraded legacy
  path only, since the turn runtime intercepts builtin:spawn-agent.

Schema note: RequestedAgent widened under schemaVersion 1 (pre-release)
— requires wiping ~/.rowboat/storage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 23:31:41 +05:30
..
docs feat(x): spawn-agent — run sub-agents as headless child turns 2026-07-08 23:31:41 +05:30
scripts Code mode: make packaged builds work via managed engine provisioning (#625) 2026-06-17 21:53:15 +05:30
src feat(x): spawn-agent — run sub-agents as headless child turns 2026-07-08 23:31:41 +05:30
.gitignore bootstrap new electron app 2026-01-16 12:05:33 +05:30
package.json feat(apps): M3 groundwork — packager, GitHub device-flow auth, registry client 2026-07-06 14:49:52 +05:30
tsconfig.build.json Refactor builtin file tools beyond workspace scope 2026-05-25 16:21:51 +05:30
tsconfig.json feat: extract presentation generator into executable code with builtin tool 2026-01-30 13:30:06 +05:30
vitest.config.ts Refactor builtin file tools beyond workspace scope 2026-05-25 16:21:51 +05:30