Repository navigation
fix(agent-scan): accept null content deltas and usage-only chunks in SSE replies - #731
Merged
boy-hack merged 1 commit intoOct 30, 2026
Merged
Conversation
Collaborator
|
Verified locally — both crashes reproduce on main and the fix resolves them cleanly. Reproduction on main (isolated worktree at
Fix verification (isolated worktree at PR head
Suite: main = 68 passed; PR head = 70 passed (the 2 new regression tests account for the delta, zero drift). CI green ( |
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
_parse_sse_responsefails on two standard OpenAI stream shapes, so the HTTP provider check reports a working streaming endpoint as an error:"content": null(OpenAI tool-call chunks, DeepSeek reasoning chunks) reaches"".join(...):sequence item 0: expected str instance, NoneType found.stream_options.include_usage, the last chunk is{"choices": [], "usage": {...}}, andlast_data.get("choices", [{}])[0]raiseslist index out of range.Content is now appended only when it is a string, and
finish_reasoncomes from the last chunk that carries one.Type of change
How was this tested?
text/event-streamserver through_make_http_request: both streams failed before; nowsuccess=Truewith outputHello.agent-scan/pytests/test_agent_adapter.pyfail on main and pass with the fix;pytest agent-scan/pytestspasses (Python 3.12).Related issue
N/A
Checklist
go build ./...succeeds locally (no Go changes)