Agents: raise bootstrap total cap and warn on /context truncation#18229
Agents: raise bootstrap total cap and warn on /context truncation#18229gumadeiras merged 1 commit intomainfrom
Conversation
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
There was a problem hiding this comment.
Pull request overview
This PR raises the default bootstrap total character limit from 24,000 to 150,000 to better accommodate real-world bootstrap setups. It improves visibility of truncation by enhancing the /context command to show both per-file and total limits, and adds explicit warnings when files are truncated.
Changes:
- Increased default total bootstrap cap from 24k to 150k chars (per-file cap remains 20k)
- Enhanced truncation detection to compare injected vs raw chars instead of checking against limits
- Added bootstrap total limit display and truncation warnings to
/contextoutput
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/config/types.agent-defaults.ts | Updated comment documenting new default (150000) |
| src/config/sessions/types.ts | Added bootstrapTotalMaxChars field to system prompt report type |
| src/config/schema.help.ts | Updated help text with new default value |
| src/auto-reply/reply/commands-context-report.ts | Added total limit display and truncation warning logic to /context command |
| src/auto-reply/reply/commands-context-report.test.ts | Added tests for truncation warning display |
| src/agents/system-prompt-report.ts | Improved truncation detection and added bootstrapTotalMaxChars to report |
| src/agents/system-prompt-report.test.ts | Added tests for improved truncation detection |
| src/agents/pi-embedded-runner/run/attempt.ts | Added bootstrapTotalMaxChars to system prompt report building |
| src/agents/pi-embedded-helpers/bootstrap.ts | Updated default constant to 150,000 |
| src/agents/pi-embedded-helpers.buildbootstrapcontextfiles.e2e.test.ts | Updated and added tests for new default and explicit total cap enforcement |
| docs/reference/token-use.md | Updated documentation with new default value |
| docs/gateway/configuration-reference.md | Updated configuration reference with new default and example |
| docs/concepts/system-prompt.md | Updated documentation with new default value |
| docs/concepts/context.md | Updated documentation with new default value |
| docs/concepts/agent-workspace.md | Updated documentation to mention both limit configuration options |
| CHANGELOG.md | Added entry describing the changes |
17d98ac to
f662052
Compare
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
|
Merged via squash. Thanks @gumadeiras! |
…enclaw#18229) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f662052 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
…enclaw#18229) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f662052 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
Summary
24,000to150,000chars while keeping the per-file cap at20,000.bootstrapTotalMaxCharsand detect truncation from injected-vs-raw chars./contextoutput to show both max/file and max/total, and add an explicit warning when bootstrap files are truncated due to configured limits.Why
Scope
/contextcommand output and warning UXVerification
pnpm checkpnpm vitest run src/agents/system-prompt-report.test.tspnpm vitest run --config vitest.e2e.config.ts src/agents/pi-embedded-helpers.buildbootstrapcontextfiles.e2e.test.tspnpm vitest run src/auto-reply/reply/commands-context-report.test.tsGreptile Summary
Raises the default
bootstrapTotalMaxCharsfrom 24,000 to 150,000 chars to reduce unintended truncation of bootstrap context files while keeping the per-file limit at 20,000 chars. Improves observability by:bootstrapTotalMaxCharsto system prompt reports and/contextcommand output/contextwhen bootstrap files are truncated, with clear causes (per-file overflow vs total overflow)The implementation is consistent across:
src/agents/pi-embedded-helpers/bootstrap.ts:86)src/agents/system-prompt-report.ts:59,121)src/auto-reply/reply/commands-context-report.ts:65,176,263-287)Confidence Score: 5/5
Last reviewed commit: 17d98ac