Repository navigation
SWF(bug): keep Anthropic text and image order - #86
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Anthropic
[text, image, text]content blocks were lowered as[image, joined text], and the chat-template JSON then grouped media markers before text again. Lowering and rendering now keep the client's text/media interleaving end to end.No tracking issue (TASK-68).
Test plan
cargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --testsbash scripts/check-license-headers.sh~/.local/bin/typosATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark— 3269 passed, 14 ignoredFailing → passing:
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark anthropic::tests::to_ir_blocks::user_text_image_text_preserves_wire_order -- --exactfailed withcontent: [Image(...), Text("beforeafter")],left: 2, right: 3.api::chat::template::json_message_tests::text_and_media_parts_render_in_content_orderpasses.Try it:
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark user_text_image_text_preserves_wire_order -- --exact(afterbash scripts/ci_gpu_stubs.shon a GPU-less host).Notes for reviewers
anthropic/to_ir.rs: assistant/user text blocks now flush intoContentPart::Textaround image parts; adjacent text still joins with no separator. Tool-result payloads keep the existing images-then-joined-text layout because they carry one flattened text payload.api/chat/msg_entry.rs:MsgEntrynow stores orderedparts(Text/Media) instead of a flat content string plus a media list; prompt-pipeline appends (hints, CWD, repeat notices, error masks) preserve media positions.api/chat/template.rs: JSON content arrays emit text/media markers in that same order. Moved the JSON-message tests totemplate/json_message_tests.rsto stay under the 500-LoC cap.CLA
Implemented in session Keep Anthropic text and image order
Review with Devin · Open in Devin Desktop