From 2c8845f7045fc8a2159a063385d1c2bafbbecb89 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 17 Apr 2026 19:21:32 +0800 Subject: [PATCH] fix(rpc): align envelopes for better frontend compatibility and fix legacy field mapping --- internal/shared/rpc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/shared/rpc.go b/internal/shared/rpc.go index 281a314..a4878d1 100644 --- a/internal/shared/rpc.go +++ b/internal/shared/rpc.go @@ -54,6 +54,7 @@ func ResultEnvelope(id any, result map[string]any) map[string]any { "type": "res", "ok": true, "payload": result, + "seq": 0, } } @@ -69,6 +70,8 @@ func ErrorEnvelope(id any, code int, message string) map[string]any { // Backward compatibility with legacy GatewayRuntime "type": "res", "ok": false, + "payload": nil, + "seq": 0, } } @@ -81,6 +84,7 @@ func NotificationEnvelope(method string, params map[string]any) map[string]any { "type": "event", "event": method, "payload": params, + "seq": 0, } }