Skip to content

feat(websocket): accept official response.steer events - #5775

Open
songlairui wants to merge 1 commit into
router-for-me:devfrom
songlairui:feat/responses-websocket-steer
Open

songlairui wants to merge 1 commit into
router-for-me:devfrom
songlairui:feat/responses-websocket-steer

Conversation

@songlairui

Copy link
Copy Markdown

Summary

  • /v1/responses WebSocket previously treated response.steer as an unknown type and returned unsupported websocket request type: response.steer, so official mid-turn steering never reached Codex/xAI.
  • Accept the official three-field payload (type, previous_response_id, input) without injecting stream or model, and leave the last response.create snapshot unchanged.
  • Codex/xAI websocket executors now clone steer frames instead of rewriting them to response.create. HTTP fallback cannot mid-turn-steer and returns steering_not_supported.
  • Concurrent read-while-generating (true in-flight interrupt) is left as a follow-up; official clients already allow the original response to complete first, then continue.

Test plan

  • go test ./sdk/api/handlers/openai/ -run 'TestNormalizeResponsesWebsocketRequestSteer|TestNormalizeResponsesWebsocketPassthroughRequestSteer|TestNormalizeResponsesWebsocketRequestSteerRejectsEmptyInput|TestNormalizeResponsesWebsocketRequestStillRejectsUnknownType|TestResponsesWebsocketRequestRequiresCurrentUpstream|TestNormalizeResponsesWebsocketRequestCreate'
  • go test ./internal/runtime/executor/ -run 'TestBuildCodexWebsocketRequestBodyPreserves|TestBuildXAIWebsocketRequestBodyPreservesSteer|TestBuildXAIWebsocketRequestBodySetsStore'
  • Against a Codex Responses WS session: send official response.steer after response.create and confirm it is forwarded instead of rejected as an unknown type
  • Confirm HTTP fallback still returns steering_not_supported
  • Confirm unknown types such as response.cancel are still rejected

Made with Cursor

CLIProxyAPI's Responses WS whitelist dropped mid-turn steer before
upstream could see it. Forward the official three-field payload and
keep HTTP fallback as steering_not_supported.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant