subagents

command
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Example: subagents demonstrates context-isolated delegation (WC-A-003). A parent agent delegates a research sub-task to a subagent with spawn_subagent. The subagent works in its OWN fresh conversation and returns only its final result — its intermediate reasoning never enters the parent's context window.

A single deterministic mock model.Provider drives both roles (subagents inherit the parent's model), routing on the system prompt, so the example runs with NO API keys and NO network:

parent turn 0: delegate "research Go's history" via spawn_subagent
  subagent:    (fresh context) produce a one-line finding
parent turn 1: answer using only the returned finding

go run ./examples/subagents/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL