Repository navigation
Give each modern SSE response its own header list - #3704
guptaishaan wants to merge 1 commit into
Conversation
handle_modern_request passed the module-level _SSE_HEADERS list to http.response.start. ASGI middleware that appends to message["headers"] in place mutated it, so headers accumulated and leaked across all later SSE responses in the process. Pass a copy instead.
|
This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #3701. If a maintainer assigns you to #3701, this PR reopens on its own and there's nothing more you need to do here. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. What does help is engaging on the issue itself by confirming the repro, explaining why it matters for your use case, or describing the approach you'd take. You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way. CONTRIBUTING.md has the full reasoning, but in short:
Maintainers: reopen, remove |
Fixes #3701
SSE responses on the 2026-07-28 entry now get their own header list instead of the shared module-level
_SSE_HEADERS.Motivation and Context
handle_modern_requestpassed_SSE_HEADERSitself tohttp.response.start. ASGI middleware that appends tomessage["headers"]in place mutated the shared list, so headers piled up and leaked across responses for the life of the process. The fix islist(_SSE_HEADERS).Thanks to @mgoldsborough for the report and the repro.
How Has This Been Tested?
test_sse_mode_gives_each_response_its_own_header_list. It sends two SSE requests through a send wrapper that appends a header in place. It fails before the fix (['abc', 'abc'] == ['abc']) and passes after.tests/server/test_streamable_http_modern.pyandtests/interaction/transports/test_hosting_http_modern.pypass. ruff and pyright are clean on the touched files.Breaking Changes
None.
Types of changes
Checklist
help wanted, or I'm a maintainer)Additional context
AI disclosure: this change was prepared by an automated Claude Code run (reproduction, fix, and test). The issue reporter also used Claude Code for the issue draft. I am not assigned to the issue.