Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix: coalesce None thinking_style to empty string in provider creation
axelray-devc66101275422
diff --git a/nanobot/providers/factory.py b/nanobot/providers/factory.pyindex 3758c81f6..4fd75cdd0 100644--- a/nanobot/providers/factory.py+++ b/nanobot/providers/factory.py@@ -54,7 +54,7 @@ def _make_provider_core(if provider_name and not spec and p:if not p.api_base:raise ValueError(f"Provider '{provider_name}' requires api_base in config.")- spec = create_dynamic_spec(provider_name, thinking_style=p.thinking_style if p else "")+ spec = create_dynamic_spec(provider_name, thinking_style=(p.thinking_style or "") if p else "")if spec and spec.is_transcription_only:raise ValueError(f"Provider '{provider_name}' only supports transcription.")backend = spec.backend if spec else "openai_compat"diff --git a/nanobot/webui/settings_api.py b/nanobot/webui/settings_api.pyindex 139ed4cb7..8d378b156 100644--- a/nanobot/webui/settings_api.py+++ b/nanobot/webui/settings_api.py@@ -359,7 +359,7 @@ def _resolve_settings_provider(normalized = provider_name.replace("-", "_")for extra_name, provider_config in _dynamic_provider_items(config):if provider_name == extra_name or normalized == extra_name.replace("-", "_"):- return create_dynamic_spec(extra_name, thinking_style=provider_config.thinking_style), extra_name, provider_config+ return create_dynamic_spec(extra_name, thinking_style=(provider_config.thinking_style or "")), extra_name, provider_configreturn None@@ -739,7 +739,7 @@ def settings_payload(providers.append(_provider_settings_row(provider_key,- create_dynamic_spec(provider_key, thinking_style=provider_config.thinking_style),+ create_dynamic_spec(provider_key, thinking_style=(provider_config.thinking_style or "")),provider_config,))diff --git a/tests/providers/test_custom_thinking_style.py b/tests/providers/test_custom_thinking_style.pyindex f97d3ee77..55b6a05d3 100644--- a/tests/providers/test_custom_thinking_style.py+++ b/tests/providers/test_custom_thinking_style.py@@ -11,7 +11,7 @@ class TestCustomProviderThinkingStyle:def test_default_thinking_style_is_empty(self) -> None:cfg = ProviderConfig()- assert cfg.thinking_style == ""+ assert cfg.thinking_style is Nonedef test_create_dynamic_spec_default(self) -> None:spec = create_dynamic_spec("custom")