@devries-cameron20 / composio-1 / commits / 16fbcb92f
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

style(python): format custom tool routing changes

Dhawal Upadhyay committed Mar 24, 2026 at 15:08 UTC 16fbcb92f5bc580b1d6c1f810fff15fbcc32040d
2 files changed +10 -6
python/composio/core/models/tool_router_session.py
+6 -2
@@ -328,7 +328,9 @@ class ToolRouterSession(t.Generic[TTool, TToolCollection]):
328 remote_data_raw = (remote_result or {}).get("data")
329 remote_data = remote_data_raw if isinstance(remote_data_raw, dict) else {}
330 remote_results_list = (
331 - remote_data.get("results", []) if isinstance(remote_data.get("results"), list) else []
331 + remote_data.get("results", [])
332 + if isinstance(remote_data.get("results"), list)
333 + else []
334 )
335 all_results = [
336 {**entry, "index": i}
@@ -340,7 +342,9 @@ class ToolRouterSession(t.Generic[TTool, TToolCollection]):
342 if remote_result and remote_result.get("error") is not None
343 else None
344 )
343 - has_any_error = any(r.get("error") for _, r in local_results) or bool(remote_error)
345 + has_any_error = any(r.get("error") for _, r in local_results) or bool(
346 + remote_error
347 + )
348 failed = sum(1 for r in all_results if r.get("error"))
349 error_message = None
350 if has_any_error:
python/tests/test_custom_tools.py
+4 -4
@@ -573,10 +573,10 @@ class TestToolRouterSessionCustomTools:
573 assert result.log_id == "log_123"
574
575 def test_proxy_execute(self, mock_session_deps):
576 - mock_session_deps["client"].tool_router.session.proxy_execute.return_value = (
577 - SessionProxyExecuteResponse(
578 - status=200, data={"ok": True}, headers={}, binary_data=None
579 - )
576 + mock_session_deps[
577 + "client"
578 + ].tool_router.session.proxy_execute.return_value = SessionProxyExecuteResponse(
579 + status=200, data={"ok": True}, headers={}, binary_data=None
580 )
581 s = _session(mock_session_deps)
582 result = s.proxy_execute(