fix(tools): remove 10 dead actions referencing mutations absent from live API

settings.py: drop update_temperature, update_time, update_api,
connect_sign_in, connect_sign_out, setup_remote_access,
enable_dynamic_remote_access, update_ssh — all 8 reference mutations
confirmed absent from Unraid API v4.29.2. Keep update + configure_ups.

info.py: drop update_server (updateServerIdentity not in Mutation type)
and update_ssh (duplicate of removed settings action). MUTATIONS is now
empty; DESTRUCTIVE_ACTIONS is now an empty set.

notifications.py: drop create_unique (notifyIfUnique not in Mutation type).

Tests: remove corresponding test classes, add parametrized regression
tests asserting removed actions are not in each tool's Literal type,
update KNOWN_DESTRUCTIVE and _DESTRUCTIVE_TEST_CASES in safety audit,
update schema coverage assertions. 858 tests passing, 0 failures.
This commit is contained in:
Jacob Magar
2026-03-15 23:21:25 -04:00
parent c37d4b1c5a
commit 4b43c47091
8 changed files with 59 additions and 661 deletions

View File

@@ -91,9 +91,6 @@ KNOWN_DESTRUCTIVE: dict[str, dict[str, set[str] | str]] = {
"tool_name": "unraid_settings",
"actions": {
"configure_ups",
"setup_remote_access",
"enable_dynamic_remote_access",
"update_ssh",
},
"runtime_set": SETTINGS_DESTRUCTIVE,
},
@@ -222,7 +219,6 @@ _DESTRUCTIVE_TEST_CASES: list[tuple[str, str, dict]] = [
),
# Settings
("settings", "configure_ups", {"ups_config": {"mode": "slave"}}),
("settings", "update_ssh", {"ssh_enabled": True, "ssh_port": 22}),
# Plugins
("plugins", "remove", {"names": ["my-plugin"]}),
]
@@ -461,16 +457,6 @@ class TestConfirmAllowsExecution:
)
assert result["success"] is True
async def test_settings_update_ssh_with_confirm(
self, _mock_settings_graphql: AsyncMock
) -> None:
_mock_settings_graphql.return_value = {"updateSshSettings": {"useSsh": True, "portssh": 22}}
tool_fn = make_tool_fn(
"unraid_mcp.tools.settings", "register_settings_tool", "unraid_settings"
)
result = await tool_fn(action="update_ssh", confirm=True, ssh_enabled=True, ssh_port=22)
assert result["success"] is True
async def test_array_remove_disk_with_confirm(self, _mock_array_graphql: AsyncMock) -> None:
_mock_array_graphql.return_value = {"array": {"removeDiskFromArray": {"state": "STOPPED"}}}
tool_fn = make_tool_fn("unraid_mcp.tools.array", "register_array_tool", "unraid_array")