You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Server.swift: add defer-based heartbeat cleanup in both handleChatStreaming and
handleTextStreaming so heartbeatTask is always cancelled on any exit path
(client disconnect during prefill no longer leaks the heartbeat task)
- ServerSSETests.swift: add missing import Foundation for Data/JSONSerialization
- test-server.sh Test 32: fail on empty curl response instead of false-passing
- test-server.sh Test 33: use conditional curl; fail if request fails entirely
- test-server.sh Test 34: redirect CORS preflight to CORS_PORT (--cors server)
instead of the main server which has no CORS middleware
- test-server.sh Test 35: spin up a dedicated --parallel 2 server so concurrent
requests actually overlap and stress the global hook under real parallelism
- test-opencode.sh: capture opencode exit code separately; classify parse errors
vs acceptable non-zero exits to prevent false passes
fail "Strict mode: prefill_progress payload leaked into default stream"
988
+
else
989
+
pass "Strict mode: no prefill_progress object in default stream"
990
+
fi
981
991
fi
982
992
983
993
984
994
# ── Test 33: Opt-in header enables named SSE event ────────────────────────────
985
995
log "Test 33: Opt-in header enables named SSE event"
986
996
987
-
OPTIN_STREAM=$(curl -sf -N -X POST "$URL/v1/chat/completions" \
997
+
ifOPTIN_STREAM=$(curl -sf -N -X POST "$URL/v1/chat/completions" \
988
998
-H "Content-Type: application/json" \
989
999
-H "X-SwiftLM-Prefill-Progress: true" \
990
1000
-d "{\"model\":\"$MODEL\",\"stream\":true,\"max_tokens\":20,\"messages\":[{\"role\":\"user\",\"content\":\"Say a very long sentence that will definitely take some time to process.\"}]}" \
0 commit comments