Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Keep the subagent tool description under the catalog byte cap

Cursor Agente5e18d327581
diff --git a/src/schema_agents.zig b/src/schema_agents.zig
index 83121101..6cc4ef5b 100644
--- a/src/schema_agents.zig
+++ b/src/schema_agents.zig
@@ -3,7 +3,7 @@ const ToolSpec = @import("schema.zig").ToolSpec;
pub const subagent_spec = ToolSpec{
.name = "subagent",
- .desc = "Delegate a self-contained sidecar task; children have file, shell, codedb and skill tools, no parent context, and cannot spawn children. Brief once in this order: context (repo and hard constraints), prompt (numbered steps), established_facts, scope, deliverable. Empty fields are omitted; a bare prompt is unchanged. The harness prepends environment (cwd, instructions file, disabled tools, pre_tool hooks). Interactive REPL calls return an id and release the prompt; completion wakes the parent. Headless calls return the report unless run_in_background=true. Call several times for disjoint parallel slices. Keep the critical-path next step local. Prefer code changes with disjoint write sets. Do not set model without a user request or task-specific reason. agent selects a persona; system_prompt overrides it. Use agent_message for feedback and agent_output for results. Do not poll; headless agent_output(wait_ms>0) waits for completion.",
+ .desc = "Delegate a self-contained sidecar task; children have file, shell, codedb and skill tools, no parent context, and cannot spawn children. Brief once: context, prompt, established_facts, scope, deliverable (omit empty; bare prompt unchanged). Harness prepends cwd, instructions file, disabled tools, hooks. Interactive REPL calls return an id and release the prompt; completion wakes the parent. Headless calls return the report unless run_in_background=true. Call several times for disjoint parallel slices. Keep the critical-path next step local. Prefer code changes with disjoint write sets. Do not set model without a user request or task-specific reason. agent selects a persona; system_prompt overrides it. Use agent_message for feedback and agent_output for results. Do not poll; headless agent_output(wait_ms>0) waits for completion.",
.schema =
\\{"type": "object", "properties": {"description": {"type": "string", "description": "Short label for logs, 3-5 words"}, "prompt": {"type": "string", "description": "Numbered steps and search hints; the complete task. Optional context/established_facts/scope/deliverable render as headed sections around this"}, "context": {"type": "string", "description": "Optional: repo and hard constraints the child must not re-derive"}, "established_facts": {"type": "string", "description": "Optional: observed facts, paths, and line numbers the child must treat as given"}, "scope": {"type": "string", "description": "Optional: what not to touch or broaden into"}, "deliverable": {"type": "string", "description": "Optional: required report shape; default is files changed, verified, skipped, open questions"}, "agent": {"type": "string", "description": "Optional: a named agent type (reviewer, researcher, implementer, skeptic, or a .harness/agents/ name) whose persona the child runs with"}, "system_prompt": {"type": "string", "description": "Optional: replace the child's system prompt with a custom one (overrides agent)"}, "model": {"type": "string", "description": "Optional: run THIS child on an exact model name available on the current provider (e.g. \"gpt-5.6-luna\"). Highest precedence — beats the persona's own pin and the session default. Ignored (spawn still runs on the session default, with a trace note) if the name is unknown, ambiguous, or not served by this provider — except that a logged-in flat-rate subscription serving the exact name honors it (sub-first routing; the login is the standing consent). For a portable 'cheapest seat' ask, tier is still the better lever."}, "tier": {"type": "string", "enum": ["frontier", "mid", "small"], "description": "Optional: run THIS child on a rung of the current provider's model ladder instead of an exact name — frontier (planner/judge class), mid (reviewers, implementers, researchers), small (mechanical transform/extract/label). Prefer this over model: it stays correct when the root model changes. If the provider has no ladder or no model at that rung, sub-first routing seats the child on a logged-in flat-rate subscription's rung when one exists (no login → the pin is ignored); model wins if both are given."}, "effort": {"type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "description": "Optional: reasoning effort for THIS child — beats the persona's effort: frontmatter; unpinned children run at medium. An axis independent of model/tier: an effort-only override keeps the persona's model pin. An off-vocabulary value is ignored with a trace note."}, "isolation": {"type": "string", "enum": ["shared_cwd", "worktree"], "description": "Optional: independent / fan-out children default to \"worktree\" (own branch + checkout; auto-removed if clean with no unique commits, kept + reported otherwise). Use \"shared_cwd\" only for same-branch collaboration (review + fix, a pipeline). isolation_fallback:true is the only way a failed git worktree add may share the caller tree."}, "isolation_fallback": {"type": "boolean", "description": "Optional: if isolation:\"worktree\" fails to set up (not a git repo, git error), run in the shared working tree instead of failing the spawn. Default false (fails the spawn on setup failure)."}, "run_in_background": {"type": "boolean", "description": "Optional: start this subagent asynchronously and return its agent id immediately instead of waiting for it to finish (headless default false; interactive REPL always backgrounds direct subagents). Do not poll; headless agent_output(wait_ms>0) blocks until it finishes. A spawn at the live concurrency cap is refused; do not spawn a child to clean up a finished worktree."}}, "required": ["description", "prompt"]}
,