From 2f9768b371e0cefaa0fa6eac69371d0a83689219 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Thu, 19 Feb 2026 15:53:59 +0200 Subject: [PATCH] fix: register Linear tools in TOOLS_WITH_UI and make GraphQL calls async - Add create_linear_issue, update_linear_issue, delete_linear_issue to TOOLS_WITH_UI so the HIL approval cards are correctly dispatched to the Linear tool-ui components (without this the interrupt cards were never rendered) - Replace blocking requests.post with httpx.AsyncClient in LinearConnector.execute_graphql_query to avoid stalling the asyncio event loop during live streaming; remove now-unused requests import --- surfsense_backend/app/connectors/linear_connector.py | 6 ++++-- .../[search_space_id]/new-chat/[[...chat_id]]/page.tsx | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/surfsense_backend/app/connectors/linear_connector.py b/surfsense_backend/app/connectors/linear_connector.py index a32fff5e7..16115c159 100644 --- a/surfsense_backend/app/connectors/linear_connector.py +++ b/surfsense_backend/app/connectors/linear_connector.py @@ -10,7 +10,6 @@ from datetime import datetime from typing import Any import httpx -import requests from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.future import select @@ -274,7 +273,10 @@ class LinearConnector: if variables: payload["variables"] = variables - response = requests.post(self.api_url, headers=headers, json=payload) + async with httpx.AsyncClient() as client: + response = await client.post( + self.api_url, headers=headers, json=payload, timeout=30.0 + ) if response.status_code == 200: return response.json() diff --git a/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx index 975aac4cc..dd11382a8 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx @@ -148,6 +148,9 @@ const TOOLS_WITH_UI = new Set([ "scrape_webpage", "create_notion_page", "update_notion_page", + "create_linear_issue", + "update_linear_issue", + "delete_linear_issue", // "write_todos", // Disabled for now ]);