Skip to content

Add per-director prompt size budgets assembled per family - #931

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7664-add-a-prompt-size-budget-test-and-per-family-assembled
Sep 12, 2026
Merged

Add per-director prompt size budgets assembled per family#931
TheGreatAxios merged 2 commits into
mainfrom
cl-7664-add-a-prompt-size-budget-test-and-per-family-assembled

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Implements CL-7664.

New measurement helper assembles each director prompt exactly as src/subagent/run.ts does (director extension + tools + context + appendix, Grok finish-bias note gated by shouldApplyGrokAntiThrash), pinned to a documented canonical fixture so sizes never drift with machine or date. New budget test asserts numeric char/byte ceilings per director and family — copy edits cannot fail it; over-budget growth must trim or consciously raise the budget with justification. No prompt text snapshots, no prompt trimming, no prompt-contract.ts changes, no latency code.

Findings

Initial size table (chars / bytes, canonical fixture):

director default chars (bytes) grok chars (bytes)
skywalker 25907 (26063) 25907 (26063)
builder 46394 (46544) 46910 (47062)
explorer 11660 (11720) 12176 (12238)
counsel 50209 (50379) 50725 (50897)
intern 14248 (14296) 14764 (14814)
critic 51842 (52014) 52358 (52532)
greybeard 52293 (52481) 52293 (52481)
neckbeard 69743 (69929) 70259 (70447)
bruckheimer 20786 (20880) 21302 (21398)
gaasbot 29213 (29311) 29729 (29829)
draper 12614 (12688) 13130 (13206)
emil 14116 (14226) 14632 (14744)
rand 12534 (12600) 13050 (13118)
shakespeare 52287 (52467) 52803 (52985)
testsmith 13656 (13730) 14172 (14248)
tester 11438 (11494) 11954 (12012)

Grok delta is +516 chars on leaves (finish-bias note), zero on orchestrators (skywalker, greybeard) where the note is withheld. Budgets pin measured grok size +2000 chars / +3000 bytes headroom.

Verification (all in the cl-7664 worktree):

  • related suites green: bun test prompt-sizes/prompts/tool-sets/provider-family — 47 pass, 0 fail, exit 0
  • bun run lint — exit 0; bun run typecheck — exit 0; bun run build — exit 0
  • bun run check:projects-dir-guard — exit 0, full suite 0 fail / 6984 tests
  • Note: a later single-invocation bun run check could not complete — shared host disk hit 100% (ENOSPC, operator caches outside this change); unrelated failures were all tmpdir mkdtemp errors. Re-run check once disk is reclaimed.

Do not merge — leaving review to the parent.

Assembled sizes drift silently as prompts grow; a numeric budget per director and model family catches bloat in CI while leaving copy edits free to land.
@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

CL-7664

The helper re-listed allowlist names, so measured prompts exceeded
production mounts: fleet verbs counted twice on orchestrators, list_dir
counted though never mounted, and Codex proxies counted on non-Codex
families. Build the list from the shared mount sources filtered by the
same packageToCapabilities run.ts dispatches with.
@TheGreatAxios
TheGreatAxios enabled auto-merge (squash) September 12, 2026 17:15
@TheGreatAxios
TheGreatAxios merged commit b42c233 into main Sep 12, 2026
9 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.

1 participant