gabriel / muse public
refactor BREAKING main #13 / 45
AI Agent gabriel · 19 days ago · May 28, 2026 · Diff

refactor: replace httpx with stdlib urllib in push path

httpx was used in push.py for the presigned mpack protocol (presign POST, R2 PUT, unpack-mpack POST) with http2=False — no HTTP/2 benefit, just unnecessary async complexity causing ReadError on large uploads.

- Remove httpx and asyncio from push.py entirely - Add _urllib_post() and _urllib_put() using urllib.request.urlopen() - Synchronous: no event loop overhead, plain socket with 300s timeout - _make_push_ssl_ctx() and _make_r2_client() deleted - test_push_mpack_e2e.py: patch _urllib_post/_urllib_put instead of httpx

transport.py retains httpx for HTTP/2 (hub API calls benefit from multiplexing). push.py → single large binary upload, no HTTP/2 needed.

sha256:7e95b29f2d502ad5eccf2a57af4092763a2e705f1bf1569a8cb7e063b6e6d5bd sha
+8 ~5 −12 symbols
sha256:2bfa754fae073913a95e3fc530b2929ee8040d365297c6756b5a13d3c3f7f899 snapshot
+8
symbols added
~5
symbols modified
−12
symbols removed
0
dead code introduced
Semantic Changes 25 symbols
~ muse/cli/commands/push.py .py 5 symbols added, 5 symbols removed, 1 symbol modified
PRESIGN_PUT_CONCURRENCY variable variable PRESIGN_PUT_CONCURRENCY L117–117
_make_push_ssl_ctx function function _make_push_ssl_ctx L131–134
_make_r2_client function function _make_r2_client L119–128
_asyncio import import _asyncio L112–112
_httpx import import _httpx L114–114
+ _urllib_post function function _urllib_post L134–147
+ _urllib_put function function _urllib_put L119–131
+ Mapping import import Mapping L65–65
+ _urllib_err import import _urllib_err L115–115
+ _urllib_req import import _urllib_req L114–114
~ tests/test_push_mpack_e2e.py .py 3 symbols added, 7 symbols removed, 4 symbols modified
__aenter__ method async_method __aenter__ L138–139
__aexit__ method async_method __aexit__ L141–142
post method async_method post L144–155
put method async_method put L157–160
_fake_resp function function _fake_resp L119–125
AsyncMock import import AsyncMock L31–31
asyncio import import asyncio L26–26
+ fake_post method method fake_post L129–138
+ fake_put method method fake_put L140–143
+ Mapping import import Mapping L29–29
~ patch

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