From cc3bac13c5f17ea425eeea0745079cf0cac90b44 Mon Sep 17 00:00:00 2001 From: majdyz Date: Sun, 12 Apr 2026 07:31:45 +0000 Subject: [PATCH] fix(copilot): address second CodeRabbit review cycle - Fix docstring: default is True, not False (config_test.py) - Redact exception message from stream-error log for consistency with upstream-error log (openrouter_compat_proxy.py) --- autogpt_platform/backend/backend/copilot/config_test.py | 2 +- .../backend/backend/copilot/sdk/openrouter_compat_proxy.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autogpt_platform/backend/backend/copilot/config_test.py b/autogpt_platform/backend/backend/copilot/config_test.py index fb7ff85174..60400ac41a 100644 --- a/autogpt_platform/backend/backend/copilot/config_test.py +++ b/autogpt_platform/backend/backend/copilot/config_test.py @@ -131,7 +131,7 @@ class TestClaudeAgentUseCompatProxyEnvFallback: prefixed ``CHAT_CLAUDE_AGENT_USE_COMPAT_PROXY`` env var and the unprefixed ``CLAUDE_AGENT_USE_COMPAT_PROXY`` form. Regression guard for the bool-default pitfall: the field has a non-None - default (``False``), so Pydantic passes the default into the + default (``True``), so Pydantic passes the default into the validator when no value is provided and a naive ``if v is None`` check would never fire. """ diff --git a/autogpt_platform/backend/backend/copilot/sdk/openrouter_compat_proxy.py b/autogpt_platform/backend/backend/copilot/sdk/openrouter_compat_proxy.py index dd9cd72a86..5001c575a5 100644 --- a/autogpt_platform/backend/backend/copilot/sdk/openrouter_compat_proxy.py +++ b/autogpt_platform/backend/backend/copilot/sdk/openrouter_compat_proxy.py @@ -463,7 +463,9 @@ class OpenRouterCompatProxy: raise except aiohttp.ClientError as e: stream_error = e - logger.warning("OpenRouter compat proxy stream interrupted: %s", e) + logger.warning( + "OpenRouter compat proxy stream interrupted: %s", type(e).__name__ + ) finally: if not cancelled: upstream_response.release()