Skip to content

perf(subagents): bound the spawn tool schema - #85

Merged
tt-a1i merged 2 commits into
mainfrom
codex/issue-62-bounded-subagent-schema
Aug 23, 2026
Merged

perf(subagents): bound the spawn tool schema#85
tt-a1i merged 2 commits into
mainfrom
codex/issue-62-bounded-subagent-schema

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace the unbounded subagent_spawn role prose with a deterministic selection projection: role name, bounded purpose, capability class, and default effort
  • keep every effective role name in the strict dynamic enum, while moving full lifecycle and precedence guidance to the Subagents Skill
  • use one canonical model-facing spawn surface for runtime registration and budget tests
  • enforce UTF-8 byte budgets for each purpose, the role directory, the default roster, and a maximum legal 128-role roster

Closes #62.

Design research and peer comparison: #84.

Measured surface

Metric Before After Change
default subagent_spawn surface 3,909 bytes 2,472 bytes -36.8%
constructed maximum legal 128-role roster 241,423 bytes 14,029 bytes -94.2%
resident prompt guidelines 875 bytes 457 bytes -47.8%

All 128 role names remain valid enum values. The parent-facing role directory is capped at 4 KiB and reports omitted summaries without weakening runtime validation.

Representative model feature probe

One non-lockstep feature probe used seal/deepseek-v4-flash-0731-baidu with the same explicit read-only delegation prompt against base af950d5 and this branch.

  • both versions selected explorer and successfully called subagent_spawn
  • first-request input: 15,766 -> 15,345 (-421, -2.7%)
  • spawn-request input: 16,217 -> 15,800 (-417, -2.6%)
  • three recorded parent turns: 49,697 -> 48,604 total tokens (-1,093, -2.2%)

This is a feature probe, not a general quality benchmark. It establishes that the compressed projection preserved role selection in a representative model and reduced the request surface in the expected direction. An initial CLI allowlist attempt was invalid because the dynamic tool was not activated; it was aborted and excluded.

Validation

  • subagent-focused tests: 37/37
  • bun run check
  • Node tests: 814/814
  • Vitest: 30/30
  • git diff --check

The existing 12 Effect type warnings in extensions/file-search remain unchanged.

@tt-a1i
tt-a1i merged commit d58fb25 into main Aug 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slim subagent_spawn tool descriptions; move lifecycle guidance to the skill (progressive disclosure)

1 participant