Repository navigation
Conversation
Retain ordered image and audio snapshots so warm sessions and rebuilt response chains preserve multimodal context on later turns.
Files:
- sdk_v2/cpp/src/inferencing/generative/chat/
- sdk_v2/cpp/src/inferencing/generative/openresponses/
- sdk_v2/cpp/src/inferencing/session/request.{cc,h}
- sdk_v2/cpp/src/service/responses_handler.cc
- sdk_v2/cpp/test/internal_api/ and sdk_v2/cpp/test/sdk_api/
- sdk_v2/INFERENCING.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ff6cebe1-eff5-44bd-a00b-71c047fed86c
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the multi-turn image history and replay changes.
No open issues 🎉
What changed in this PR
This PR enables multi-turn image conversations in the native SDK by retaining media in chat history and restoring it during Responses replay, including after local image files are deleted.
Changes:
- Preserve ordered image and audio snapshots and rebuild multimodal prompts from the complete conversation.
- Store private local-image snapshots for cold replay without changing public
input_items, while retaining media/tool restrictions. - Add coverage for image ordering, warm/cold replay, cancellation, undo, streaming, and deleted files; document updated limitations.
| File | Description |
|---|---|
sdk_v2/INFERENCING.md |
Documents multi-turn images and remaining limitations. |
sdk_v2/cpp/test/sdk_api/responses_vision_test.cc |
Tests multi-turn vision, replay, streaming, cancellation, and undo. |
sdk_v2/cpp/test/internal_api/web_service_test.cc |
Updates expected media-policy errors. |
sdk_v2/cpp/test/internal_api/response_lifecycle_test.cc |
Tests private snapshots through response-store lifecycle changes. |
sdk_v2/cpp/test/internal_api/chat/onnx_chat_generator_vision_test.cc |
Tests historical image markers, names, reasoning, and role validation. |
sdk_v2/cpp/test/internal_api/chat/media_input_test.cc |
Tests media continuation policy and ordered replay snapshots. |
sdk_v2/cpp/test/internal_api/chat/chat_transcript_test.cc |
Tests ordered media retention and snapshot ownership. |
sdk_v2/cpp/src/service/responses_handler.cc |
Publishes private replay snapshots for both response modes. |
sdk_v2/cpp/src/inferencing/session/request.h |
Clarifies local-file snapshot semantics. |
sdk_v2/cpp/src/inferencing/session/request.cc |
Recursively snapshots message parts and resolves image bytes. |
sdk_v2/cpp/src/inferencing/generative/openresponses/response_store.h |
Adds private replay data to stored responses. |
sdk_v2/cpp/src/inferencing/generative/openresponses/response_store.cc |
Preserves private snapshots in storage and replay hops. |
sdk_v2/cpp/src/inferencing/generative/openresponses/response_converter.h |
Declares the private image-snapshot helper. |
sdk_v2/cpp/src/inferencing/generative/openresponses/response_converter.cc |
Restores typed media and snapshots local images for replay. |
sdk_v2/cpp/src/inferencing/generative/openresponses/response_chain.h |
Adds a private input override to replay hops. |
sdk_v2/cpp/src/inferencing/generative/chat/prepared_chat_prompt.cc |
Passes reasoning-history support into media rendering. |
sdk_v2/cpp/src/inferencing/generative/chat/onnx_chat_generator.h |
Updates the multimodal transformation interface. |
sdk_v2/cpp/src/inferencing/generative/chat/onnx_chat_generator.cc |
Renders historical media while preserving names and optional reasoning. |
sdk_v2/cpp/src/inferencing/generative/chat/media_input.h |
Declares transcript media collection and revised validation helpers. |
sdk_v2/cpp/src/inferencing/generative/chat/media_input.cc |
Collects retained media and rejects incompatible tool activity. |
sdk_v2/cpp/src/inferencing/generative/chat/chat_transcript.h |
Defines ordered media entries with shared snapshot ownership. |
sdk_v2/cpp/src/inferencing/generative/chat/chat_transcript.cc |
Retains media during ingestion and recognizes media-bearing input. |
sdk_v2/cpp/src/inferencing/generative/chat/chat_session.h |
Documents media retention during undo. |
sdk_v2/cpp/src/inferencing/generative/chat/chat_session.cc |
Builds full-history media prompts and invalidates incompatible cached generators. |
Review effort: Balanced
This branch was successfully deployed
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
input_items.Validation
lintrunner -r HEADandgit diff --check.Limitations
Existing sanitizer note
The comments for the
OgaCreateStringArrayFromStringsandOrtxTensorResultGetAtentries inlsan.suppappear stale for the exercised ONNX Runtime GenAI 0.19.0/Qwen path: the wrapper owns the string array and the Qwen processor owns the returned tensors. The real-model sanitizer check above ran without these or any other LSan suppressions. The existing suppression file is unchanged.