v3.3.5 — Extract Shared Core + SSE Unification (1 bug fix)
v3.3.5 — Dead Code Removal + Safe Consolidation + SSE Unification
167 INSERTIONS, 329 DELETIONS — NET -162 LINES (-1.9%). 29 files (-3). 625/625 tests.
Phase 4 — Extract _enqueue_and_await_task() (~60 lines)
_handle_task_send (195 lines) and _rest_send_message (99 lines) shared 70% — sanitize, idempotency, collision, enqueue, webhook, wait, filter. Extracted into shared core. Both callers keep their own preamble (configuration, worker_at bypass, return_immediately) and epilogue (RPC response format, SSE/push artifact delivery, REST inline dict formatting).
Phase 5 — Extract _stream_task_sse() (~70 lines + bug fix)
_handle_send_subscribe and _rest_subscribe_to_task were structurally identical — same poll loop, same 0.5s interval, same 300s timeout, same terminal detection. Extracted into unified _stream_task_sse(task_id, extra_headers, http_method).
Bug fixed: JSON-RPC version didn't check for client disconnect during terminal state transmit — wrote SSE events to dead socket silently. REST version checked correctly. The unified core backports the disconnect check from REST.
Full changelog: v3.3.5 on GitHub
Previous releases: