@@ -39,11 +39,25 @@ def _resolve_runtime_socket_path(agent_id: str) -> str:
3939 Mirrors ``aa-ffi-python``'s ``AssemblyConfig::resolve_socket_path``: the
4040 ``AA_RUNTIME_SOCKET`` environment variable takes precedence, otherwise the
4141 per-agent default ``/tmp/aa-runtime-<agent_id>.sock`` is used.
42+
43+ Note: the ``/tmp/aa-runtime-<agent_id>.sock`` literal mirrors the canonical
44+ path baked into ``aa-sdk-client::AssemblyConfig::resolve_socket_path`` on the
45+ Rust side. This path is the SDK↔runtime IPC contract: ``aa-runtime`` binds
46+ the UDS server here and every SDK (Python, Node, Go) connects here. The SDK
47+ only *connects* to a path the runtime created; it never writes the socket
48+ itself. Operators who need to relocate the socket (e.g. multi-tenant hosts)
49+ set ``AA_RUNTIME_SOCKET`` to override. Replacing the literal with
50+ ``tempfile.gettempdir()`` would break interop on platforms where it does not
51+ resolve to ``/tmp`` (notably macOS dev hosts).
4252 """
4353 env_path = os .environ .get (ENV_RUNTIME_SOCKET )
4454 if env_path :
4555 return env_path
46- return f"/tmp/aa-runtime-{ agent_id } .sock"
56+ # IPC contract path (see docstring above). The SDK is a *client* of a
57+ # socket the runtime creates; this code never writes to /tmp itself.
58+ # SonarCloud python:S5443 is suppressed project-wide for this file via
59+ # sonar-project.properties; ruff S108 is suppressed inline below.
60+ return f"/tmp/aa-runtime-{ agent_id } .sock" # noqa: S108
4761
4862
4963def _extract_tool_name (serialized : Any , kwargs : dict [str , Any ]) -> str | None :
0 commit comments