Skip to content

refactor(ai): remove unused WebSocket jsonTransport - #57611

Merged
rekram1-node merged 1 commit into
devfrom
ai-websocket-dead-json
Oct 21, 2026
Merged

rekram1-node merged 1 commit into
devfrom
ai-websocket-dead-json

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

packages/ai/src/route/transport/websocket.ts defines a standalone websocket-json transport (JsonPrepared, JsonInput, JsonPatch, JsonTransport, json, and jsonTransport) that is unused across the repository. All WebSocket model traffic flows through open-responses-channel.ts and WebSocketChannelExecutor via WebSocketTransport.open, makeDirect, direct, fromWebSocket, messageText, and toWebSocketUrl.

Change

Remove the unused websocket-json transport definitions, exports, and supporting imports from packages/ai/src/route/transport/websocket.ts.

 packages/ai/src/route/transport/websocket.ts
-  JsonPrepared / JsonInput / JsonPatch / JsonTransport
-  json()
-  jsonTransport
   WebSocketTransport
-    .json
-    .jsonTransport
     .direct
     .makeDirect
     .open
     .fromWebSocket
     .messageText
     .toWebSocketUrl

Out of scope

  • WebSocket channel execution and connection lifecycle helpers (direct, makeDirect, open, fromWebSocket, messageText, toWebSocketUrl).

Added by the opencode bot (AI-generated).

Public API: removes WebSocketTransport.json / jsonTransport and the Json* websocket transport types from @opencode/ai/route (unused in the repo; breaking only for any outside users)

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean dead-code removal. The websocket-json transport has no users left in the repo, and the trimmed imports were only used by the removed code. packages/ai typecheck and tests pass, as do the packages/core tests that use WebSocketTransport.open.

Public API: @opencode/ai is published, and WebSocketTransport is exported from its route entry. This removes WebSocketTransport.json and WebSocketTransport.jsonTransport there, plus the json/jsonTransport exports and the JsonPrepared/JsonInput/JsonPatch/JsonTransport types from the route/transport/websocket subpath. Strictly speaking that is not backwards compatible for any outside code using them (they would need to switch to WebSocketTransport.direct/makeDirect with a channel executor), but nothing in the repo uses them.

No concerns.

@rekram1-node
rekram1-node merged commit 678e49d into dev Oct 21, 2026
23 checks passed
@rekram1-node
rekram1-node deleted the ai-websocket-dead-json branch October 21, 2026 02:58
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