8000
Skip to content

fix(sdk): disclose per-line clipping in large-result previews - #5564

Open
Mason Daugherty (mdrxy) wants to merge 1 commit into
mdrxy/sdk/preview-note-conditionalfrom
mdrxy/sdk/preview-note-clipped-lines
Open

fix(sdk): disclose per-line clipping in large-result previews#5564
Mason Daugherty (mdrxy) wants to merge 1 commit into
mdrxy/sdk/preview-note-conditionalfrom
mdrxy/sdk/preview-note-clipped-lines

Conversation

@mdrxy
Copy link
Copy Markdown
Member

Stacked on #5563.

When a previewed line exceeds the per-line character budget, the preview silently showed only its leading characters — presenting an excerpt as the whole result. Previews now add a disclosure when any displayed line is clipped, alongside (and independently of) the omitted-middle-lines marker explanation.


_create_content_preview clips each shown line to PREVIEW_LINE_CHAR_LIMIT and records whether any line was actually cut, surfacing it as a second ContentPreview flag alongside lines_omitted. The two flags track independent kinds of loss — a preview can omit middle lines, clip long displayed lines, both, or neither — so _preview_note reports each only when it occurred. A line exactly at the limit is not reported as clipped.

The capture-offload path in FilesystemMiddleware has no per-line budget (its losses are byte-based and disclosed in-band), so it passes lines_clipped=False explicitly rather than leaving the flag to be inferred.

@github-actions github-actions Bot added deepagents Related to the `deepagents` SDK / agent harness fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC labels Aug 18, 2026
@open-swe open-swe 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.

✅ Open SWE Review: No issues found

Open SWE reviewed this PR and found no potential bugs to report.

Open in WebView Open SWE trace

@mdrxy
Mason Daugherty (mdrxy) force-pushed the mdrxy/sdk/preview-note-clipped-lines branch from 80e57ca to d60d6ed Compare August 19, 2026 22:32
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 fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0