refactor(ws): rename agent_ids to scout_ids in device_hello frame
WsDeviceHello.agent_ids → scout_ids in Pydantic schema, device_ws.py handler, and all test fixtures (test_device_ws, test_ws_unified, test_memory_middleware). Also fixes stale CloudAgentConfig reference in gmail.py docstring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,9 +33,9 @@ _FREE_UID = TEST_USER_IDS["free"]
|
||||
_PRO_UID = TEST_USER_IDS["pro"]
|
||||
|
||||
|
||||
def _device_hello(device_id: str = "dev-001", agent_ids: list[str] | None = None) -> str:
|
||||
def _device_hello(device_id: str = "dev-001", scout_ids: list[str] | None = None) -> str:
|
||||
return json.dumps(
|
||||
{"type": "device_hello", "device_id": device_id, "agent_ids": agent_ids or []}
|
||||
{"type": "device_hello", "device_id": device_id, "scout_ids": scout_ids or []}
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ def test_home_request_calls_memory_middleware(client):
|
||||
):
|
||||
with client.websocket_connect(f"/api/v1/ws/device?token={token}") as ws:
|
||||
ws.send_text(json.dumps({
|
||||
"type": "device_hello", "device_id": "dev-mem", "agent_ids": []
|
||||
"type": "device_hello", "device_id": "dev-mem", "scout_ids": []
|
||||
}))
|
||||
ws.send_text(json.dumps({
|
||||
"type": "home_request",
|
||||
|
||||
@@ -58,7 +58,7 @@ def test_home_request_produces_stream_frames(client):
|
||||
with patch("app.api.routes.device_ws.run_home_stream", side_effect=_mock_home_stream):
|
||||
with client.websocket_connect(f"/api/v1/ws/device?token={token}") as ws:
|
||||
ws.send_text(json.dumps({
|
||||
"type": "device_hello", "device_id": "dev-1", "agent_ids": []
|
||||
"type": "device_hello", "device_id": "dev-1", "scout_ids": []
|
||||
}))
|
||||
ws.send_text(json.dumps({
|
||||
"type": "home_request",
|
||||
@@ -85,7 +85,7 @@ def test_home_request_request_id_propagated(client):
|
||||
with patch("app.api.routes.device_ws.run_home_stream", side_effect=_stream):
|
||||
with client.websocket_connect(f"/api/v1/ws/device?token={token}") as ws:
|
||||
ws.send_text(json.dumps({
|
||||
"type": "device_hello", "device_id": "dev-3", "agent_ids": []
|
||||
"type": "device_hello", "device_id": "dev-3", "scout_ids": []
|
||||
}))
|
||||
ws.send_text(json.dumps({
|
||||
"type": "home_request",
|
||||
@@ -106,7 +106,7 @@ def test_tool_result_dispatch_silent_on_unknown_id(client):
|
||||
with patch("app.api.routes.device_ws._HEARTBEAT_INTERVAL", 0.05):
|
||||
with client.websocket_connect(f"/api/v1/ws/device?token={token}") as ws:
|
||||
ws.send_text(json.dumps({
|
||||
"type": "device_hello", "device_id": "dev-4", "agent_ids": []
|
||||
"type": "device_hello", "device_id": "dev-4", "scout_ids": []
|
||||
}))
|
||||
ws.send_text(json.dumps({
|
||||
"type": "tool_result", "id": "no-such-id", "ok": True
|
||||
|
||||
Reference in New Issue
Block a user