Tags: weavejam/copilot-proxy
Tags
fix(streaming): use stream.aborted instead of req.signal.aborted In Node.js + srvx, the request's AbortSignal is bound to the IncomingMessage 'close' event, which fires as soon as the request body is fully read — not when the client actually disconnects. This caused streaming handlers to break out of the for-await loop on the very first frame, returning a 200 response with an empty SSE body. Switch to hono's stream.aborted, which is only set when the response stream is cancelled by the downstream consumer (i.e. when nodeRes.close fires — the real client disconnect signal). Verified node dist/main.js now produces full SSE on both /v1/chat/completions and /v1/messages. Also includes: - tsconfig.json: exclude dist from typecheck - sqlite-adapter.ts: tighten transaction generic so callers can pass typed callbacks without the overload conflict - utils.ts: hoist getBigrams to module scope (lint) - bump to 0.9.2 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PreviousNext