Repository navigation
fix: preserve bounded inline images during tool artifact sizing - #603
Closed
ldavis9000aws wants to merge 1 commit into
Closed
ldavis9000aws wants to merge 1 commit into
ldavis9000aws wants to merge 1 commit into
Conversation
This was referenced Oct 8, 2026
Author
|
Withdrawing and closing this PR without merging at the submitter's request. To avoid conflating findings: this PR concerns same-turn artifact sizing, where the structured traversal allowance can omit an otherwise permitted inline image. LibreChat's documented cross-turn image policy does not explain or invalidate that defect. The reproduction and focused tests remain valid, but we are withdrawing this upstream contribution. No claim of upstream resolution is made; local source and existing patches are retained. |
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.
Withdrawn by the submitter; not merged. This concerns a separately reproduced same-turn inline-image sizing defect, not the documented omission of tool-image pixels on later user turns. The technical reproduction and proposed bounded sizing correction remain valid. Local deployed patches, source branches and tests are retained; withdrawal does not undo them.
Large MCP image artifacts can disappear from the next model request even when maxToolResultChars is sufficient. A 2.48 MB PNG expands to approximately 3.3M base64 characters and exhausts the fixed 1M structured character traversal allowance during jsonStringLength; the resulting conservative size estimate makes artifact accumulation omit it.
Count bounded escape-free inline image data URIs directly. Keep configured tool-result limits, the existing 5M inline-image ceiling, context budgeting, and traversal protection for arbitrary/malformed content. Both provider projections use this shared size calculation.
Validation: focused toolContent Jest suite (60 passed), npx tsc --noEmit, scoped ESLint, diff check. Installed 4.0.1 patch integration (11 passed, both provider projections and ESM); actual LibreChat + Desktop Commander + LiteLLM requests contain PNG pixels and Claude accurately reads labels, compares two boards, repeats reads, and continues with a text tool. Synthetic unit payloads verify sizing, not visual interpretation. Runtime deployment remains on 4.0.1; no package upgrade is required for the reproduced fix.
Fixes #602. Related to ldavis9000aws/cf-fleetrebuild#55 and ldavis9000aws/CreatorFlow#47.