Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix:TUI对模型判断与web逻辑不一致

chunbs_cbsbfa4e789dc5e
diff --git a/jiuwenswarm/gateway/channel_manager/tui/tui_connect.py b/jiuwenswarm/gateway/channel_manager/tui/tui_connect.py
index 357933aa8e..0f188b2043 100644
--- a/jiuwenswarm/gateway/channel_manager/tui/tui_connect.py
+++ b/jiuwenswarm/gateway/channel_manager/tui/tui_connect.py
@@ -1285,10 +1285,10 @@ def register_cli_handlers(bind: CliHandlersBindParams) -> None:
try:
try:
- response = await _probe(1)
+ response = await _probe(3)
except Exception as first_exc: # noqa: BLE001
logger.info(
- "[cli config.validate_model] max_tokens=1 failed, retrying with 16: %s",
+ "[cli config.validate_model] max_tokens=3 failed, retrying with 16: %s",
first_exc,
)
response = await _probe(16)
@@ -1309,8 +1309,12 @@ def register_cli_handlers(bind: CliHandlersBindParams) -> None:
content = response.get("content", "")
else:
content = str(response)
-
- if not (isinstance(content, str) and content.strip()):
+ reasoning_content = getattr(response, "reasoning_content", None) if hasattr(response,
+ "reasoning_content") else None
+ has_valid_response = (isinstance(content, str) and content) or (
+ isinstance(reasoning_content, str) and reasoning_content
+ )
+ if not has_valid_response:
await channel.send_response(
ws,
req_id,