tractor/ai/prompt-io/opencode/20260818T193001Z_bf06b4f8_p...

671 B

Prospective review found that cancellation can interrupt MsgpackTransport.send() after send_all() writes only part of its length-prefixed msg. Sending a cancellation request afterward can append another msg to the indeterminate stream and desynchronize the peer decoder.

git diff HEAD~1..HEAD -- tractor/ipc/_transport.py tests/ipc/test_each_tpt.py

Close the stream under a cancellation shield when send_all() is cancelled. Cover the behavior with a fake stream that checkpoints inside the write and records forced closure.