Skip to content

Conversation

@EhabY
Copy link
Collaborator

@EhabY EhabY commented Oct 13, 2025

Add SSE fallback to some WS connections:

  • /api/v2/workspaces/${workspace.id}/watch-ws -> /api/v2/workspaceagents/${agentId}/watch-metadata
  • /api/v2/workspaceagents/${agentId}/watch-metadata-ws -> /api/v2/workspaceagents/${agentId}/watch-metadata

Restored the previous code regarding createStreamingFetchAdapter to stream in SSE events.

  • Implemented a unified interface for WS and SSE to be similar to the OneWayWebSocket.
  • Added unified logging for WS and SSE.
  • Fixed issue with headers order precedence
  • Add tests for CoderApi

Closes #620

@EhabY EhabY force-pushed the add-sse-fallback-to-ws branch from 352c38b to bd3a0d8 Compare October 14, 2025 08:24
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked into tests yet, but I can give a few observations now 👍

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I didn't dive too deep. I don't see anything concerning, but it might be feasible to ask @code-asher for another look.

@EhabY EhabY merged commit f9b1f25 into coder:main Oct 17, 2025
2 checks passed
@code-asher
Copy link
Member

Sorry, did not get a chance to review, I can do it next Monday if we want another pass.

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.

Add SSE fallback for the new WebSocket API endpoints

3 participants