gabriel / muse public
fix BREAKING transport task/wire-staleness-fix #1 / 1
AI Agent gabriel · 50 days ago · Apr 22, 2026 · Diff

fix(transport): force fresh H2 connection in push_stream to prevent BAD_RECORD_MAC

The push operation sequence is: refs → negotiate → presign_objects → [R2 PUTs] → push_stream. Presigned R2 PUTs use a separate httpx client and can take 30+ seconds. During that window the shared _wire_client H2 connection to Cloudflare goes idle; CF drops it. Reusing the stale connection desynchronises TLS state and triggers SSLV3_ALERT_BAD_RECORD_MAC, causing push/stream to never reach the origin server.

Fix: _push_stream_httpx now closes and nulls _wire_client before the streaming POST, guaranteeing a fresh H2 connection regardless of presign PUT duration.

T24 tests verify: stale client is closed before push, and None client creates fresh without crashing.

Also updates musewire-performance.md to reflect all completed work (server request.stream(), httpx paths for all endpoints, shared client) and documents the Cloudflare connection staleness root cause.

sha256:b5a2e00cce7a04b711f745cf052a14e490f0d5078e543d09a5ac05ef7d23b088 sha
sha256:301c41fb025bc4466dfa72da550e507b5b898cec767c447b0dedb3d005df85ed snapshot
← Older Oldest on task/wire-staleness-fix
All commits
Newer → Latest on task/wire-staleness-fix

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:b5a2e00cce7a04b711f745cf052a14e490f0d5078e543d09a5ac05ef7d23b088 --body "your comment"