Repository navigation
fix(agents): retain images within tool-result context limits - #120808
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
August 9, 2026 01:30
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 9, 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.
Summary
When a native image-tool result exceeded its existing context budget, the private result guard discarded every image while retaining text claiming the images had been loaded. This produced a misleading successful tool result and prevented the assistant from seeing images that actually fit within the unchanged budget.
Project the existing sanitized result into the same fixed context allowance: retain the stable prefix of images that truly fits, budget text and unknown content with the existing estimator, and report omitted images truthfully. Smaller windows that cannot fit an image now explain that accurately; larger windows retain the largest safe ordered prefix.
The existing per-image estimate, context share, minimum cap, privacy sanitization, provider behavior, and original result all remain unchanged. The production increase represents a new bounded mixed-image projection capability, with explicit coverage for CJK text, multiple text blocks, Unicode safety, unknown blocks, metadata, and immutable originals.
Verification