Repository navigation
[PR] fix(guardrails): preserve multimodal tool output order - #6581
Merged
ranxianglei merged 1 commit intoNov 14, 2026
Merged
Conversation
Owner
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6580 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
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.
Fixes #6580
Problem
The shared pi/omp tool-result guardrail moves every image/resource ahead of all text whenever the default 50,000-byte text cap is exceeded. A result containing caption/image/caption/image becomes image/image/one text block, changing which description precedes each image and discarding text-part metadata.
Change
Map the existing UTF-8-safe combined text prefix back onto the original text parts, retaining non-text blocks in place and copying metadata for retained text. Append one truncation notice to the final retained text part (or the first text position when the byte budget cannot fit one character).
The shared text budget, complete-line preference, full-output path notice, default settings and disabled/pass-through behavior stay the same. This affects host tool results in pi/omp; proxy-mode message rewriting and the kernel are outside the changed path.
Verification
Duplicate screening is recorded in the issue. No new configuration or persistence format.