Skip to content

Comments

[feat] Add gateway tools - Railway preview test#3789

Closed
mmabrouk wants to merge 26 commits intoci/railway-preview-environmentsfrom
ci/railway-preview-with-gateway-tools
Closed

[feat] Add gateway tools - Railway preview test#3789
mmabrouk wants to merge 26 commits intoci/railway-preview-environmentsfrom
ci/railway-preview-with-gateway-tools

Conversation

@mmabrouk
Copy link
Member

@mmabrouk mmabrouk commented Feb 19, 2026

Summary

Purpose

Validate the full Railway preview CI pipeline with a real feature branch (gateway tools + Composio integration).

What to check

  • Preview deploys successfully with the new tools API endpoints
  • /w, /api/health, /services/health return 200
  • New Alembic migration (add_tool_connections_table) runs cleanly

Open with Devin

@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 7:24pm

Request Review

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Feb 19, 2026
@dosubot dosubot bot added the Backend label Feb 19, 2026
@dosubot dosubot bot added the feature label Feb 19, 2026
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 causes TypeError

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

Root Cause

The ConnectionNotFoundError constructor signature is:

def __init__(
    self,
    *,
    provider_key: Optional[str] = None,
    integration_key: Optional[str] = None,
    connection_slug: Optional[str] = None,
    connection_id: Optional[str] = None,
):

But the call site passes detail=... which is not one of the accepted keyword arguments. Since the constructor uses * (keyword-only), Python will raise TypeError: ConnectionNotFoundError.__init__() got an unexpected keyword argument 'detail'.

Impact: When a user calls a tool whose connection exists but has no provider_connection_id (e.g. a pending OAuth connection), instead of the intended 404 response, the server crashes with an unhandled TypeError which propagates as a 500 error.

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 for a missing action

When full_details=True, the list_actions handler at api/oss/src/apis/fastapi/tools/router.py:464 calls self.get_action(...) for each action and then accesses action_response.action at line 471. However, get_action can return a JSONResponse (at line 534) when the action is not found. JSONResponse has no .action attribute, so this will raise an AttributeError.

Root Cause

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

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

But the caller at line 464-472 assumes the return is always a ToolCatalogActionResponse:

action_response = await self.get_action(...)
if action_response.action:  # AttributeError on JSONResponse
    items.append(action_response.action)

This can happen when the Composio list endpoint returns an action that the detail endpoint subsequently reports as missing (e.g. recently deprecated action, eventual consistency between Composio endpoints).

Impact: Any request to GET .../actions/?full_details=true where at least one action cannot be fetched individually will crash with an unhandled AttributeError, resulting in a 500 error instead of gracefully skipping the unavailable action.

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.

@github-actions
Copy link

github-actions bot commented Feb 19, 2026

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-02-19T20:01:51.763Z

@mmabrouk mmabrouk closed this Feb 19, 2026
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