Skip to content

Document agent.maxToolResultBytes and how the agent recovers when a conversation outgrows the model's context window - #720

Merged
Ethan-Arrowood merged 9 commits into
mainfrom
david/agent-tool-result-cap
Oct 13, 2026
Merged

Ethan-Arrowood merged 9 commits into
mainfrom
david/agent-tool-result-cap

Conversation

@DavidCockerill

@DavidCockerill DavidCockerill commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

⊙ Problem

The built-in agent no longer stores tool results in full, pages read_file, and retries once when a conversation outgrows the model's context window. None of that is documented, including the new agent.maxToolResultBytes setting (Cap the agent's tool results and page its file reads, so one large read no longer ends the session (harper#3117), for agent: no cap on tool-result size — one large read kills the session (harper#3068)).

❓ Your call: badged v5.4.0 to match Document agent.maxTokens, and that a cut-off or empty agent reply ends the run error (#712); it follows the code PR's milestone if that changes.

Refs HarperFast/harper#3068

💡 Solution

❓ Your call: whichever of this PR and #712 merges second keeps both new keys in the three lists and a single ## Built-in Agent heading in the 5.4 notes.

✅ Verification

Two cross-model review rounds (Codex + Gemini + Harper adjudication) checked every claim against the code PR. They caught overclaims about paging and recovery, which are corrected here, and a page-budget gap that is fixed in the code PR. prettier --check passes on the changed files.

🤖 Generated by Claude (Anthropic); posted via @DavidCockerill.

Related PRs: #671 independent, #676 independent, #683 independent, #691 independent, #697 independent, #709 overlaps (5.4 release notes; rebase conflict only), #712 overlaps (same agent option list, set_agent_config key lists and 5.4 Built-in Agent heading), #713 independent, #710 independent, #707 independent, #714 independent, #722 independent, #724 independent, #725 independent, #727 overlaps (same agent option list, set_agent_config lists and 5.4 Built-in Agent notes), #729 independent, #717 overlaps (merged; this branch edits its key-material sentence for paged reads), #728 independent, #715 independent
Complexity: easy

Review-Coverage: authored=claude; ran=gemini,codex; adjudicated=domain; blocked=cursor-composer(not-installed); declined=cursor-grok,cursor-kimi,cursor-muse; rounds=3; full=2 @ 902c970

Review-Attention: skim ~2m (decisions: cursor-guarantee-fix-layer, pem-claim-wording) @ 902c970

DavidCockerill and others added 5 commits October 6, 2026 16:42
…onversation outgrows the model's context window

Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…han a page

Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ase-note heading overpromising

Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation and release notes for version 5.4.0 to introduce the maxToolResultBytes configuration option, which caps and pages agent tool results to prevent conversations from exceeding the model's context window. The review feedback suggests improving the phrasing of how tool results are cut for better readability and adding a version badge to the set_agent_config section to properly document the API change.

Comment thread reference/operations-api/operations.md Outdated
Comment thread reference/operations-api/operations.md Outdated
@github-actions
github-actions Bot temporarily deployed to pr-720 October 8, 2026 16:26 Inactive
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-720

This preview will update automatically when you push new commits.

… KiB cut

Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-720

This preview will update automatically when you push new commits.

@github-actions
github-actions Bot temporarily deployed to pr-720 October 8, 2026 19:11 Inactive
@DavidCockerill
DavidCockerill marked this pull request as ready for review October 8, 2026 19:32
@DavidCockerill
DavidCockerill requested a review from a team as a code owner October 8, 2026 19:32
DavidCockerill and others added 2 commits October 13, 2026 16:04
Keeps agent.maxTokens (#712) beside agent.maxToolResultBytes in the agent
option list, the runtime-config lists and set_agent_config, and one Built-in
Agent heading in the 5.4 notes. The Filesystem scopes key-material rule now
says read_file refuses a page that holds a PEM key or starts inside one,
since read_file returns pages rather than whole files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll short

Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pr-720 October 13, 2026 20:15 Inactive
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-720

This preview will update automatically when you push new commits.

Refs HarperFast/harper#3068

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pr-720 October 13, 2026 20:23 Inactive
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-720

This preview will update automatically when you push new commits.

@Ethan-Arrowood
Ethan-Arrowood merged commit b808dcd into main Oct 13, 2026
14 checks passed
@Ethan-Arrowood
Ethan-Arrowood deleted the david/agent-tool-result-cap branch October 13, 2026 20:40
@github-actions

Copy link
Copy Markdown

🧹 Preview Cleanup

The preview deployment for this PR has been removed.

This branch was previously deployed

1 inactive deployment
pr-720 — 902c970d Deployed Oct 13, 2026 by github-actions[bot]
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.

2 participants