proxy: emit buffered sse terminal status #35

Merged
wmc merged 1 commit from codex/buffered-sse-terminal-status into main 2026-06-23 08:26:16 +00:00
Owner

Summary

  • Emit response.incomplete or response.failed terminal SSE events from buffered Responses bodies based on status.
  • Keep completed and unknown-status bodies on response.completed, preserving existing created/output item events plus [DONE].
  • Add completed/incomplete/failed helper coverage and update TODO for the next backlog item.

Verification

  • RED: DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild test -project CodexModelSwitcher.xcodeproj -scheme CodexModelSwitcher -configuration Debug -destination platform=macOS -derivedDataPath /tmp/CodexModelSwitcher-DerivedData-buffered-sse-red CODE_SIGNING_ALLOWED=NO -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesIncompleteTerminalEventForIncompleteResponseBodies -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesFailedTerminalEventForFailedResponseBodies failed before implementation because the helper emitted response.completed.
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild test -project CodexModelSwitcher.xcodeproj -scheme CodexModelSwitcher -configuration Debug -destination platform=macOS -derivedDataPath /tmp/CodexModelSwitcher-DerivedData-buffered-sse-focused CODE_SIGNING_ALLOWED=NO -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamKeepsCompletedTerminalEventForCompletedResponseBodies -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesIncompleteTerminalEventForIncompleteResponseBodies -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesFailedTerminalEventForFailedResponseBodies
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild test -project CodexModelSwitcher.xcodeproj -scheme CodexModelSwitcher -configuration Debug -destination platform=macOS -derivedDataPath /tmp/CodexModelSwitcher-DerivedData-buffered-sse-proxy CODE_SIGNING_ALLOWED=NO -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests
  • git diff --check -- CodexModelSwitcher/CompatibilityProxyServer.swift CodexModelSwitcherTests/CompatibilityProxyServerTests.swift TODO.md
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer scripts/verify.sh
  • Subagent review: no findings; residual risk noted that eventStreamData(for:) is currently helper-only, so coverage is at the helper surface rather than a production runtime path.
## Summary - Emit `response.incomplete` or `response.failed` terminal SSE events from buffered Responses bodies based on `status`. - Keep completed and unknown-status bodies on `response.completed`, preserving existing created/output item events plus `[DONE]`. - Add completed/incomplete/failed helper coverage and update TODO for the next backlog item. ## Verification - RED: `DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild test -project CodexModelSwitcher.xcodeproj -scheme CodexModelSwitcher -configuration Debug -destination platform=macOS -derivedDataPath /tmp/CodexModelSwitcher-DerivedData-buffered-sse-red CODE_SIGNING_ALLOWED=NO -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesIncompleteTerminalEventForIncompleteResponseBodies -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesFailedTerminalEventForFailedResponseBodies` failed before implementation because the helper emitted `response.completed`. - `DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild test -project CodexModelSwitcher.xcodeproj -scheme CodexModelSwitcher -configuration Debug -destination platform=macOS -derivedDataPath /tmp/CodexModelSwitcher-DerivedData-buffered-sse-focused CODE_SIGNING_ALLOWED=NO -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamKeepsCompletedTerminalEventForCompletedResponseBodies -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesIncompleteTerminalEventForIncompleteResponseBodies -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests/testBufferedEventStreamUsesFailedTerminalEventForFailedResponseBodies` - `DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild test -project CodexModelSwitcher.xcodeproj -scheme CodexModelSwitcher -configuration Debug -destination platform=macOS -derivedDataPath /tmp/CodexModelSwitcher-DerivedData-buffered-sse-proxy CODE_SIGNING_ALLOWED=NO -only-testing:CodexModelSwitcherTests/CompatibilityProxyServerTests` - `git diff --check -- CodexModelSwitcher/CompatibilityProxyServer.swift CodexModelSwitcherTests/CompatibilityProxyServerTests.swift TODO.md` - `DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer scripts/verify.sh` - Subagent review: no findings; residual risk noted that `eventStreamData(for:)` is currently helper-only, so coverage is at the helper surface rather than a production runtime path.
wmc merged commit 67b0669f31 into main 2026-06-23 08:26:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
wmc/CodexModelSwitcher!35
No description provided.