Problem
PR #1111 (Fix query() stream hang when CLI subprocess dies mid-run) is overstated. The fix only suppresses WouldBlock on the error enqueue; if the consumer is parked on _message_send.receive() and the buffer is not full, the fix does not help.
Impact
- The fix may not address the actual hang root cause
- A real hang could still occur in the unhandled case
- The test does not exercise the fixed code path - mock_receive raises ProcessError directly, but the original hang was caused by
await self._message_send.send(...) blocking on a full/closed buffer
What was audited
MCE audit Tcas1111 (2026-07-19) caught 3 HIGH attacks via F-C:
- The test does not actually exercise the fixed code path
- P1 (p=0.85 "stream unhangs when CLI dies") is overstated - the fix only suppresses WouldBlock on the error enqueue
- The tests use
pytest.raises(Exception, match=r"Command failed") - this matches any Exception
Recommended fix
- The author should:
a. Address the actual hang scenario - consumer parked on receive with full buffer
b. Add a test that exercises the real code path
c. Use more specific exception matching in tests
Cross-references
Problem
PR #1111 (Fix query() stream hang when CLI subprocess dies mid-run) is overstated. The fix only suppresses
WouldBlockon the error enqueue; if the consumer is parked on_message_send.receive()and the buffer is not full, the fix does not help.Impact
await self._message_send.send(...)blocking on a full/closed bufferWhat was audited
MCE audit Tcas1111 (2026-07-19) caught 3 HIGH attacks via F-C:
pytest.raises(Exception, match=r"Command failed")- this matches any ExceptionRecommended fix
a. Address the actual hang scenario - consumer parked on receive with full buffer
b. Add a test that exercises the real code path
c. Use more specific exception matching in tests
Cross-references