@vrs-soft/wecom-aibot-mcp 3.3.1 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ import * as fs from 'fs';
16
16
  import * as path from 'path';
17
17
  import { execSync } from 'child_process';
18
18
  import { VERSION, installSkill } from './config-wizard.js';
19
- import { addPermissionHook, registerActiveProject, unregisterActiveProject, updateWechatModeConfig } from './project-config.js';
19
+ import { addPermissionHook, registerActiveProject, unregisterActiveProject, updateWechatModeConfig, loadWechatModeConfig } from './project-config.js';
20
20
  import { logger } from './logger.js';
21
21
  /**
22
22
  * 沿进程树向上查找 Claude Code TUI 的 PID。
@@ -847,12 +847,24 @@ function registerChannelTools(server) {
847
847
  .describe('运行模式:channel=SSE推送(推荐),http=轮询(兼容)'),
848
848
  auto_approve_timeout: z.number().optional().default(600).describe('超时自动决策等待时间(秒,默认 600 即 10 分钟)'),
849
849
  }, async ({ agent_name, cc_id, robot_id, project_dir, mode, auto_approve_timeout }) => {
850
+ // v3.3.2: 远端 daemon 看不到本地 .claude/wecom-aibot.json,无法走 existingConfig 复用 ccId 的路径。
851
+ // 这里在 channel-server 本地读保存的 ccId,没有传入 cc_id 时自动塞进去 —— 避免每次 enter
852
+ // 都因 stale registry entry 撞冲突,生成 商务机器人-2 / -3 之类的奇怪 ccId。
853
+ const effectiveProjectDir = project_dir || process.cwd();
854
+ let effectiveCcId = cc_id;
855
+ if (!effectiveCcId) {
856
+ const saved = loadWechatModeConfig(effectiveProjectDir);
857
+ if (saved?.ccId) {
858
+ effectiveCcId = saved.ccId;
859
+ logger.info('reuse saved ccId from local wecom-aibot.json', { projectDir: effectiveProjectDir, ccId: saved.ccId });
860
+ }
861
+ }
850
862
  // 转发请求
851
863
  const result = await forwardToHttpMcp('enter_headless_mode', {
852
864
  agent_name,
853
- cc_id,
865
+ cc_id: effectiveCcId,
854
866
  robot_id,
855
- project_dir: project_dir || process.cwd(),
867
+ project_dir: effectiveProjectDir,
856
868
  mode,
857
869
  auto_approve_timeout,
858
870
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vrs-soft/wecom-aibot-mcp",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "企业微信智能机器人 MCP 客户端 - 连接 wecom-aibot-server daemon",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",