Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| raise ConnectionNotFoundError( | ||
| connection_slug=connection_slug, | ||
| detail="Connection has no provider connection ID.", | ||
| ) |
There was a problem hiding this comment.
🔴 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.
| 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, | |
| ) |
Was this helpful? React with 👍 or 👎 to provide feedback.
| 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 |
There was a problem hiding this comment.
🔴 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.
| 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 |
Was this helpful? React with 👍 or 👎 to provide feedback.
No description provided.