Skip to content

fix(sdk): preserve wrapped lines across read_file pagination#2648

Closed
Ryanba (Gujiassh) wants to merge 1 commit intolangchain-ai:mainfrom
Gujiassh:fix/read-file-pagination-wrap
Closed

fix(sdk): preserve wrapped lines across read_file pagination#2648
Ryanba (Gujiassh) wants to merge 1 commit intolangchain-ai:mainfrom
Gujiassh:fix/read-file-pagination-wrap

Conversation

@Gujiassh
Copy link
Copy Markdown

Summary

  • preserve lines that appear after a very long wrapped line when paginating read_file output
  • apply token-limit truncation after line-number formatting without reapplying line-count pagination truncation
  • add a regression test that reads the second page of a file after a wrapped long line and confirms later content is still present

Validation

  • cd libs/deepagents && uv run --group test pytest tests/unit_tests/test_file_system_tools.py -q

AI disclosure

  • this change was prepared with AI assistance and manually verified with the targeted unit test above

Avoid reapplying the line limit after formatting wrapped read_file output so paginated reads do not skip logical lines that follow a very long wrapped line.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actions github-actions bot added deepagents Related to the `deepagents` SDK / agent harness fix A bug fix (PATCH) size: S 50-199 LOC labels Apr 10, 2026
@org-membership-reviewer org-membership-reviewer bot added new-contributor First-time contributor to this repo external User is not a member of the `langchain-ai` GitHub organization labels Apr 10, 2026
@github-actions github-actions bot added the missing-issue-link PR missing a linked issue label Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically closed because it does not link to an approved issue.

All external contributions must reference an approved issue or discussion. Please:

  1. Find or open an issue describing the change
  2. Wait for a maintainer to approve and assign you
  3. Add Fixes #<issue_number>, Closes #<issue_number>, or Resolves #<issue_number> to your PR description and the PR will be reopened automatically

Maintainers: reopen this PR or remove the missing-issue-link label to bypass this check.

@github-actions github-actions bot closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepagents Related to the `deepagents` SDK / agent harness external User is not a member of the `langchain-ai` GitHub organization fix A bug fix (PATCH) missing-issue-link PR missing a linked issue new-contributor First-time contributor to this repo size: S 50-199 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant