Repository navigation
feat: Support restart command and 204-halt in SSE contract test service - #635
Open
kinyoklion wants to merge 1 commit into
Open
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
The service advertised "reconnection", which is not a capability the SSE contract test harness knows (the name is "restart"), and it had no command endpoint at all, so harness commands would have 404'd. Meanwhile the client has supported both behaviors for some time: - restart: adds the POST /entity/<id> command route from the protocol, mapping "restart" to the client's async_restart(). The error that a caller-triggered restart surfaces on the read path (the canceled read looks like a body timeout) is suppressed via a per-entity flag -- the same precedent as the okhttp service suppressing StreamClosedByCallerException. - server-directed-shutdown-request: the client already treats 204 as an unrecoverable error with no backoff, so it is now advertised and the suite's 204-halt test runs (and passes). Verified: full contract test suite passes locally (linux/arm64) including the newly unlocked "caller can trigger a restart" and "204 halts re-connection attempts" tests. Generated-by: termag
kinyoklion
marked this pull request as ready for review
October 30, 2026 23:24
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the SSE contract test service (
contract-tests/sse-contract-tests) capability wiring:restart: the service advertised"reconnection", which is not a capability name the harness knows (the real name isrestart), and the service had no command endpoint at all, so a harness command would have 404'd. This adds the protocol'sPOST /entity/<id>command route and maps"restart"to the client's existingasync_restart(). The error a caller-triggered restart surfaces on the read path (the canceled read looks like a body-timeout) is suppressed via a per-entity flag — the same precedent as the okhttp service suppressingStreamClosedByCallerException.server-directed-shutdown-request(newly advertised): the client already treats 204 as an unrecoverable error with no backoff, so the suite's204 halts re-connection attemptstest now runs against this implementation.Why
A capability audit of the SSE contract-test services (write-up) found the misnamed/dead capability and the unwired 204 support; both tests were silently skipping on this implementation.
How verified
Ran the full sse-contract-tests harness locally against the rebuilt service (linux/arm64, g++ 13, system boost 1.83): all released-suite tests pass, including the newly unlocked restart and 204 tests.
Notes / follow-ups from the audit (not in this PR)
last-event-id: both backends erase a presetLast-Event-Idheader before the first connect (client.cpp:216-220,curl_client.cpp:103-108). That needs a client change.parser.hpp) — a latent client gap shared by most implementations (only rust and Dart strip today).Draft for review of approach.
Opened from termag
SDK-3420
Note
Overview
Fixes SSE contract test service wiring so harness tests for restart and server-directed shutdown (204) actually run instead of being skipped.
The service now advertises
restart(replacing the incorrectreconnectionname) andserver-directed-shutdown-request, and implementsPOST /entity/<id>with JSONcommand, routingrestarttoasync_restart()on the entity’s SSE client.Restart sets a per-entity suppress-next-error flag so the expected read-path error from a caller-triggered cancel is not reported to the harness (same pattern as other contract test implementations). Entity storage moves from
pairtotupleto hold client, outbox, and that flag; destroy is updated accordingly.Reviewed by Cursor Bugbot for commit 2c37097. Bugbot is set up for automated code reviews on this repo. Configure here.