Repository navigation
SWF(bug): reject Anthropic url images without a url - #82
Merged
maplepaladin73 merged 1 commit intoNov 23, 2026
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1795399239-anthropic-url-image-required
branch
from
November 23, 2026 02:26
2394110 to
c14ea4b
Compare
4 of 6 tasks
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
imageblocks withsource.type == "url"but nourlnow fail request deserialization, so/v1/messagesreturns HTTP 400invalid_request_errorinstead of silently dropping the image.Root cause:
ImageSourceBlockstored every source field asOption, andmaybe_get_image_uri()returnedNonefor a url source with nourl; both the user-block and tool-result lowering paths treatedNoneas "skip this image". The wire request therefore parsed successfully and the malformed image disappeared before validation.Test plan
Try it (CPU, with
bash scripts/ci_gpu_stubs.shrun once):ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark url_imageurl_image_source_without_url_is_rejected ... FAILED— the malformed request deserialized asMessagesRequest { ... ImageSourceBlock { source_type: "url", ..., url: None } ... }.url_image ... ok—5 passed, including the handler test asserting HTTP 400invalid_request_error.3262 passed; 0 failed; 14 ignored(cargo test -p spark-server --bin sparkwith the same environment).53 passed(cargo test -p spark-server --bin spark anthropic::).cargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --testsbash scripts/check-license-headers.sh,python3 scripts/check_spdx.py, andtypos/v1/messageshandler.Notes for reviewers
ImageSourceBlockis now a tagged enum (base64/url/ unknown) with the fields each variant requires, matching the scout's suggested fix. Valid base64/url images are unchanged and still covered by the existing IR carry tests; the same malformed-source class for base64 now also fails deserialization instead of being silently dropped.CLA
Implemented in session Reject Anthropic url images without a url
Review with Devin · Open in Devin Desktop