diff --git a/agent/anthropic_adapter.py b/agent/anthropic_adapter.py index 623560250df4..215868306348 100644 --- a/agent/anthropic_adapter.py +++ b/agent/anthropic_adapter.py @@ -2102,7 +2102,7 @@ def _convert_user_message(content: Any) -> Dict[str, Any]: if isinstance(content, list): converted_blocks = _convert_content_to_anthropic(content) if not converted_blocks or all( - b.get("text", "").strip() == "" + (b.get("text") or "").strip() == "" for b in converted_blocks if isinstance(b, dict) and b.get("type") == "text" ): diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py index b1d9a8135e6f..d8ff9204daed 100644 --- a/agent/auxiliary_client.py +++ b/agent/auxiliary_client.py @@ -4716,8 +4716,8 @@ def resolve_provider_client( if custom_entry is None: custom_entry = _get_named_custom_provider(provider) if custom_entry: - custom_base = custom_entry.get("base_url", "").strip() - custom_key = custom_entry.get("api_key", "").strip() + custom_base = (custom_entry.get("base_url") or "").strip() + custom_key = (custom_entry.get("api_key") or "").strip() custom_key_env = (custom_entry.get("key_env") or custom_entry.get("api_key_env") or "").strip() if not custom_key and custom_key_env: custom_key = os.getenv(custom_key_env, "").strip()