From 63dab254bf93b4c2f59ab89e4a30442cd981ca5a Mon Sep 17 00:00:00 2001 From: Snider Date: Thu, 26 Mar 2026 08:24:21 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20ide/bridge.go=20=E2=80=94=20remove=20enc?= =?UTF-8?q?oding/json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit json.Marshal → core.JSONMarshalString json.Unmarshal → core.JSONUnmarshal Co-Authored-By: Virgil --- pkg/mcp/ide/bridge.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/mcp/ide/bridge.go b/pkg/mcp/ide/bridge.go index 40351cd..633d934 100644 --- a/pkg/mcp/ide/bridge.go +++ b/pkg/mcp/ide/bridge.go @@ -2,7 +2,7 @@ package ide import ( "context" - "encoding/json" + core "dappco.re/go/core" "net/http" "sync" "time" @@ -75,10 +75,7 @@ func (b *Bridge) Send(msg BridgeMessage) error { return coreerr.E("bridge.Send", "not connected", nil) } msg.Timestamp = time.Now() - data, err := json.Marshal(msg) - if err != nil { - return coreerr.E("bridge.Send", "marshal failed", err) - } + data := []byte(core.JSONMarshalString(msg)) return b.conn.WriteMessage(websocket.TextMessage, data) } @@ -158,8 +155,8 @@ func (b *Bridge) readLoop(ctx context.Context) { } var msg BridgeMessage - if err := json.Unmarshal(data, &msg); err != nil { - coreerr.Warn("ide bridge: unmarshal error", "err", err) + if r := core.JSONUnmarshal(data, &msg); !r.OK { + coreerr.Warn("ide bridge: unmarshal error") continue }