Skip to content

feat: wire SSE core into VS Code response panel + directives (#46)#52

Open
rwrife wants to merge 1 commit into
mainfrom
feat/issue-46-sse-vscode-wiring
Open

feat: wire SSE core into VS Code response panel + directives (#46)#52
rwrife wants to merge 1 commit into
mainfrom
feat/issue-46-sse-vscode-wiring

Conversation

@rwrife

@rwrife rwrife commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Closes #46 (partially — first shippable slice).

What changed

  • New: src/core/sse/directives.ts — pure mapping from .http directives (@sse-until, @sse-max-events, @sse-max-duration-ms, @sse-idle-ms) to a validated SseTransportUserOptions object, plus an isSseResponse helper. Zod-validated. Bad numeric values are surfaced as diagnostics, not silently dropped.
  • New: renderSseResponse in src/extension/responseView.ts — streaming-mode response panel that shows a scrolling event list with type / id / elapsed / timestamp, pretty-prints JSON data, and toggles between a "● streaming" and "■ " pill.
  • Wired: runRequest now detects text/event-stream on the undici response and hands off to a new streamSseResponse helper that drives the existing pure runSseTransport over the decoded body, refreshing the webview on every event and surfacing @sse-until compile/runtime errors as a warning banner.
  • Tests: 9 new unit tests covering directive parsing (happy path, empty predicate, non-integer caps, coexistence with unrelated directives) and the content-type sniffer. Total suite: 489 tests, all green.
  • README: documented the new directive matrix and clarified what still lands in follow-ups.

What's left for #46

  • Reconnect + Last-Event-ID retry loop (transport already tracks state; needs a socket-owning wrapper).
  • Explicit "Stop stream" button in the webview (currently: close the panel or hit a guardrail).
  • On-disk .sse.jsonl transcript command (formatSseTranscriptLine already exists in core).
  • Integration test against a local SSE server via @vscode/test-electron.

Small, focused slice — no drive-by refactors, no changes to the existing HTTP path when the response isn't SSE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Server-Sent Events (SSE) request support

1 participant