style: ruff format after MCP server integration

Reformat the files touched by Tasks 1-14 of the host-agent MCP server
plan. No semantic changes; pre-existing format issues in unrelated
files (test_templates, test_skill_sync_wiring, 0010_skill_management,
test_skill_catalog_mcp) left untouched for a separate housekeeping
pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 15:52:32 +08:00
co-authored by Claude Opus 4.6
parent 6d9237a592
commit e69cea0245
16 changed files with 60 additions and 62 deletions
@@ -51,8 +51,7 @@ class AssignmentExecutor:
return AssignmentExecutionResult(
status="failed",
failure_reason=(
f"device {assignment.device_id} is held by an active "
"MCP session"
f"device {assignment.device_id} is held by an active MCP session"
),
)
with bind_planner_execution_context(assignment):
@@ -57,9 +57,7 @@ class McpBusyTracker:
lease = McpDeviceLease(
device_id=device_id,
session_id=session_id,
acquired_at=(
existing.acquired_at if existing is not None else now
),
acquired_at=(existing.acquired_at if existing is not None else now),
last_seen_at=now,
)
self._leases[device_id] = lease
@@ -154,4 +152,4 @@ class McpBusyTracker:
if (cutoff - lease.last_seen_at).total_seconds() > self._ttl
]
for device_id in expired:
del self._leases[device_id]
del self._leases[device_id]
@@ -74,9 +74,7 @@ class McpTokenStore:
created_at=datetime.fromisoformat(str(data["created_at"])),
)
except (KeyError, TypeError, ValueError) as exc:
raise McpTokenStoreError(
f"MCP token file schema invalid: {exc}"
) from exc
raise McpTokenStoreError(f"MCP token file schema invalid: {exc}") from exc
def _generate_and_write(self) -> McpToken:
token = McpToken(
+2 -4
View File
@@ -141,9 +141,7 @@ def _wrap_tool(
return _with_display_status(handler, status_tracker, *args, **kwargs)
if device_id is not None and tool_name not in _NON_DEVICE_TOOLS:
_check_and_acquire(
device_id, session_id, mcp_busy_tracker, status_tracker
)
_check_and_acquire(device_id, session_id, mcp_busy_tracker, status_tracker)
return handler(*args, **kwargs)
@@ -254,4 +252,4 @@ def _call_tool_sync(
raise KeyError(f"tool {tool_name!r} has no callable")
return fn(**arguments)
finally:
_TEST_SESSION_ID.reset(token)
_TEST_SESSION_ID.reset(token)