sidechat_manager: Fix CDP id mismatch\n\n_e() used id=100, muse-chat-api.py ev() uses id=1.\nOn shared websocket, responses mismatched.

This commit is contained in:
operator-main
2026-10-04 03:16:10 +00:00
parent 2074145e22
commit 7a6e54fed2
+5 -2
View File
@@ -14,10 +14,13 @@ import time
import json import json
def _ev(ws, js, await_result=True): def _ev(ws, js, await_result=True):
"""Evaluate JS via CDP, return result.""" """Evaluate JS via CDP, return result.
Uses id=1 to match muse-chat-api.py's ev() on shared websocket.
Fixed 2026-10-04: was using id=100, causing response mismatch.
"""
import json as _json import json as _json
ws.send(_json.dumps({ ws.send(_json.dumps({
"id": 100, "method": "Runtime.evaluate", "id": 1, "method": "Runtime.evaluate",
"params": {"expression": js, "awaitPromise": True} "params": {"expression": js, "awaitPromise": True}
})) }))
resp = _json.loads(ws.recv()) resp = _json.loads(ws.recv())