fix: resolve graphql complexity, json extraction, kb sync, and ui prefill for linear HIL

This commit is contained in:
CREDO23 2026-02-19 18:30:20 +02:00
parent d4e2ebb99f
commit c8413ee2bf
12 changed files with 269 additions and 213 deletions

View file

@ -5,7 +5,7 @@ from langchain_core.tools import tool
from langgraph.types import interrupt
from sqlalchemy.ext.asyncio import AsyncSession
from app.connectors.linear_connector import LinearConnector
from app.connectors.linear_connector import LinearAPIError, LinearConnector
from app.services.linear import LinearToolMetadataService
logger = logging.getLogger(__name__)
@ -230,11 +230,10 @@ def create_create_linear_issue_tool(
raise
logger.error(f"Error creating Linear issue: {e}", exc_info=True)
return {
"status": "error",
"message": str(e)
if isinstance(e, ValueError)
else f"Unexpected error: {e!s}",
}
if isinstance(e, (ValueError, LinearAPIError)):
message = str(e)
else:
message = "Something went wrong while creating the issue. Please try again."
return {"status": "error", "message": message}
return create_linear_issue

View file

@ -5,7 +5,7 @@ from langchain_core.tools import tool
from langgraph.types import interrupt
from sqlalchemy.ext.asyncio import AsyncSession
from app.connectors.linear_connector import LinearConnector
from app.connectors.linear_connector import LinearAPIError, LinearConnector
from app.services.linear import LinearToolMetadataService
logger = logging.getLogger(__name__)
@ -253,11 +253,10 @@ def create_delete_linear_issue_tool(
raise
logger.error(f"Error deleting Linear issue: {e}", exc_info=True)
return {
"status": "error",
"message": str(e)
if isinstance(e, ValueError)
else f"Unexpected error: {e!s}",
}
if isinstance(e, (ValueError, LinearAPIError)):
message = str(e)
else:
message = "Something went wrong while deleting the issue. Please try again."
return {"status": "error", "message": message}
return delete_linear_issue

View file

@ -5,7 +5,7 @@ from langchain_core.tools import tool
from langgraph.types import interrupt
from sqlalchemy.ext.asyncio import AsyncSession
from app.connectors.linear_connector import LinearConnector
from app.connectors.linear_connector import LinearAPIError, LinearConnector
from app.services.linear import LinearKBSyncService, LinearToolMetadataService
logger = logging.getLogger(__name__)
@ -290,12 +290,11 @@ def create_update_linear_issue_tool(
raise
logger.error(f"Error updating Linear issue: {e}", exc_info=True)
return {
"status": "error",
"message": str(e)
if isinstance(e, ValueError)
else f"Unexpected error: {e!s}",
}
if isinstance(e, (ValueError, LinearAPIError)):
message = str(e)
else:
message = "Something went wrong while updating the issue. Please try again."
return {"status": "error", "message": message}
return update_linear_issue