Repository navigation
feat(harness): make read_file page maximum configurable - #3985
Merged
jujn merged 2 commits intoNov 5, 2026
Merged
Conversation
Add a builder setting and compatible FilesystemTool constructor for the read_file page maximum while retaining the 16000/32000 defaults. Propagate the setting to automatically constructed subagents and cover configuration validation and Unicode-safe pagination with behavior tests. Update the English and Chinese filesystem documentation. Closes agentscope-ai#3984.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
|
jujn
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.1.0-SNAPSHOT, based on commit3ed55c5701be625dfcc8200ac5f45d55652713d7.Description
Closes #3984.
Summary
After #3821, a
read_filecall requesting 64,000 Unicode code points is always clamped to 32,000. Applications with larger context budgets cannot adjust that maximum through the Harness builder.Add
HarnessAgent.Builder.readFileMaxChars(int)and a matchingFilesystemToolconstructor. The maximum defaults to 32,000 and must be at least 16,000. A tool call omittingmax_charsstill reads 16,000; requests above the configured maximum are paginated as before. Automatically constructed general-purpose and declared subagents inherit the setting. Existing constructors, Unicode-safe continuation, and line selection remain compatible. Update the tool description and English/Chinese filesystem documentation.Evidence
max_chars=64000is clamped to the fixed 32,000-code-point maximum.After: configuring
.readFileMaxChars(64_000)permits a 64,000-code-point page. Behavior tests exercise the registered tool on the parent and both built-in subagent types.clean verify: passed, including Spotless. Surefire XML reports contain 11,935 tests, 248 skipped, no failures or errors. Run with JBR 21.0.11 and Maven 3.9.16; Java source/target remains 17.Commands run from the repository root, using a separate local revision for build artifacts:
mvn -B -T1C -pl agentscope-harness -am test -Drevision=2026.11.05-read-file-max-chars-SNAPSHOT -Dtest=BoundedFileReadTest,FilesystemToolTest,HarnessAgentTest mvn -B -T1C clean verify -Drevision=2026.11.05-read-file-max-chars-SNAPSHOTDocumentation checks from
docs/:npm testpassed (13 tests), the local syntax/navigation/link/asset check passed (432 pages and 584 redirects), andnpm run broken-linkspassed.npm run validatereached Mint's strict build validation but failed insidep-cancelablewithThe onCancel handler was attached after the promise settledon Node 24.22.1. A Node 22 recheck could not run because downloading that runtime timed out. The strict docs validation gap remains explicit for CI/review.Merge Danger
Door: Two-way. Additive configuration and constructor support; no persisted-state changes.
Blast Radius: Harness. File read output limits on agents that configure the new setting and their automatically constructed subagents.
Checklist
mvn spotless:applymvn test)