From 1241028dc38cfd8d0f638ba1fd522b7291f088c4 Mon Sep 17 00:00:00 2001 From: aran-yogesh Date: Mon, 2 Mar 2026 14:34:28 -0800 Subject: [PATCH 1/2] chore: improve GitHub auth failure logging with exception type and error value --- apps/agent/agent/webapp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/agent/agent/webapp.py b/apps/agent/agent/webapp.py index 280440c5..70572797 100644 --- a/apps/agent/agent/webapp.py +++ b/apps/agent/agent/webapp.py @@ -222,6 +222,7 @@ async def get_github_token_for_user(ls_user_id: str, tenant_id: str) -> dict[str except httpx.HTTPStatusError as e: return {"error": f"HTTP error: {e.response.status_code} - {e.response.text}"} except Exception as e: # noqa: BLE001 + logger.warning("GitHub auth API call failed: %s: %s", type(e).__name__, str(e)) return {"error": str(e)} @@ -558,7 +559,11 @@ async def process_linear_issue( # noqa: PLR0912, PLR0915 await comment_on_linear_issue(issue_id, comment) return else: - logger.warning("Auth result has neither token nor auth_url: %s", auth_result) + logger.warning( + "Auth result has neither token nor auth_url: %s (error=%r)", + auth_result, + auth_result.get("error"), + ) else: logger.warning("User %s not found in LangSmith workspace", user_email) comment = ( From 257f08b196ccea3f7ce74617d9e3658d89333a5c Mon Sep 17 00:00:00 2001 From: aran-yogesh Date: Mon, 2 Mar 2026 14:49:07 -0800 Subject: [PATCH 2/2] chore:updated logging --- apps/agent/agent/webapp.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/agent/agent/webapp.py b/apps/agent/agent/webapp.py index 70572797..74fe5f42 100644 --- a/apps/agent/agent/webapp.py +++ b/apps/agent/agent/webapp.py @@ -183,6 +183,7 @@ async def get_github_token_for_user(ls_user_id: str, tenant_id: str) -> dict[str Dict with either 'token' key or 'auth_url' key """ if not GITHUB_OAUTH_PROVIDER_ID: + logger.error("GitHub auth failed: GITHUB_OAUTH_PROVIDER_ID is not configured") return {"error": "GITHUB_OAUTH_PROVIDER_ID not configured"} try: @@ -220,9 +221,10 @@ async def get_github_token_for_user(ls_user_id: str, tenant_id: str) -> dict[str return {"error": f"Unexpected auth result: {response_data}"} except httpx.HTTPStatusError as e: + logger.error("GitHub auth API HTTP error: %s - %s", e.response.status_code, e.response.text) return {"error": f"HTTP error: {e.response.status_code} - {e.response.text}"} except Exception as e: # noqa: BLE001 - logger.warning("GitHub auth API call failed: %s: %s", type(e).__name__, str(e)) + logger.error("GitHub auth API call failed: %s: %s", type(e).__name__, str(e)) return {"error": str(e)} @@ -559,11 +561,7 @@ async def process_linear_issue( # noqa: PLR0912, PLR0915 await comment_on_linear_issue(issue_id, comment) return else: - logger.warning( - "Auth result has neither token nor auth_url: %s (error=%r)", - auth_result, - auth_result.get("error"), - ) + logger.warning("Auth result has neither token nor auth_url: %s", auth_result) else: logger.warning("User %s not found in LangSmith workspace", user_email) comment = (