Default execManagedNe read_timeout_sec to 60 seconds.

Align MCP CLI calls with the API default so slow show commands are less likely to fail before the device responds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-10 22:40:19 +08:00
parent 9457ac9353
commit 84f16fcb3c
2 changed files with 20 additions and 4 deletions

View file

@ -99,6 +99,21 @@ def test_call_find_topology_paths_defaults_summary_detail() -> None:
assert payload["ok"] is True
def test_call_exec_managed_ne_defaults_read_timeout() -> None:
with patch("netx_mcp.http_tools.http_post_json") as mock_post:
mock_post.return_value = {"ok": True, "data": {"ok": True, "output": "hi"}}
out = call_http_tool(
"execManagedNe",
{"ume_ne_id": "u1", "commands": ["show version"]},
)
mock_post.assert_called_once()
body = mock_post.call_args[0][1]
assert body["read_timeout_sec"] == 60
assert body["ume_ne_id"] == "u1"
payload = json.loads(out["content"][0]["text"])
assert payload["ok"] is True
def test_call_get_ume_ne_requires_id() -> None:
out = call_http_tool("getUmeNe", {})
assert out.get("isError") is True