v2.4.1
Highlights
Anthropic ImageUrl fix. Closes #24. Before this patch, ContentPart::ImageUrl { url } was silently mapped to AnthropicContent::Text { text: url } in ras-llm-anthropic — a URL-referenced image (CDN, hosted bucket, signed S3 link) lost its image semantics and the model received a literal URL string in a text block. No vision grounding for the URL path on Anthropic.
v2.4.1 emits Anthropic's native {"type":"image","source":{"type":"url","url":"..."}} shape.
What's new
ras-llm-anthropic — native URL source
AnthropicImageSourcerefactored from struct to enum tagged ontype:Base64 { media_type, data }— wire shape unchanged from 2.4.0.Url { url }— new variant emitting Anthropic's native URL image source.
content_part_to_anthropicnow maps bothContentPart::ImageBase64andContentPart::ImageUrltoAnthropicContent::Imagewith the appropriate source variant.
ras-agent — unchanged
Phase A (v2.4.0) emits ContentPart::ImageBase64 for screenshots, which already worked. This fix is only relevant to callers that bypass the screenshot pipeline and pass image URLs directly through ChatMessage::user_parts — for example, hosted screenshot services or pre-uploaded asset references.
Tests
2 new unit tests in ras-llm-anthropic/src/infrastructure/http/dto.rs:
image_base64_serializes_with_native_source— assertstype=image,source.type=base64,media_type+datapresent,urlabsent.image_url_serializes_with_native_url_source— assertstype=image,source.type=url,urlpresent,media_type+dataabsent.
Verification
cargo test --workspace --no-fail-fast— all suites passcargo clippy --workspace --all-targets -- -D clippy::unwrap_used -D clippy::dbg_macro— cleancargo fmt --all -- --check— cleancargo doc --workspace --no-deps— clean
crates.io
Not published. publish.yml gate skips patch bumps. The fix folds into the next minor release (planned Phase B) and reaches crates.io there. If you need 2.4.1 on crates.io before then, trigger publish.yml manually via workflow_dispatch with force=true.
Compatibility
AnthropicImageSourceispubbut only used insideras-llm-anthropic::infrastructure::http::dto; no external consumers exist in the workspace. The struct → enum change is breaking for any out-of-tree consumer constructingAnthropicImageSourcedirectly, which is unlikely given the type's role as an internal serialization DTO.ContentPartAPI unchanged.ChatMessageAPI unchanged.- Workspace MSRV unchanged.
Artifacts
- Linux x86_64:
ras-x86_64-unknown-linux-gnu,ras-daemon-x86_64-unknown-linux-gnu - macOS arm64:
ras-aarch64-apple-darwin,ras-daemon-aarch64-apple-darwin - crates.io: not published this release (see above)
Pull requests
- #27 —
fix(anthropic): emit native source.type=url for ContentPart::ImageUrl (v2.4.1) - #28 —
release: v2.4.1 (anthropic ImageUrl fix)
Closes: #24
Full changelog: v2.4.0...v2.4.1