Repository navigation
refactor(ai): remove unused WebSocket jsonTransport - #57611
Conversation
There was a problem hiding this comment.
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.
Problem
packages/ai/src/route/transport/websocket.tsdefines a standalonewebsocket-jsontransport (JsonPrepared,JsonInput,JsonPatch,JsonTransport,json, andjsonTransport) that is unused across the repository. All WebSocket model traffic flows throughopen-responses-channel.tsandWebSocketChannelExecutorviaWebSocketTransport.open,makeDirect,direct,fromWebSocket,messageText, andtoWebSocketUrl.Change
Remove the unused
websocket-jsontransport definitions, exports, and supporting imports frompackages/ai/src/route/transport/websocket.ts.Out of scope
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)