Skip to content

test: Advertise server-directed-shutdown-request and last-event-id in SSE contract test service - #45

Merged
kinyoklion merged 1 commit into
mainfrom
rlamb/service-capability-gaps
Nov 2, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
rlamb/service-capability-gaps

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

BEGIN_COMMIT_OVERRIDE
chore: Advertise server-directed-shutdown-request and last-event-id in SSE contract test service
END_COMMIT_OVERRIDE

What

Two capability fixes in contract-tests/:

  1. Advertise server-directed-shutdown-request: the client already treats a 204 response as terminal (its default error filter only retries 500/502/503/504, so a 204 ends reconnection).
  2. Advertise last-event-id and wire the harness's lastEventId parameter into the client's headers['Last-Event-ID'] config, which is how this client seeds the initial Last-Event-ID header (lib/eventsource.js).

Why

A capability audit of the SSE contract-test services (write-up) found both features supported by the client but not advertised by the service, so these suite tests were silently skipping:

  • HTTP behavior/204 halts re-connection attempts
  • HTTP behavior/sends Last-Event-Id in initial request if set

(The pending redirect-preserves regression tests in the audit branch also gate on last-event-id, so they unlock too.)

How verified

Ran the full sse-contract-tests harness locally against the updated service (linux/arm64, node 24): all released-suite tests pass, including both newly unlocked ones. The only failure in the run comes from a not-yet-merged regression test for the known retry: 0 reconnect-storm issue (tracked in the audit; unrelated to this change).

Draft for review of approach.

Opened from termag

SDK-3420


Note

Overview
Updates the SSE contract-test service so its advertised capabilities match what the harness and client already support, which stops the suite from skipping related scenarios.

The root GET / capability list now includes last-event-id and server-directed-shutdown-request (the existing DELETE / 204 shutdown path was already implemented). In streamEntity.js, when the harness passes lastEventId, that value is merged into the EventSource config as the Last-Event-ID header—the same mechanism the client uses to seed the initial header.

This should unlock contract tests such as 204 halts re-connection attempts and sends Last-Event-Id in initial request if set, plus any redirect tests that gate on last-event-id.

Reviewed by Cursor Bugbot for commit 5a67d74. Bugbot is set up for automated code reviews on this repo. Configure here.

Two capabilities the client already supports were not advertised, so the
SSE contract test suite silently skipped their tests:

- server-directed-shutdown-request: the client already treats a 204
  response as terminal (no reconnection) -- the default error filter only
  retries 500/502/503/504.
- last-event-id: the client seeds Last-Event-ID from
  config.headers['Last-Event-ID']; the service now maps the harness's
  lastEventId parameter into that config.

Verified locally: the full contract test suite passes with both
capabilities advertised, including the newly unlocked tests
("204 halts re-connection attempts", "sends Last-Event-Id in initial
request if set").

Generated-by: termag
@kinyoklion
kinyoklion marked this pull request as ready for review October 30, 2026 23:23
@kinyoklion
kinyoklion requested a review from a team as a code owner October 30, 2026 23:23
@kinyoklion
kinyoklion merged commit 0b44bcb into main Nov 2, 2026
5 checks passed
@kinyoklion
kinyoklion deleted the rlamb/service-capability-gaps branch November 2, 2026 17:15
@kinyoklion kinyoklion changed the title feat: Advertise server-directed-shutdown-request and last-event-id in SSE contract test service test: Advertise server-directed-shutdown-request and last-event-id in SSE contract test service Nov 9, 2026
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.

2 participants