fix(sdk): resolve gateway tools independently so one dead tool no longer fails the whole agent - #5813
fix(sdk): resolve gateway tools independently so one dead tool no longer fails the whole agent#5813mmabrouk wants to merge 1 commit into
Conversation
…ger fails the whole agent Gateway (Composio) tool resolution was all-or-nothing: the resolver sent every gateway reference in one batched POST /tools/resolve, so a single stale action that 404s (F-019) failed the entire batch and bricked the agent run at startup. Resolve each gateway config independently in ToolResolver instead. A tool that fails to resolve is dropped and recorded as a warning that names it (reusing the existing named GatewayToolResolutionError, which already carries the backend's 404 reason); the tools that resolve are kept and the run proceeds. The warnings are logged and returned on ResolvedToolSet.warnings so a degraded resolution is never silent. Non-gateway tools and the AgentaGatewayToolResolver HTTP contract are unchanged. Fixes #5173
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
|
What
Gateway (Composio) tool resolution was all-or-nothing. When an agent has several gateway tools and one fails to resolve (for example a Composio action that has left the catalog and now 404s — the F-019 case), the entire agent run failed at startup.
The opaque-error half of this bug was fixed earlier (the error now names the failing action). This PR fixes the remaining half: one dead tool should degrade the agent, not brick it.
How
ToolResolver.resolveused to hand the whole batch of gateway configs to the resolver in one call; any single/tools/resolvenon-2xx failed all of them. It now resolves each gateway config independently (onegateway_resolver.resolve([config])call per tool) and collects failures:GatewayToolResolutionError(which already carries the backend's 404 reason and the actionable remedy).log.warning-surfaced and returned on the newResolvedToolSet.warnings, so a degraded resolution is never silent.The seam is deliberately one level above the HTTP adapter:
AgentaGatewayToolResolver's wire contract (batched request, per-ref validation, error shaping) is unchanged, and so is the behavior for non-gateway tools.Before / after
Test
Added
test_one_dead_gateway_tool_is_dropped_and_the_rest_resolve(and a clean-resolve companion) totest_resolver.py: given two gateway tools where one resolves and one 404s, the resolver returns the good tool plus a named warning and does not raise. Fullagents/toolsandagents/platformsuites pass (242 passed, 1 skipped); existingAgentaGatewayToolResolverHTTP tests are untouched and green.Fixes #5173