Skip to content

fix(sdk): resolve gateway tools independently so one dead tool no longer fails the whole agent - #5813

Open
mmabrouk wants to merge 1 commit into
release/v0.110.0from
fix/composio-partial-resolution-5173
Open

fix(sdk): resolve gateway tools independently so one dead tool no longer fails the whole agent#5813
mmabrouk wants to merge 1 commit into
release/v0.110.0from
fix/composio-partial-resolution-5173

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Aug 7, 2026

Copy link
Copy Markdown
Member

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.resolve used to hand the whole batch of gateway configs to the resolver in one call; any single /tools/resolve non-2xx failed all of them. It now resolves each gateway config independently (one gateway_resolver.resolve([config]) call per tool) and collects failures:

  • 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 and the actionable remedy).
  • The tools that do resolve are kept and the run proceeds.
  • Warnings are log.warning-surfaced and returned on the new ResolvedToolSet.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

  • Before: two gateway tools, one 404s → resolution raises → whole agent run fails at startup.
  • After: two gateway tools, one 404s → the good tool resolves, the dead one is dropped with a named warning, the run proceeds.

Test

Added test_one_dead_gateway_tool_is_dropped_and_the_rest_resolve (and a clean-resolve companion) to test_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. Full agents/tools and agents/platform suites pass (242 passed, 1 skipped); existing AgentaGatewayToolResolver HTTP tests are untouched and green.

Fixes #5173

…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
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 7, 2026
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 7, 2026 7:10pm

Request Review

@dosubot dosubot Bot added bug report Something isn't working python Pull requests that update Python code labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f389b22-e94b-4125-9467-208fbd6d0648

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-5813.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-5813-78fafd4
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-08-07T19:19:45.861Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug report Something isn't working python Pull requests that update Python code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant