gabriel / muse public
feat dev
AI Agent gabriel · 140 days ago · Apr 29, 2026 · Diff

feat: presigned R2 push routing above threshold

Replace CF Worker path with presigned R2 path. Pushes >= 500 objects or >= 50 MB raw on non-loopback URLs call POST /push/presign first, PUT objects directly to R2 (bypassing Cloudflare timeout), then send a zero-O-frame push/stream. Objects with no presigned URL (LocalBackend) fall back to inline O frames. Loopback URLs always stream regardless of size.

Tests: P8a-P8f covering threshold logic and stream_these inline fallback.

sha256:1c2d6cbc0359efcffcea20d86c1e703c111c159df36c121b7cf66a81fbed3e9f sha
+19 ~1 symbols
sha256:baa547d7240cf24a459125393a0789e2cf1f085f7e9fcedad6e23261a8569d3e snapshot
+19
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 20 symbols
~ tests/test_push_presign_routing.py .py 17 symbols added
+ _make_objects function function _make_objects L29–38
+ _threshold_met function function _threshold_met L41–48
+ AsyncMock import import AsyncMock L16–16
+ MagicMock import import MagicMock L16–16
+ ObjectPayload import import ObjectPayload L22–22
+ _PRESIGN_BYTE_THRESHOLD import import _PRESIGN_BYTE_THRESHOLD L21–21
+ _PRESIGN_OBJECT_THRESHOLD import import _PRESIGN_OBJECT_THRESHOLD L21–21
+ annotations import import annotations L14–14
+ msgpack import import msgpack L18–18
+ patch import import patch L16–16
+ pytest import import pytest L19–19
+ test_p8a_below_threshold_uses_stream function function test_p8a_below_threshold_uses_stream L55–57
+ test_p8b_object_threshold_triggers_presign function function test_p8b_object_threshold_triggers_presign L64–66
+ test_p8c_byte_threshold_triggers_presign function function test_p8c_byte_threshold_triggers_presign L73–77
+ test_p8d_loopback_never_presigns function function test_p8d_loopback_never_presigns L84–86
+ test_p8e_presign_path_sequence function async_function test_p8e_presign_path_sequence L94–150
+ test_p8f_stream_these_objects_not_dropped function function test_p8f_stream_these_objects_not_dropped L157–177
~ muse/cli/commands/push.py .py 2 symbols added, 1 symbol modified
+ _PRESIGN_BYTE_THRESHOLD variable variable _PRESIGN_BYTE_THRESHOLD L131–131
+ _PRESIGN_OBJECT_THRESHOLD variable variable _PRESIGN_OBJECT_THRESHOLD L130–130
← Older Oldest on dev
All commits
Newer → Latest on dev

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