Commit 205e83e
committed
fix(agents): keep AGENTS.md tool-dispatch guidance inside small-budget head window
Codex review on PR #75248 noted that the prior reorder still left `## Tools`
starting at char ~1110 in the stripped template, outside the bootstrap
trimmer's effective ~1044-char head window at agents.defaults.bootstrapMaxChars=1500
(0.75 head ratio of contentBudget after marker reservation). The injected
content kept `Red Lines` and `External vs Internal` but dropped `Tools`
along with the tool-dispatch guidance, so the issue's small-model failure
mode would persist.
Restructure the workspace AGENTS.md template:
- Move `## Tools` directly after `## Session Startup` so its body appears
in the head window. Add an explicit `Tool dispatch:` rule (emit real
structured tool calls, fix args on error rather than repeating).
- Condense `## Session Startup` from a multi-list block into a single
paragraph, freeing room before `## Tools` without losing semantics.
- Split the secondary `Voice Storytelling` and `Platform Formatting`
bullets out into a new `## Tool Notes` section lower in the file. They
remain available in the full file but no longer crowd the head budget.
Section starts (post-frontmatter): First Run @72, Session Startup @220,
Tools @555, Red Lines @846, External vs Internal @1021. All four
load-bearing sections now sit inside the 1044-char head budget.
Add a regression in pi-embedded-helpers.buildbootstrapcontextfiles.test.ts
that runs the actual stripped template through buildBootstrapContextFiles
with maxChars=1500 and asserts the truncation marker fires and the injected
content contains `## Tools`, `Tool dispatch:`, `## Red Lines`, and
`## External vs Internal`. This covers the real bootstrap injection path
the prior section-order tests did not exercise.
Refs #751871 parent b5bdfd1 commit 205e83e
2 files changed
Lines changed: 42 additions & 22 deletions
File tree
- docs/reference/templates
- src/agents
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | | - | |
| 22 | + | |
27 | 23 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 24 | + | |
31 | 25 | | |
32 | 26 | | |
33 | 27 | | |
| |||
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 47 | | |
66 | 48 | | |
67 | 49 | | |
| |||
137 | 119 | | |
138 | 120 | | |
139 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
140 | 132 | | |
141 | 133 | | |
142 | 134 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
193 | 221 | | |
194 | 222 | | |
195 | 223 | | |
| |||
0 commit comments