From 7034ada9dcb286c59424854d6cb3fa4610a3c08f Mon Sep 17 00:00:00 2001 From: Bruno Clermont Date: Sat, 4 Jul 2026 11:46:24 -0400 Subject: [PATCH 1/2] fix(ws): use camelCase param names matching goclaw's WS API convention goclaw's WebSocket RPC methods expect camelCase param names matching Go struct json tags (agentId, sessionKey), not snake_case (agent_key, session_key). Fixed all WS calls sending the old snake_case names: chat.send, chat.abort, sessions.list, sessions.reset, chat.inject, chat.session.status, chat.history. --- cmd/chat.go | 18 +++++++++--------- cmd/chat_ai_commands.go | 12 ++++++------ cmd/chat_replay.go | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmd/chat.go b/cmd/chat.go index ca2a4d8..2c31ee1 100644 --- a/cmd/chat.go +++ b/cmd/chat.go @@ -64,11 +64,11 @@ func chatSingleShot(agentKey, message, session string, noStream bool) error { defer ws.Close() params := map[string]any{ - "agent_key": agentKey, - "message": message, + "agentId": agentKey, + "message": message, } if session != "" { - params["session_key"] = session + params["sessionKey"] = session } if noStream || cfg.OutputFormat == "json" { @@ -151,11 +151,11 @@ func chatInteractive(agentKey, session string) error { fmt.Println("Goodbye!") return nil case "/abort": - _, _ = ws.Call("chat.abort", map[string]any{"agent_key": agentKey}) + _, _ = ws.Call("chat.abort", map[string]any{"agentId": agentKey}) fmt.Println("[aborted]") continue case "/sessions": - resp, err := ws.Call("sessions.list", map[string]any{"agent_key": agentKey}) + resp, err := ws.Call("sessions.list", map[string]any{"agentId": agentKey}) if err != nil { fmt.Printf("Error: %s\n", err) continue @@ -164,18 +164,18 @@ func chatInteractive(agentKey, session string) error { continue case "/clear": if session != "" { - _, _ = ws.Call("sessions.reset", map[string]any{"session_key": session}) + _, _ = ws.Call("sessions.reset", map[string]any{"sessionKey": session}) fmt.Println("[session cleared]") } continue } params := map[string]any{ - "agent_key": agentKey, - "message": input, + "agentId": agentKey, + "message": input, } if session != "" { - params["session_key"] = session + params["sessionKey"] = session } _, err := ws.Stream("chat.send", params, func(e *client.WSEvent) { diff --git a/cmd/chat_ai_commands.go b/cmd/chat_ai_commands.go index 1cced47..cbc1d1e 100644 --- a/cmd/chat_ai_commands.go +++ b/cmd/chat_ai_commands.go @@ -104,12 +104,12 @@ Examples: defer ws.Close() params := map[string]any{ - "agent_key": args[0], - "role": role, - "content": content, + "agentId": args[0], + "role": role, + "content": content, } if session != "" { - params["session_key"] = session + params["sessionKey"] = session } data, err := ws.Call("chat.inject", params) @@ -155,9 +155,9 @@ Examples: } defer ws.Close() - params := map[string]any{"agent_key": args[0]} + params := map[string]any{"agentId": args[0]} if session != "" { - params["session_key"] = session + params["sessionKey"] = session } data, err := ws.Call("chat.session.status", params) diff --git a/cmd/chat_replay.go b/cmd/chat_replay.go index 4d988fb..29d3d8e 100644 --- a/cmd/chat_replay.go +++ b/cmd/chat_replay.go @@ -25,14 +25,14 @@ func runChatHistory(agent, session, before string, limit int) error { defer ws.Close() params := map[string]any{ - "agent_key": agent, - "limit": limit, + "agentId": agent, + "limit": limit, } if before != "" { params["before"] = before } if session != "" { - params["session_key"] = session + params["sessionKey"] = session } data, err := ws.Call("chat.history", params) From f7ded46249624550210baeb033cb14fff32cb15f Mon Sep 17 00:00:00 2001 From: Bruno Clermont Date: Sat, 4 Jul 2026 11:46:24 -0400 Subject: [PATCH 2/2] fix(client): increase WS call timeout from 30s to 300s Some operations (e.g. long-running agent turns) exceeded the previous 30s WS call timeout. Increased to 300s to accommodate slower responses. --- internal/client/websocket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/client/websocket.go b/internal/client/websocket.go index 3000370..999bee1 100644 --- a/internal/client/websocket.go +++ b/internal/client/websocket.go @@ -146,7 +146,7 @@ func (ws *WSClient) Call(method string, params any) (json.RawMessage, error) { return nil, resp.Error } return resp.Payload, nil - case <-time.After(30 * time.Second): + case <-time.After(300 * time.Second): return nil, fmt.Errorf("timeout waiting for response to %s", method) case <-ws.done: return nil, fmt.Errorf("connection closed")