Skip to content

Commit fb6f58d

Browse files
fix: resolve lint errors - undefined tool variable and unused supports_temperature
- server.py: Fix undefined 'tool' variable by properly importing and retrieving tool instance from tool registry - tools/simple/base.py: Remove unused supports_temperature variable (capability check is done inline) Fixes 3 Ruff lint errors blocking CI.
1 parent 534a70a commit fb6f58d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

server.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,17 @@ async def reconstruct_thread_context(arguments: dict[str, Any]) -> dict[str, Any
11041104
from providers.registry import ModelProviderRegistry
11051105

11061106
fallback_model = None
1107-
if tool is not None:
1107+
# Try to get a category-appropriate fallback if we know the tool
1108+
if context.tool_name:
11081109
try:
1109-
fallback_model = ModelProviderRegistry.get_preferred_fallback_model(tool.get_model_category())
1110+
# Import tool registry to get tool instance
1111+
from tools import get_tool_by_name
1112+
1113+
tool_instance = get_tool_by_name(context.tool_name)
1114+
if tool_instance and hasattr(tool_instance, "get_model_category"):
1115+
fallback_model = ModelProviderRegistry.get_preferred_fallback_model(
1116+
tool_instance.get_model_category()
1117+
)
11101118
except Exception as fallback_exc: # pragma: no cover - defensive log
11111119
logger.debug(
11121120
f"[CONVERSATION_DEBUG] Unable to resolve fallback model for {context.tool_name}: {fallback_exc}"

tools/simple/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ async def execute(self, arguments: dict[str, Any]) -> list:
425425
# Resolve model capabilities for feature gating
426426
capabilities = self._model_context.capabilities
427427
supports_thinking = capabilities.supports_extended_thinking
428-
supports_temperature = capabilities.supports_temperature
429428

430429
# Generate content with provider abstraction
431430
if capabilities.supports_temperature:

0 commit comments

Comments
 (0)