Repository navigation
fix: handle raw Gemini and OCI requests in ATIF export - #1486
Conversation
Signed-off-by: Bryan Bednarski <[email protected]>
Signed-off-by: Bryan Bednarski <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
WalkthroughRaw Gemini and OCI GENERIC requests now have provider-specific ATIF user-step projection and turn detection. Unit tests and documentation cover these rules. TLS validation also changes the mutability of its loaded PEM binding. ChangesRaw provider ATIF handling
TLS validation
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
Overview
Fix raw Gemini and OCI GENERIC request handling in ATIF export. Native multimodal requests now produce readable user-step text, and raw Gemini tool responses continue the existing turn without creating a spurious user step.
The complete provider request, including image bytes and file references, remains in
extra.llm_request. Display projection does not change the request sent to downstream model callbacks or the image-sensitive request signature.Details
Raw provider display
contents[].parts, including the default user role whenroleis omitted. Join top-level text with newlines; exclude thought parts and nested function-response content.USERmessages andTEXTparts, supporting both bare requests and thechatRequestenvelope.USERmessages are not suppressed as continuations.extract_user_messages, which is used by request-signature matching. Distinct inline images and file references retain distinct signatures.Raw Gemini continuation detection
inlineData, orfileDataaccompanies a function response. Nested tool-result text and images do not count as fresh user input.Scope and prerequisite
b4c3c9ac); this does not incorporate the implementation from fix: preserve readable ATIF user text with inline images #1483.mutto the loaded TLS PEM binding inOpenTelemetryTlsConfig::validate. Main failed to compile with E0596 becauseTlsPem::http_clienttakes&mut self. This one-line correction enabled validation of the ATIF changes.Validation
just test-rust: 6,488 passed; four skipped.just test-python: 86 native, 1,205 runtime, and 24 plugin-example tests passed.just test-node: six native, 521 runtime, and 26 plugin-example tests passed.GOFLAGS=-count=1 just test-go: passed.uv run pre-commit run: passed, including formatting, documentation link checks, Clippy, Cargo checks, and dependency audits.Where should the reviewer start?
Start with
raw_provider_user_message,gemini_contents_turn_state, andrequest_turn_state_from_rawin atif.rs. The key boundary is that readable display extraction is separate from request-signature extraction.Then review the three
raw_provider_*/raw_gemini_tool_*tests at the end ofcrates/core/tests/unit/atif_tests.rs, which exercise the exporter and verify completeextra.llm_requestretention.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit