From 5f44e4e4ed0ef70df1eabd34dd292fd5b5f173fa Mon Sep 17 00:00:00 2001 From: ViperEkura <3081035982@qq.com> Date: Tue, 21 Apr 2026 11:38:37 +0800 Subject: [PATCH] debug --- dashboard/src/api/index.js | 16 +- dashboard/src/views/AgentsView.vue | 216 +++++++++++++++++++++++++- dashboard/vite.config.js | 9 +- luxx/agents/base.py | 203 ++++++------------------ luxx/api/agents.py | 4 +- luxx/services/agent.py | 9 +- luxx/services/chat.py | 239 +++++++++++++++++++++-------- luxx/services/llm_client.py | 55 ++++--- luxx/services/room.py | 64 +++++++- 9 files changed, 543 insertions(+), 272 deletions(-) diff --git a/dashboard/src/api/index.js b/dashboard/src/api/index.js index 69241cd..15f3a2e 100644 --- a/dashboard/src/api/index.js +++ b/dashboard/src/api/index.js @@ -283,10 +283,22 @@ export function createRoomWS(roomId, callbacks = {}) { } }, sendMessage: (content, userId = 'user', userName = 'User') => { - ws.send(JSON.stringify({ action: 'send_message', content, user_id: userId, user_name: userName })) + const send = () => { + if (ws.readyState === WebSocket.OPEN) { + ws.send(JSON.stringify({ action: 'send_message', content, user_id: userId, user_name: userName })) + } else if (ws.readyState === WebSocket.CONNECTING) { + // Wait for connection then retry + ws.addEventListener('open', () => { + ws.send(JSON.stringify({ action: 'send_message', content, user_id: userId, user_name: userName })) + }, { once: true }) + } + } + send() }, ping: () => { - ws.send(JSON.stringify({ action: 'ping' })) + if (ws.readyState === WebSocket.OPEN) { + ws.send(JSON.stringify({ action: 'ping' })) + } }, close: () => ws.close() } diff --git a/dashboard/src/views/AgentsView.vue b/dashboard/src/views/AgentsView.vue index 8e588ed..7279c37 100644 --- a/dashboard/src/views/AgentsView.vue +++ b/dashboard/src/views/AgentsView.vue @@ -33,6 +33,14 @@ +
+ + Provider: {{ getProviderName(agent.provider_id) }} + + 模型: {{ agent.model }} + 工具: {{ agent.tools.length }}个 +
+

{{ agent.system_prompt?.slice(0, 100) }}...

@@ -64,6 +72,47 @@ placeholder="定义 Agent 的行为和职责...">
+
+
+ + +
+
+ + +
+
+ + +
+
+ {{ selectedProvider.provider_type }} + + 默认模型: {{ selectedProvider.default_model }} + + + API: {{ selectedProvider.base_url }} + +
+
+ +
+ +
+ +
+
+
@@ -103,10 +152,12 @@