Skip to content

Commit ed0ebe1

Browse files
[autofix.ci] apply automated fixes
1 parent 9afc891 commit ed0ebe1

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

src/backend/base/langflow/api/v1/mcp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ async def handle_global_call_tool(name: str, arguments: dict) -> list[types.Text
5858
sse = SseServerTransport("/api/v1/mcp/")
5959
streamable_http_manager = StreamableHTTPSessionManager(server)
6060

61+
6162
def find_validation_error(exc):
6263
"""Searches for a pydantic.ValidationError in the exception chain."""
6364
while exc:
@@ -154,7 +155,10 @@ async def _dispatch_streamable_http(
154155

155156
return Response()
156157

158+
157159
streamable_http_methods = ["GET", "POST", "DELETE"]
160+
161+
158162
@router.api_route("/streamable", methods=streamable_http_methods)
159163
@router.api_route("/streamable/", methods=streamable_http_methods)
160164
async def handle_streamable_http(request: Request, current_user: CurrentActiveMCPUser):

src/backend/base/langflow/api/v1/mcp_projects.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
)
7878

7979

80-
8180
async def verify_project_auth(
8281
db: AsyncSession,
8382
project_id: UUID,
@@ -212,7 +211,6 @@ def get_project_sse(project_id: UUID | None) -> SseServerTransport:
212211
return project_sse_transports[project_id_str]
213212

214213

215-
216214
async def _build_project_tools_response(
217215
project_id: UUID,
218216
current_user: CurrentActiveMCPUser,
@@ -337,9 +335,7 @@ async def _dispatch_project_streamable_http(
337335
except HTTPException:
338336
raise
339337
except Exception as exc:
340-
await logger.aexception(
341-
f"Error handling Streamable HTTP request for project {project_id}: {exc!s}"
342-
)
338+
await logger.aexception(f"Error handling Streamable HTTP request for project {project_id}: {exc!s}")
343339
raise HTTPException(status_code=500, detail="Internal server error in project MCP transport") from exc
344340
finally:
345341
current_request_variables_ctx.reset(request_vars_token)

src/backend/tests/unit/api/v1/test_mcp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ async def test_find_validation_error_with_pydantic_error():
192192
# Create a pydantic ValidationError by catching it
193193
validation_error = None
194194
try:
195+
195196
class TestModel(pydantic.BaseModel):
196197
required_field: str
197198

@@ -226,6 +227,7 @@ async def test_find_validation_error_with_context():
226227
# Create a pydantic ValidationError by catching it
227228
validation_error = None
228229
try:
230+
229231
class TestModel(pydantic.BaseModel):
230232
required_field: str
231233

@@ -263,8 +265,10 @@ async def test_mcp_sse_validation_error_logged():
263265
# Verify the function exists and works
264266
validation_error = None
265267
try:
268+
266269
class TestModel(pydantic.BaseModel):
267270
required_field: str
271+
268272
TestModel()
269273
except pydantic.ValidationError as e:
270274
validation_error = e

src/backend/tests/unit/api/v1/test_mcp_projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ def _prepare_install_test_env(monkeypatch, tmp_path, filename="cursor.json"):
602602
config_path.parent.mkdir(parents=True, exist_ok=True)
603603

604604
monkeypatch.setattr("langflow.api.v1.mcp_projects.get_client_ip", lambda request: "127.0.0.1")
605+
605606
async def fake_get_config_path(client_name):
606607
return config_path
607608

src/lfx/src/lfx/services/mcp_composer/service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ class MCPComposerService(Service):
7373

7474
def __init__(self):
7575
super().__init__()
76-
self.project_composers: dict[str, dict] = {} # project_id -> {process, host, port, streamable_http_url, auth_config}
76+
self.project_composers: dict[
77+
str, dict
78+
] = {} # project_id -> {process, host, port, streamable_http_url, auth_config}
7779
self._start_locks: dict[
7880
str, asyncio.Lock
7981
] = {} # Lock to prevent concurrent start operations for the same project
@@ -1045,9 +1047,7 @@ async def _do_start_project_composer(
10451047

10461048
project_host = auth_config.get("oauth_host") if auth_config else "unknown"
10471049
project_port = auth_config.get("oauth_port") if auth_config else "unknown"
1048-
await logger.adebug(
1049-
f"Starting MCP Composer for project {project_id} on {project_host}:{project_port}"
1050-
)
1050+
await logger.adebug(f"Starting MCP Composer for project {project_id} on {project_host}:{project_port}")
10511051

10521052
# Use a per-project lock to prevent race conditions
10531053
if project_id not in self._start_locks:

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)