Skip to content

Comments

[feat] Add gateway tools#3786

Open
junaway wants to merge 25 commits intomainfrom
feat/add-gateway-tools
Open

[feat] Add gateway tools#3786
junaway wants to merge 25 commits intomainfrom
feat/add-gateway-tools

Conversation

@junaway
Copy link
Contributor

@junaway junaway commented Feb 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 19, 2026 14:01
@vercel
Copy link

vercel bot commented Feb 19, 2026

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Feb 19, 2026 5:09pm

Request Review

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Feb 19, 2026
@junaway junaway marked this pull request as draft February 19, 2026 14:01

This comment was marked as resolved.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 91 out of 105 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 19, 2026 17:08
@junaway junaway marked this pull request as ready for review February 19, 2026 17:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 98 out of 108 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +917 to +920
raise ConnectionNotFoundError(
connection_slug=connection_slug,
detail="Connection has no provider connection ID.",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 ConnectionNotFoundError called with unsupported detail keyword argument

When a connection exists but has no provider_connection_id, the code at router.py:917-920 raises ConnectionNotFoundError(connection_slug=connection_slug, detail="Connection has no provider connection ID."). However, ConnectionNotFoundError.__init__ (at api/oss/src/core/tools/exceptions.py:23-40) only accepts provider_key, integration_key, connection_slug, and connection_id — it does not accept a detail parameter.

Root Cause

The ConnectionNotFoundError constructor signature is:

def __init__(self, *, provider_key=None, integration_key=None, connection_slug=None, connection_id=None):

But the call site passes detail=... which is not a valid keyword argument. This will raise:

TypeError: ConnectionNotFoundError.__init__() got an unexpected keyword argument 'detail'

Impact: Any tool call (POST /call) targeting a connection that exists but lacks a provider_connection_id will crash with an unhandled TypeError instead of returning a clean 404 error. The TypeError propagates to @intercept_exceptions which returns a generic 500.

Suggested change
raise ConnectionNotFoundError(
connection_slug=connection_slug,
detail="Connection has no provider connection ID.",
)
raise ConnectionNotFoundError(
connection_slug=connection_slug,
provider_key=provider_key,
integration_key=integration_key,
)
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +464 to +473
action_response = await self.get_action(
request=request,
provider_key=provider_key,
integration_key=integration_key,
action_key=action.key,
full_details=full_details,
)
if action_response.action:
items.append(action_response.action)
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 list_actions crashes with AttributeError when get_action returns JSONResponse (404)

When list_actions is called with full_details=True, it iterates over actions and calls self.get_action(...) for each one (line 464). If the action is not found, get_action returns a JSONResponse object (line 534). The code then accesses action_response.action (line 471), but JSONResponse has no .action attribute, causing an AttributeError.

Root Cause

The get_action method at api/oss/src/apis/fastapi/tools/router.py:533-537 returns a JSONResponse for 404:

if not action:
    return JSONResponse(
        status_code=404,
        content={"detail": "Action not found"},
    )

But the caller at line 471 assumes the return is always a ToolCatalogActionResponse:

if action_response.action:  # AttributeError: 'JSONResponse' has no attribute 'action'

Impact: Any GET /catalog/providers/{p}/integrations/{i}/actions/?full_details=true request where at least one action detail lookup returns 404 will crash with an unhandled AttributeError, resulting in a 500 error for the entire list request.

Suggested change
action_response = await self.get_action(
request=request,
provider_key=provider_key,
integration_key=integration_key,
action_key=action.key,
full_details=full_details,
)
if action_response.action:
items.append(action_response.action)
continue
action_response = await self.get_action(
request=request,
provider_key=provider_key,
integration_key=integration_key,
action_key=action.key,
full_details=full_details,
)
if isinstance(action_response, ToolCatalogActionResponse) and action_response.action:
items.append(action_response.action)
continue
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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

Labels

Backend feature size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants