gabriel / musehub public
fix patch wire task/wire-streaming-request #1 / 1
AI Agent gabriel · 154 days ago · Apr 22, 2026 · Diff

fix(wire): stream request body instead of buffering in push_stream

Replace 'await request.body()' + wrapper generator with 'request.stream()' in the push_stream route. This eliminates Cloudflare's full-body buffering before forwarding to origin — the root cause of bad_record_mac TLS errors on large pushes. Chunks now forward as they arrive, matching HTTP/2 intent.

Tests: test_wire_streaming_push.py S1/S2 static checks verify the fix is present in source; S3/S4 are integration tests requiring a live server.

sha256:7f9d6b5ffaabcda978649f879107b2908b0791eb1edb699ffadcc5bccc436f52 sha
+32 ~1 symbols
sha256:cebb0d94b19426fdaa579e105ccfd356aff9dbc99872aff8580c5d876c5475b8 snapshot
+32
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 33 symbols
~ tests/test_wire_streaming_push.py .py 32 symbols added
+ _commit_pack_frame function function _commit_pack_frame L66–67
+ _end_frame function function _end_frame L70–71
+ _header_frame function function _header_frame L54–63
+ _make_commit function function _make_commit L74–89
+ _make_snapshot function function _make_snapshot L92–93
+ _pack function function _pack L42–43
+ _sha256_oid function function _sha256_oid L46–47
+ _stub_r2_backend function function _stub_r2_backend L96–101
+ _utc function function _utc L50–51
+ Any import import Any L20–20
+ AsyncClient import import AsyncClient L25–25
+ AsyncMock import import AsyncMock L21–21
+ AsyncSession import import AsyncSession L26–26
+ MagicMock import import MagicMock L21–21
+ SFRAME_COMMIT_PACK import import SFRAME_COMMIT_PACK L28–28
+ SFRAME_END import import SFRAME_END L28–28
+ SFRAME_HEADER import import SFRAME_HEADER L28–28
+ SFRAME_RESULT import import SFRAME_RESULT L28–28
+ STREAM_MIME_TYPE import import STREAM_MIME_TYPE L28–28
+ annotations import import annotations L15–15
+ create_repo import import create_repo L35–35
+ datetime import import datetime L19–19
+ hashlib import import hashlib L17–17
+ inspect import import inspect L18–18
+ msgpack import import msgpack L23–23
+ patch import import patch L21–21
+ pytest import import pytest L24–24
+ timezone import import timezone L19–19
+ test_s1_push_stream_route_does_not_call_request_body function function test_s1_push_stream_route_does_not_call_request_body L108–122
+ test_s2_push_stream_route_uses_request_stream function function test_s2_push_stream_route_uses_request_stream L129–138
+ test_s3_valid_push_still_succeeds_with_streaming function async_function test_s3_valid_push_still_succeeds_with_streaming L146–173
+ test_s4_auth_checked_before_stream_consumed function async_function test_s4_auth_checked_before_stream_consumed L181–212
~ musehub/api/routes/wire.py .py 1 symbol modified
← Older Oldest on task/wire-streaming-request
All commits
Newer → Latest on task/wire-streaming-request

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:7f9d6b5ffaabcda978649f879107b2908b0791eb1edb699ffadcc5bccc436f52 --body "your comment"