Skip to content

v2.4.1

Choose a tag to compare

@github-actions github-actions released this 10 May 05:35
· 72 commits to main since this release
65ac701

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

  • AnthropicImageSource refactored from struct to enum tagged on type:
    • 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_anthropic now maps both ContentPart::ImageBase64 and ContentPart::ImageUrl to AnthropicContent::Image with 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 — asserts type=image, source.type=base64, media_type + data present, url absent.
  • image_url_serializes_with_native_url_source — asserts type=image, source.type=url, url present, media_type + data absent.

Verification

  • cargo test --workspace --no-fail-fast — all suites pass
  • cargo clippy --workspace --all-targets -- -D clippy::unwrap_used -D clippy::dbg_macro — clean
  • cargo fmt --all -- --check — clean
  • cargo 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

  • AnthropicImageSource is pub but only used inside ras-llm-anthropic::infrastructure::http::dto; no external consumers exist in the workspace. The struct → enum change is breaking for any out-of-tree consumer constructing AnthropicImageSource directly, which is unlikely given the type's role as an internal serialization DTO.
  • ContentPart API unchanged.
  • ChatMessage API 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

  • #27fix(anthropic): emit native source.type=url for ContentPart::ImageUrl (v2.4.1)
  • #28release: v2.4.1 (anthropic ImageUrl fix)

Closes: #24

Full changelog: v2.4.0...v2.4.1