fix(opencode): respect configured read truncation limits for read tool#29896
Draft
wellescastro wants to merge 1 commit into
Draft
fix(opencode): respect configured read truncation limits for read tool#29896wellescastro wants to merge 1 commit into
wellescastro wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential related PRs found:
Note: PR #29896 (the current PR) appears in all searches, which is expected. The other results are unrelated. The main related PR is #28907, which deals with tool output truncation configuration—the feature that PR #29896 is now making the |
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.
Issue for this PR
Closes #29604 #25337
Type of change
What does this PR do?
The
readtool was still using hard-coded truncation defaults in places instead of the configuredtool_outputlimits. It also handled directory listings separately from the generic truncation wrapper, so directory reads could respect the line limit while ignoring the byte limit. This PR makesreaduseTruncate.Service.limits()for its default line and byte caps. File reads now use the configured byte limit, and directory reads apply both the configured line limit and byte limit before returning output. The truncation message now reflects the configured byte cap instead of a hard-coded value.How did you verify your code works?
Created new and run the existing read tool tests locally:
Screenshots / recordings
Not applicable, no UI changes.
Checklist