@tencent-ai/agent-sdk 0.3.165 → 0.3.166

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.
Files changed (34) hide show
  1. package/cli/CHANGELOG.md +25 -0
  2. package/cli/bin/codebuddy +35 -0
  3. package/cli/dist/codebuddy-headless.js +39 -39
  4. package/cli/dist/web-ui/docs/cn/cli/env-vars.md +2 -1
  5. package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +7 -0
  6. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.100.0.md +42 -0
  7. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.100.1.md +13 -0
  8. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.100.2.md +18 -0
  9. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.101.0.md +23 -0
  10. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.102.0.md +39 -0
  11. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.103.0.md +37 -0
  12. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.103.1.md +31 -0
  13. package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +60 -0
  14. package/cli/dist/web-ui/docs/en/cli/env-vars.md +2 -1
  15. package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +7 -0
  16. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.100.0.md +42 -0
  17. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.100.1.md +13 -0
  18. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.100.2.md +18 -0
  19. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.101.0.md +23 -0
  20. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.102.0.md +39 -0
  21. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.103.0.md +37 -0
  22. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.103.1.md +31 -0
  23. package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +60 -0
  24. package/cli/dist/web-ui/docs/search-index-en.json +1 -1
  25. package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
  26. package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
  27. package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
  28. package/cli/package.json +1 -1
  29. package/cli/product.cloudhosted.json +12 -10
  30. package/cli/product.internal.json +5 -5
  31. package/cli/product.ioa.json +5 -4
  32. package/cli/product.json +3 -2
  33. package/cli/product.selfhosted.json +2 -2
  34. package/package.json +1 -1
package/cli/CHANGELOG.md CHANGED
@@ -7,6 +7,31 @@ CodeBuddy Code 的所有重要更新都会记录在这里。
7
7
 
8
8
  ## [未发布]
9
9
 
10
+ ## [2.103.1] - 2026-06-04
11
+
12
+ ### 🔧 改进
13
+
14
+ - **模型计费系数更新**:按最新计费策略调整 cli-saas 各部署形态下的默认模型、推理模型、图像模型及多个第三方模型的计费系数。
15
+ - **WorkBuddy 助理对话标识**:当环境变量 `PERSONAL_AGENT_ROLE` 存在时,ChatCompletion 请求的 `X-Agent-Purpose` 头自动设置为 `person_agent`,便于服务端识别来自 WorkBuddy 助理(orchestrator/specialist)的对话。
16
+ - **遥测 flush 配置可调**:新增 `galileo.aggregatorFlushIntervalSec` 配置项(默认 60 秒,范围 [5, 600]),短对话占比高的场景可调低到 10-20 秒。
17
+ - **hook session_id 统一**:新增 `resolveHookSessionId` 工具函数,`SessionHookManager` / `ToolHookManager` 全部 hook payload 切换到该工具,统一父子 session 解析路径。
18
+ - **故障排查文档补充**:新增"更新不到最新版"小节,说明在 npm 镜像缓存延迟场景下,可通过 `--registry=https://registry.npmjs.org/` 指定官方源重试。
19
+
20
+ ### 🐛 修复
21
+
22
+ - **进程退出前丢失监控数据**:放量后 WorkBuddy/IDE 集成场景下,短对话(< 60s 退出)的子进程会随 `process.exit()` 丢弃 aggregator 当前窗口 + OTel BatchProcessor buffer 中的监控数据。新增 `flushTelemetryBeforeExit()` helper 在 8 个进程退出关键点统一 flush metrics + trace + log 三类 buffer,并将 telemetry flush 提到 cleanup 队列最前面以抢占 2s 预算。
23
+ - **遥测 namespace 修正**:修复 Desktop sidecar 进程上报遥测时 namespace 始终为 Production 的问题。改为读取专用环境变量 `WORKBUDDY_NODE_ENV`,按真实运行环境动态判定 Production/Development,避免开发期数据混入正式监控库。
24
+ - **snappy 原生模块打包**:新增 galileo-node-sdk 和 galileo-semantic-conventions 显式依赖,使 rspack 打包时 snappy 原生 `.node` 模块可被正确排除。
25
+ - **历史压缩边界误识别**:修复对话中包含 HTML 折叠块(`<details><summary>...</summary>...</details>`)时,消息会被错误判定为历史压缩边界、进而被排除出真实用户输入的问题。仅保留更明确的边界标记,避免对常见 HTML 标签的通配匹配。
26
+ - **后台任务通知日志清理**:移除后台命令完成通知中遗留的临时排查日志(参数 dump / 历史快照 dump),降低日志噪音并避免敏感字段被打到日志。
27
+ - **IOA endpoint 漂移防御**:`ProductManager` 在并发刷新场景下可能短暂暴露错误的 endpoint,导致 IOA 用户的模型请求落到公共云域名(`codebuddy.ai`)。内部改为事务化更新避免中间态被读取;`ModelProvider` 增加二道防线 —— 当 `CODEBUDDY_INTERNET_ENVIRONMENT=ioa` 但解析后的 `baseURL` 落到公共云域名时打 warn。
28
+ - **sub-agent hook `session_id` 行为对齐**:在 sub-agent 内触发的 hook,其 `session_id` 现指向**主 agent** 的 session id,sub-agent 自身 id 通过 `agent_id` 字段单独暴露。修复前 sub-agent 的 hook 会把自己的 session id 当成主 session 上报,导致下游审计/统计无法跨主 session 聚合。
29
+ - **MCP 禁用持久化**:修复 IDE 插件提供的 MCP 服务通过 `/mcp` 禁用后,重启再次出现的问题。禁用状态现已持久化到本地配置,重启后保持禁用。
30
+
31
+ ### 📝 文档
32
+
33
+ - **CLI 文档归档**:补全 v2.100.0 ~ v2.103.0 共 6 个版本发布说明的英文翻译,更新中英文导航栏;同步更新 env-vars / http-api / troubleshooting / release-notes 索引等文档的中英文版本。
34
+
10
35
  ## [2.103.0] - 2026-06-04
11
36
 
12
37
  ### 🎉 新功能
package/cli/bin/codebuddy CHANGED
@@ -49,6 +49,41 @@ if (compareVersions(process.versions.node, minNode) < 0) {
49
49
 
50
50
  require('events').EventEmitter.defaultMaxListeners = 50;
51
51
 
52
+ // Enable V8 compile cache so the large bundle's parse/compile cost (~130ms for the
53
+ // ~16MB TUI bundle) is paid only on the first run. Subsequent starts reuse the cached
54
+ // bytecode, cutting bundle load time by ~37% (measured ~400ms -> ~254ms).
55
+ //
56
+ // `module.enableCompileCache` is available on Node.js >= 22.8.0. On older runtimes the
57
+ // API is absent, so we guard it and silently skip (no extra dependency, no behavior change).
58
+ //
59
+ // Set CODEBUDDY_DISABLE_COMPILE_CACHE=1 to opt out (e.g. for troubleshooting a suspected
60
+ // stale-cache issue, or on read-only filesystems where writing the cache is undesirable).
61
+ if (process.env.CODEBUDDY_DISABLE_COMPILE_CACHE !== '1') {
62
+ try {
63
+ const { enableCompileCache, getCompileCacheDir, constants } = require('module');
64
+
65
+ if (typeof enableCompileCache === 'function') {
66
+ // No directory argument => Node picks a per-user temp location keyed by the
67
+ // module's mtime + Node version, so a stale cache after an upgrade is invalidated.
68
+ const cacheRet = enableCompileCache();
69
+
70
+ if (process.env.CODEBUDDY_COMPILE_CACHE_DEBUG === '1') {
71
+ console.log('compileCacheInfo', cacheRet);
72
+ }
73
+ }
74
+ } catch (_e) {
75
+ // Compile cache is a pure optimization; never let it block startup.
76
+ }
77
+ }
78
+
79
+ // windows数据
80
+ // 之前
81
+ // 8.12s + 8.41s + 8.06s + 8.45s + 8.15s
82
+ // v8cache 热启动
83
+ // 6.97s + 7.32s + 7.14s + 7.15s + 7.34s
84
+ // v8cache 冷启动
85
+ // 10.2s + 9.48s + 8.96s
86
+
52
87
  // Fast path for --version / -v: print version and exit before loading any bundle.
53
88
  // This avoids the full DI container initialization (~150 components), network requests,
54
89
  // and stdin reads that can cause multi-second startup delays on first install.