Repository navigation
SWF(bug): surface Anthropic stream errors and refusals - #46
Merged
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/1795371434-anthropic-stream-outcomes
branch
from
November 22, 2026 18:28
2f07402 to
4e34384
Compare
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 streams now end with an SSE error on upstream failure and report model refusals as
stop_reason: "refusal"without repeating the refusal text.Test plan
Before (Spark binary with tests only):
After (same regressions in the full Spark binary suite, after rebasing):
Root cause: The translator discarded both deltas, so EOF synthesized a successful end after errors, and a regular Finish delta still reported
end_turnon refusals. Errors now emit the Anthropic error envelope and end the SSE body without a success frame. The refusal annotation changes only the stop reason; normal text and final token usage are preserved.Try it (GPU-free, with
scripts/ci_gpu_stubs.shsetup):ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark anthropic::tests::translator_streamBlueprint lint: Formatting, workspace Clippy, license headers and typos passed on the rebased branch. The main build fix is now in the base; no local source workarounds were needed.
Untested: Real-model inference and GPU/Docker validation. The SSE test runs the real HTTP body encoder using an injected upstream error.
CLA
Implemented in session Surface errors and refusals in Anthropic streams
Review with Devin · Open in Devin Desktop