gabriel / muse public
fix BREAKING wire task/fix-oc-n-objects-count #1 / 1
AI Agent gabriel · 151 days ago · Apr 23, 2026 · Diff

fix(wire): count distinct OC objects in H/E frame n_objects

OC chunk entries in the objects list share the same object_id across all N chunk fragments. _frame_generator was passing len(objects) as n_objects, counting each fragment as a separate object. The server assembles OC sequences and counts 1 per oid, causing:

'count mismatch: E frame claims 1029 object frames, server received 1028'

Fix: compute _n_objects_distinct = O-frame count + len(unique OC oids). Applied at both H-frame construction (in _frame_generator and in push_stream_coro) and E-frame write.

TDD: test_wire_oc_n_objects.py covers the regression (P-OC-N2) and the mixed O + OC case (P-OC-N3).

sha256:63dfe1ce33eed2712fb3242b2a62f56b4a14fa6c01e3ccd5005186c2e070c067 sha
+27 ~3 symbols
sha256:ee4e5081053492aa3777c29e9c56109e2162a29b9fa78b614cab346d0d9419c1 snapshot
+27
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 30 symbols
~ tests/test_wire_oc_n_objects.py .py 27 symbols added
+ TestPOCN0Empty class class TestPOCN0Empty L122–129
+ test_e_n_objects_is_zero method method test_e_n_objects_is_zero L127–129
+ test_h_n_objects_is_zero method method test_h_n_objects_is_zero L123–125
+ TestPOCN1TwoOObjects class class TestPOCN1TwoOObjects L136–149
+ _objects method method _objects L137–141
+ test_e_n_objects_is_two method method test_e_n_objects_is_two L147–149
+ test_h_n_objects_is_two method method test_h_n_objects_is_two L143–145
+ TestPOCN2OneOCObjectTwoChunks class class TestPOCN2OneOCObjectTwoChunks L156–177
+ _objects method method _objects L162–163
+ test_e_n_objects_is_one method method test_e_n_objects_is_one L172–177
+ test_h_n_objects_is_one method method test_h_n_objects_is_one L165–170
+ TestPOCN3MixedObjects class class TestPOCN3MixedObjects L184–208
+ _objects method method _objects L185–200
+ test_e_n_objects_is_two method method test_e_n_objects_is_two L206–208
+ test_h_n_objects_is_two method method test_h_n_objects_is_two L202–204
+ TestPOCN4HEConsistency class class TestPOCN4HEConsistency L215–230
+ _cases method method _cases L216–222
+ test_h_equals_e_for_all_cases method method test_h_equals_e_for_all_cases L224–230
+ _h_and_e function function _h_and_e L103–115
+ _make_o_object function function _make_o_object L45–52
+ _make_oc_chunks function function _make_oc_chunks L55–80
+ _parse_mwp_frames function function _parse_mwp_frames L83–100
+ _sha256_oid function function _sha256_oid L41–42
+ annotations import import annotations L29–29
+ hashlib import import hashlib L31–31
+ msgpack import import msgpack L34–34
+ struct import import struct L32–32
← Older Oldest on task/fix-oc-n-objects-count
All commits
Newer → Latest on task/fix-oc-n-objects-count

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