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: 中断任务切换模型失败

cycong_11d42e84764b4
diff --git a/jiuwenclaw/gateway/message_handler.py b/jiuwenclaw/gateway/message_handler.py
index 0e3de7d55f..559cc91da8 100644
--- a/jiuwenclaw/gateway/message_handler.py
+++ b/jiuwenclaw/gateway/message_handler.py
@@ -1717,6 +1717,11 @@ class MessageHandler(ABC):
"query": new_input.strip(),
"session_id": msg.session_id,
"is_supplement": True,
+ **(
+ {"model_name": (msg.params or {}).get("model_name")}
+ if (msg.params or {}).get("model_name")
+ else {}
+ ),
**(
{"attachments": supplement_attachments}
if supplement_attachments
diff --git a/jiuwenclaw/web/src/hooks/useWebSocket.ts b/jiuwenclaw/web/src/hooks/useWebSocket.ts
index e53ad908b8..c237bd2907 100644
--- a/jiuwenclaw/web/src/hooks/useWebSocket.ts
+++ b/jiuwenclaw/web/src/hooks/useWebSocket.ts
@@ -334,6 +334,8 @@ export function useWebSocket(options: UseWebSocketOptions): UseWebSocketReturn {
};
if (intent === 'supplement') {
params.new_input = newInput ?? '';
+ const selectedModel = useSessionStore.getState().selectedModelName;
+ if (selectedModel) params.model_name = selectedModel;
}
await request('chat.interrupt', params);
} catch (error) {