Skip to content

fix: retain bounded tool images across later tool batches - #609

Draft
ldavis9000aws wants to merge 1 commit into
LibreChat-AI:mainfrom
ldavis9000aws:codex/tool-image-replay
Draft

ldavis9000aws wants to merge 1 commit into
LibreChat-AI:mainfrom
ldavis9000aws:codex/tool-image-replay

Conversation

@ldavis9000aws

Copy link
Copy Markdown

After an image-producing tool call, a later tool-call batch drops the earlier image from the next model request even though its artifact remains in graph state. OpenAI/Google artifact projection now replays validated URL-backed images from completed calls in the current user turn.

The current batch consumes the existing character budget first; earlier batches fill the remaining capacity newest-first and are emitted in chronological order. Replay preserves tool-source provenance, excludes orphan results and computer-call outputs, and leaves source messages unchanged. If context pressure prevents replay, the graph retries the latest batch alone before omitting artifact expansion, including final-format and fallback-provider checks.

Validation: 243 focused message/context tests and 205 tracing tests passed; TypeScript, scoped ESLint, import sorting, and the CJS/ESM/type build passed. Regression fixtures contain synthetic image content and generic read calls, including 20 preliminary tool batches, multiple images, bounded capacity, malformed and oversized inputs, serialization hooks, and preservation of the current image under context pressure.

Draft: managed-app live acceptance remains pending because MCP connection failures prevented a valid completed trial. No live vision acceptance or restored-session image rehydration is claimed. Large inline-image counting is an independent change in #603; this PR does not modify that repair or raise image allowances.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant