diff --git a/mcp-config/trae.mcp.json b/mcp-config/trae.mcp.json index f79900c..07dc229 100644 --- a/mcp-config/trae.mcp.json +++ b/mcp-config/trae.mcp.json @@ -9,7 +9,7 @@ "env": { "PCHAT_HTTP_PORT": "13458", "PCHAT_NODE": "/usr/local/opt/node@22/bin/node", - "PCHAT_HUB_HOST": "192.168.110.101", + "PCHAT_HUB_HOST": "127.0.0.1", "NO_PROXY": "192.168.110.101,127.0.0.1,localhost", "no_proxy": "192.168.110.101,127.0.0.1,localhost" }, diff --git a/src/hub.js b/src/hub.js index 563f7ea..627c2a6 100755 --- a/src/hub.js +++ b/src/hub.js @@ -711,9 +711,6 @@ function shouldAlwaysKeepAlive(s) { function buildKeepAliveContinueText(s, review) { const mode = getSessionContinueMode(s); const goal = String((s && s.projectGoal) || (review && review.projectGoal) || '').slice(0, 150); - if (review && review.isIdleNext) { - return `【挂起】当前会话已保持连接,下一步状态是 wait / 待命。等待下一条消息即可,不要结束对话。`; - } if (review && review.nextStep && !review.isIdleNext) { return `【保活续跑】继续执行▶下一步:${review.nextStep.slice(0, 400)}。保持连接勿停。`; } @@ -728,7 +725,7 @@ function buildKeepAliveContinueText(s, review) { return '【保活续跑】保持连接,继续优化流程:总结→检索→补文档→开发,按学习清单推进。'; } if (goal) { - return `【挂起】目标已记录:${goal}。当前状态维持 wait / 待命,等待下一条消息继续,不要结束对话。`; + return `【保活续跑】继续推进:${goal}。按复盘与▶下一步执行,保持连接勿停。`; } return String( hubSettings.keepAliveText diff --git a/src/server.js b/src/server.js index a78f181..93ab33f 100755 --- a/src/server.js +++ b/src/server.js @@ -34,10 +34,9 @@ const WORKSPACE = (!WORKSPACE_RAW ? (process.cwd() || HOME) : WORKSPACE_RAW; const HTTP_PORT = parseInt(process.env.PCHAT_HTTP_PORT || arg('port', '13458'), 10); -const HUB_HOST = process.env.PCHAT_HUB_HOST || '127.0.0.1'; -const HUB = `http://${HUB_HOST}:${HTTP_PORT}`; +const HUB = `http://127.0.0.1:${HTTP_PORT}`; const HOST_IP = getHostIp(); -const HUB_LABEL = `${HUB_HOST}:${HTTP_PORT}`; +const HUB_LABEL = `127.0.0.1:${HTTP_PORT}`; /** 卡若AI 能力真源(每轮对话门禁) */ const KARUO_AI_ROOT = '/Users/karuo/Documents/个人/卡若AI'; @@ -656,7 +655,7 @@ const TOOLS = [ }, { name: 'wait_for_user_input', - description: '挂起 Agent,等待远端主链面板 http://192.168.110.101:13458 回复;本机 127.0.0.1 仅兜底。必须使用本线程锁定的 pchat-token。', + description: '挂起 Agent,等待本地面板 http://127.0.0.1:13458 回复。必须使用本线程锁定的 pchat-token。', inputSchema: { type: 'object', properties: { @@ -1112,12 +1111,9 @@ rl.on('line', async (line) => { /** Cursor 可能关闭 MCP stdin;挂起 poll 期间禁止 exit,否则 Hub 仍 waiting 但无 poller */ let activeWaitToken = null; -let idleKeepAliveTimer = null; process.stdin.on('end', () => { log('stdin end', { activeWait: activeWaitToken }); - if (activeWaitToken) return; - if (!idleKeepAliveTimer) idleKeepAliveTimer = setInterval(() => {}, 60 * 1000); - log('stdin end ignored: keep alive while idle to preserve transport'); + if (!activeWaitToken) setTimeout(() => process.exit(0), 200); }); process.on('SIGTERM', () => process.exit(0)); diff --git a/web/panel.html b/web/panel.html index 97bbeca..65c5b22 100755 --- a/web/panel.html +++ b/web/panel.html @@ -81,8 +81,6 @@ aside .sess.active { background:rgba(37,99,235,.08); border-color:rgba(37,99,235,.28); box-shadow:inset 3px 0 0 var(--kir-brand); } aside .sess.waiting { background:linear-gradient(90deg,rgba(255,138,0,.1),transparent); } aside .sess.waiting.active { background:linear-gradient(90deg,rgba(255,138,0,.16),rgba(37,99,235,.06)); } - aside .sess.abandoned { opacity:.62; } - aside .sess.abandoned .badge { color:var(--fg2); } aside .sess .title { font-weight:600; font-size:13px; line-height:1.35; } aside .sess .meta { font-size:11px; color:var(--fg2); margin-top:4px; display:flex; gap:6px; align-items:center; flex-wrap:wrap; } .badge { padding:2px 8px; border-radius:var(--kir-radius-pill); font-size:10px; font-weight:600; letter-spacing:.02em; } @@ -197,16 +195,13 @@