@tencent-ai/agent-sdk 0.3.158 → 0.3.160

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 (30) hide show
  1. package/cli/CHANGELOG.md +70 -0
  2. package/cli/README.md +3 -1
  3. package/cli/dist/codebuddy-headless.js +872 -793
  4. package/cli/dist/web-ui/assets/index-DOB9MrWi.css +32 -0
  5. package/cli/dist/web-ui/assets/{index-CU_ExRgj.js → index-DlV6l3G1.js} +181 -170
  6. package/cli/dist/web-ui/docs/cn/cli/env-vars.md +1 -0
  7. package/cli/dist/web-ui/docs/cn/cli/monitoring.md +117 -29
  8. package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +2 -0
  9. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.99.0.md +39 -0
  10. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.99.1.md +46 -0
  11. package/cli/dist/web-ui/docs/en/cli/env-vars.md +1 -0
  12. package/cli/dist/web-ui/docs/en/cli/monitoring.md +118 -30
  13. package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +2 -0
  14. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.99.0.md +39 -0
  15. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.99.1.md +46 -0
  16. package/cli/dist/web-ui/docs/search-index-en.json +1 -1
  17. package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
  18. package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
  19. package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
  20. package/cli/dist/web-ui/index.html +2 -2
  21. package/cli/dist/web-ui/sw.js +1 -1
  22. package/cli/package.json +3 -2
  23. package/cli/product.cloudhosted.json +6 -4
  24. package/cli/product.internal.json +9 -5
  25. package/cli/product.ioa.json +26 -104
  26. package/cli/product.json +19 -7
  27. package/cli/product.selfhosted.json +6 -4
  28. package/cli/vendor/sandbox/sandbox-cli +0 -0
  29. package/package.json +1 -1
  30. package/cli/dist/web-ui/assets/index-C5x-jWxM.css +0 -32
@@ -63,6 +63,7 @@ CodeBuddy Code 支持通过环境变量来控制其行为。这些变量可以
63
63
  | `CODEBUDDY_IMAGE_GEN_ENABLED` | 设置为 `false` 或 `0` 禁用图片生成功能 |
64
64
  | `CODEBUDDY_IMAGE_EDIT_ENABLED` | 设置为 `false` 或 `0` 禁用图片编辑功能 |
65
65
  | `CODEBUDDY_COMPUTER_USE_ENABLED` | **实验功能**:设置为 `true` 或 `1` 启用 macOS 桌面控制工具(截图、鼠标、键盘)。仅 macOS 可用,默认关闭。首次调用键盘/鼠标动作需在系统设置 → 隐私与安全 → 辅助功能、屏幕录制中为终端授权 |
66
+ | `CODEBUDDY_WAIT_FOR_MCP_SERVERS_ENABLED` | 设置为 `0` 或 `false` 禁用 WaitForMcpServers 工具。默认开启。交互模式下不阻塞等待 MCP 连接,当 LLM 需要尚未就绪的 MCP 工具时可主动调用此工具按需等待。WorkBuddy 场景设置为 `0` 禁用 |
66
67
  | `CODEBUDDY_DEFER_TOOL_LOADING` | 设置为 `false` 或 `0` 禁用 MCP 工具延迟加载 |
67
68
  | `CODEBUDDY_SHOW_ALL_DEFERRED_TOOLS` | 设置为 `true` 或 `1` 显示所有延迟工具的完整描述 |
68
69
  | `CODEBUDDY_DISABLE_CRON` | 设置为 `1` 禁用计划任务 |
@@ -1,44 +1,117 @@
1
1
  # Monitoring CodeBuddy Code with OpenTelemetry
2
2
 
3
- CodeBuddy Code 支持把内部 traces 通过标准 OTLP 协议上报到用户自有的 OpenTelemetry Collector,便于企业自建可观测性平台对接。
3
+ CodeBuddy Code 支持把 traces 通过标准 OTLP 协议上报到用户自有的 OpenTelemetry Collector,便于企业自建可观测性平台对接。
4
4
 
5
- > **MVP 范围**:当前仅支持 **traces**(链路追踪),暂不支持 metrics 与 logs 的自定义上报。后续会按需扩展。
5
+ > **当前范围**:支持 **traces**(链路追踪)+ 4 个隐私 opt-in 开关。暂不支持 metrics 与 logs 的自定义上报。
6
6
 
7
- ## 启用方式
8
-
9
- 设置启用开关后,traces 会按 OTel 标准环境变量上报:
7
+ ## 快速开始
10
8
 
11
9
  ```bash
10
+ # 1. 启用 telemetry
12
11
  export CODEBUDDY_CODE_ENABLE_TELEMETRY=1
13
- export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector.example.com
12
+
13
+ # 2. 配置 OTLP endpoint
14
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
15
+
16
+ # 3. (可选) 启用隐私 opt-in 内容记录
17
+ export OTEL_LOG_USER_PROMPTS=1
18
+ export OTEL_LOG_TOOL_DETAILS=1
19
+ export OTEL_LOG_TOOL_CONTENT=1
20
+
21
+ # 4. 运行
14
22
  codebuddy
15
23
  ```
16
24
 
17
- > 兼容 Claude Code 已有配置:`CLAUDE_CODE_ENABLE_TELEMETRY` 与 `CODEBUDDY_CODE_ENABLE_TELEMETRY` 等价。
25
+ > 兼容 Claude Code 配置:`CLAUDE_CODE_ENABLE_TELEMETRY` 与 `CODEBUDDY_CODE_ENABLE_TELEMETRY` 等价。
18
26
 
19
- ## 关键环境变量
27
+ ## 配置变量
20
28
 
21
- 完整清单见 [env-vars.md](env-vars.md#opentelemetry-自定义上报traces),常用项:
29
+ ### 基础配置
22
30
 
23
- | 变量 | 用途 |
24
- |------|------|
25
- | `CODEBUDDY_CODE_ENABLE_TELEMETRY=1` | 启用 OTel 上报开关 |
26
- | `OTEL_TRACES_EXPORTER` | `otlp`(默认)/ `console` / `none` |
27
- | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP Collector 地址,会自动追加 `/v1/traces` |
28
- | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | traces 专用完整 URL,优先级更高 |
29
- | `OTEL_EXPORTER_OTLP_HEADERS` | 请求头 `k1=v1,k2=v2`,value 支持 URL 编码 |
30
- | `OTEL_SERVICE_NAME` | 覆盖默认 `service.name` |
31
- | `OTEL_RESOURCE_ATTRIBUTES` | 附加 resource 属性 |
31
+ | 变量 | 用途 | 示例 |
32
+ |------|------|------|
33
+ | `CODEBUDDY_CODE_ENABLE_TELEMETRY` | 启用 OTel 上报(必需) | `1` |
34
+ | `OTEL_TRACES_EXPORTER` | Exporter 类型 | `otlp`(默认)、`console`、`none` |
35
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP Collector 地址,自动追加 `/v1/traces` | `http://localhost:4318` |
36
+ | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Traces 专用完整 URL,优先级更高 | `http://localhost:4318/v1/traces` |
37
+ | `OTEL_EXPORTER_OTLP_HEADERS` | 请求头 `k1=v1,k2=v2`,value 支持 URL 编码 | `Authorization=Bearer%20token` |
38
+ | `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` | 传输协议 | `http/protobuf`(仅支持) |
39
+ | `OTEL_SERVICE_NAME` | 覆盖默认 `service.name` | `codebuddy-code` |
40
+ | `OTEL_RESOURCE_ATTRIBUTES` | 附加 resource 属性 | `team=platform,env=prod` |
32
41
 
33
- ## 协议支持
42
+ ### 隐私 opt-in 开关
34
43
 
35
- 仅支持 **`http/protobuf`**(OTLP/HTTP + Protobuf 编码),与 Claude Code 默认一致。
44
+ Span 默认不记录任何敏感信息(prompt 内容、工具参数、工具输出等),需要通过以下环境变量逐级 opt-in:
36
45
 
37
- 设置 `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` `http/json` 会被忽略并写入告警日志,回退到默认 protobuf。
46
+ | 变量 | 用途 | 记录的内容 |
47
+ |------|------|-----------|
48
+ | `OTEL_LOG_USER_PROMPTS=1` | 记录用户 prompt | `user_prompt` 属性(默认为不记录,仅记录 `user_prompt_length`) |
49
+ | `OTEL_LOG_TOOL_DETAILS=1` | 记录工具参数 | `tool_input` 属性(~4KB 截断)+ 工具特定属性(`file.path`、`command` 等) |
50
+ | `OTEL_LOG_TOOL_CONTENT=1` | 记录工具输入输出全文 | `tool_input`/`tool_result` span events(60KB 截断) |
51
+ | `OTEL_LOG_RAW_API_BODIES=1` | 记录完整 API 请求/响应体 | 预留,暂未实现 |
52
+
53
+ ## Span 结构
54
+
55
+ 每个用户 prompt 产生一个 `codebuddy_code.interaction` 根 span。工具调用记录为其子 span:
56
+
57
+ ```
58
+ codebuddy_code.interaction
59
+ ├── codebuddy_code.tool (Read)
60
+ ├── codebuddy_code.tool (Bash)
61
+ └── codebuddy_code.tool (Agent -> 子 agent 的 tool spans)
62
+ ```
63
+
64
+ ### Span 属性
65
+
66
+ 所有 span 都包含 `span.type` 属性标识类型。
67
+
68
+ **`codebuddy_code.interaction`**
69
+
70
+ | 属性 | 描述 | 受控于 |
71
+ |------|------|--------|
72
+ | `span.type` | 固定值 `"interaction"` | |
73
+ | `conversation.id` | 会话 ID | |
74
+ | `conversation.agent` | Agent 名称 | |
75
+ | `user_prompt` | 用户 prompt 内容(未启用时不记录) | `OTEL_LOG_USER_PROMPTS` |
76
+ | `user_prompt_length` | Prompt 长度(始终记录) | |
77
+ | `conversation.cancelled` | 会话被取消时为 `true` | |
78
+
79
+ **`codebuddy_code.tool`**
80
+
81
+ | 属性 | 描述 | 受控于 |
82
+ |------|------|--------|
83
+ | `span.type` | 固定值 `"tool"` | |
84
+ | `tool_name` | 工具名称 | |
85
+ | `tool.call_id` | 工具调用 ID(始终记录) | |
86
+ | `file.path` | 文件路径(Read/Write/Edit) | `OTEL_LOG_TOOL_DETAILS` |
87
+ | `command` | Bash 命令 | `OTEL_LOG_TOOL_DETAILS` |
88
+ | `command.timeout` | 命令超时(毫秒) | `OTEL_LOG_TOOL_DETAILS` |
89
+ | `glob.pattern` | Glob 搜索模式 | `OTEL_LOG_TOOL_DETAILS` |
90
+ | `grep.pattern` | Grep 正则模式 | `OTEL_LOG_TOOL_DETAILS` |
91
+ | `http.url` | WebFetch URL | `OTEL_LOG_TOOL_DETAILS` |
92
+ | `search.query` | WebSearch 查询 | `OTEL_LOG_TOOL_DETAILS` |
93
+ | `agent.prompt` | 子 Agent prompt | `OTEL_LOG_TOOL_DETAILS` |
94
+ | `agent.type` | 子 Agent 类型 | `OTEL_LOG_TOOL_DETAILS` |
95
+ | `mcp.server` | MCP 服务器名 | `OTEL_LOG_TOOL_DETAILS` |
96
+ | `mcp.tool` | MCP 工具名 | `OTEL_LOG_TOOL_DETAILS` |
97
+ | `tool_input` | 工具输入 JSON(~4KB 截断) | `OTEL_LOG_TOOL_DETAILS` |
98
+ | `tool_input_truncated` | 输入是否被截断 | `OTEL_LOG_TOOL_DETAILS` |
99
+ | `tool_input_original_length` | 截断前原始长度 | `OTEL_LOG_TOOL_DETAILS` |
100
+
101
+ **`codebuddy_code.tool` span events**(需要 `OTEL_LOG_TOOL_CONTENT=1`)
102
+
103
+ | 事件名 | 属性 | 描述 |
104
+ |--------|------|------|
105
+ | `tool_input` | `content` | 完整工具输入(60KB 截断) |
106
+ | `tool_input` | `content_truncated` | 是否被截断 |
107
+ | `tool_input` | `content_original_length` | 截断前长度 |
108
+ | `tool_result` | `content` | 完整工具输出(60KB 截断) |
109
+ | `tool_result` | `content_truncated` | 是否被截断 |
110
+ | `tool_result` | `content_original_length` | 截断前长度 |
38
111
 
39
112
  ## 典型场景
40
113
 
41
- ### 1. 上报到企业自建 Collector
114
+ ### 上报到企业自建 Collector
42
115
 
43
116
  ```bash
44
117
  export CODEBUDDY_CODE_ENABLE_TELEMETRY=1
@@ -48,16 +121,17 @@ export OTEL_SERVICE_NAME=codebuddy-code
48
121
  export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=prod,team=copilot
49
122
  ```
50
123
 
51
- ### 2. 本地调试 trace 输出
52
-
53
- 调试时让 traces 直接打到 stdout:
124
+ ### 本地调试(console 输出)
54
125
 
55
126
  ```bash
56
127
  export CODEBUDDY_CODE_ENABLE_TELEMETRY=1
57
128
  export OTEL_TRACES_EXPORTER=console
129
+ export OTEL_LOG_USER_PROMPTS=1
130
+ export OTEL_LOG_TOOL_DETAILS=1
131
+ export OTEL_LOG_TOOL_CONTENT=1
58
132
  ```
59
133
 
60
- ### 3. 临时关闭
134
+ ### 关闭 telemetry
61
135
 
62
136
  ```bash
63
137
  export OTEL_TRACES_EXPORTER=none
@@ -72,11 +146,21 @@ export DISABLE_TELEMETRY=1
72
146
  3. Endpoint 优先级:`OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` > `OTEL_EXPORTER_OTLP_ENDPOINT` > 内置 product 配置中的 `telemetry.tracing.url`。
73
147
  4. Headers:env 与 product 配置合并,env 同名 key 覆盖 product。
74
148
 
75
- ## FAQ
149
+ ## 协议支持
150
+
151
+ 仅支持 **`http/protobuf`**(OTLP/HTTP + Protobuf 编码),与 Claude Code 默认一致。
76
152
 
77
- ### 是否会把 prompt / 代码内容写到 trace?
153
+ 设置 `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` `http/json` 会被忽略并写入告警日志,回退到默认 protobuf。
154
+
155
+ ## 安全与隐私
156
+
157
+ - Span 默认只记录工具名称和调用 ID,**不包含**用户 prompt、工具参数、文件内容或源代码
158
+ - `user_prompt_length` 始终记录(仅长度),prompt 文本需要 `OTEL_LOG_USER_PROMPTS=1` 才会写入
159
+ - 工具参数(文件路径、命令等)需要 `OTEL_LOG_TOOL_DETAILS=1`,个别值超过 512 字符会被截断,总量限制 ~4KB
160
+ - 工具输入输出全文需要 `OTEL_LOG_TOOL_CONTENT=1`,通过 span events 记录,截断于 60KB
161
+ - 所有 opt-in 开关默认关闭,企业管理员可通过 managed settings 统一配置
78
162
 
79
- 不会。CodeBuddy Code 的 trace 仅记录工具调用、模型调用、耗时等结构化指标,不包含用户对话内容或源代码。如果需要记录代码片段需另行启用 standard 报告通道(不在本特性范围)。
163
+ ## FAQ
80
164
 
81
165
  ### 与企业内部上报通道是否冲突?
82
166
 
@@ -85,3 +169,7 @@ export DISABLE_TELEMETRY=1
85
169
  ### 是否支持 metrics / logs?
86
170
 
87
171
  暂不支持,规划中。如有强诉求请反馈到对应 Issue。
172
+
173
+ ### 与 Claude Code 的 OTEL 格式兼容吗?
174
+
175
+ 是的。Span 命名、属性命名、截断策略均对齐 Claude Code 的约定(`{product}.interaction` / `{product}.tool`),确保上游分析平台可统一处理。
@@ -17,6 +17,8 @@ Release Notes 记录了每个版本的用户可见变更,包括:
17
17
 
18
18
  <!-- 新版本自动添加到此处 -->
19
19
 
20
+ - [v2.99.1](./v2.99.1.md) - 2026-05-28
21
+ - [v2.99.0](./v2.99.0.md) - 2026-05-27
20
22
  - [v2.98.1](./v2.98.1.md) - 2026-05-25
21
23
  - [v2.98.0](./v2.98.0.md) - 2026-05-24
22
24
  - [v2.97.5](./v2.97.5.md) - 2026-05-22
@@ -0,0 +1,39 @@
1
+ # 🚀 CodeBuddy Code v2.99.0 发布
2
+
3
+ ## 📦 版本信息
4
+
5
+ | 组件 | 版本 |
6
+ |------|------|
7
+ | CodeBuddy Code CLI | v2.99.0 |
8
+ | Agent SDK JS | v0.3.158 |
9
+ | Agent SDK Python | v0.3.157 |
10
+
11
+ ## ✨ 新功能
12
+
13
+ ### `/goal` 命令:让 CodeBuddy 持续工作直到达成目标
14
+
15
+ 新增 `/goal` 斜杠命令,设置一个完成条件后,CodeBuddy 会跨多轮持续工作直到条件满足:
16
+
17
+ - `/goal all tests pass` — 每轮结束时由小模型评估器判断条件是否成立,未成立则自动继续
18
+ - `/goal` — 查看当前目标状态(已运行时长、turn 数、token 消耗)
19
+ - `/goal clear` — 提前结束目标
20
+
21
+ 支持三态评估:达成(停止)、未达成(继续工作)、不可达成(避免无效循环)。通过 `/resume` 恢复会话时目标自动重新装载。Web UI 同步支持进度条和终态浮层。
22
+
23
+ ### Credit 实际消耗推送
24
+
25
+ 在标准 ACP `usage_update` 上附加含 `credit` 字段的 `usage` 明细,支持上层按轮次累计与展示已消耗 Credit。
26
+
27
+ ### Gemini-3.5-Flash 模型
28
+
29
+ 新增 Gemini-3.5-Flash 模型支持,百万 token 上下文,推理能力均衡,适合日常使用。
30
+
31
+ ## 🐛 问题修复
32
+
33
+ - **安全修复(RCE)**:修复 `apiKeyHelper` 配置在目录信任对话框弹出之前被执行的远程代码执行漏洞,项目作用域配置现在必须等待目录信任完成后才执行
34
+ - **Hook Input 修复**:`agent_type` 现在正确反映配置的 agent 名称;SubagentStop 的 `agent_transcript_path` 指向正确路径
35
+ - **Plan Mode 权限恢复**:修复 ExitPlanMode 在 session 已退出 Plan Mode 时仍错误降级权限的问题
36
+ - **团队任务停止可靠性**:修复成员刚启动时点击停止偶发无法中止、以及成员被强制结束后仍显示运行中的问题
37
+ - **插件热监控无限循环**:修复 PluginsProductProvider 中变更事件无限循环问题
38
+ - **多行输入方向键**:修复后台任务运行时多行输入后方向下键被快捷键拦截的问题
39
+ - **自定义模型 tool call**:新增 `SkipToolCallSupportCheck` 开关,专享版不再移除 tools/tool_choice 字段
@@ -0,0 +1,46 @@
1
+ # 🚀 CodeBuddy Code v2.99.1 发布
2
+
3
+ ## 📦 版本信息
4
+
5
+ | 组件 | 版本 |
6
+ |------|------|
7
+ | CodeBuddy Code CLI | v2.99.1 |
8
+ | Agent SDK JS | v0.3.159 |
9
+ | Agent SDK Python | v0.3.158 |
10
+
11
+ ## 🔧 改进优化
12
+
13
+ ### OTel 可观测性增强
14
+
15
+ - **Span Schema 单一真相源**:新增 `otel-span-schema.ts` 统一管理 span 名称、属性键和事件名,确保实现与文档一致
16
+ - **细粒度隐私开关**:支持 `OTEL_LOG_USER_PROMPTS`、`OTEL_LOG_TOOL_DETAILS`、`OTEL_LOG_TOOL_CONTENT` 等环境变量,逐级 opt-in 控制敏感数据记录
17
+ - **Tool Span 增强**:按开关记录工具输入参数和输出内容,带 60KB 截断保护
18
+ - **Trace 可视化**:Web UI TracesView 新增 LLM 调用统计、Cache 命中率、多模型展示等指标
19
+
20
+ ### Galileo 监控体系升级
21
+
22
+ - 将 tool 打点逻辑拆分为独立的 GalileoToolPreHook / GalileoToolPostHook,职责更单一
23
+ - Agent SLA 全指标补齐 model 维度(ttfb / streaming / task_total / prompt_build / tool / request / cache)
24
+ - 新增 agent_name、agent_purpose、conversation_request_id 维度,支持多角度聚合分析
25
+ - patchName 全局注入,三端统一受 galileo.enable 开关控制
26
+
27
+ ### ACP 会话稳定性
28
+
29
+ - 完善 ACP 团队桥接、会话回放与消息 ID 工具的边界处理,避免渲染抖动
30
+ - 会话运行状态机移除冗余状态切换,状态推进更稳定
31
+
32
+ ### Skill 与工具优化
33
+
34
+ - Skill 列表从 XML 格式改为 Markdown 列表,减少 token 占用
35
+ - 单条 skill 描述截断阈值从 250 降至 150 字符
36
+ - 移除工具返回内容中无意义的标签注入
37
+ - 优化延迟工具列表体积,减少大型 MCP 工具集合对上下文的占用
38
+ - 帮助面板移除推广链接
39
+
40
+ ## 🐛 问题修复
41
+
42
+ - **延迟工具加载**:修复裸名 MCP 工具通过工具搜索加载后无法正确调用的问题
43
+ - **自定义模型透传**:避免把内部上报字段透传给客户网关,仅在非自定义模型时合并 providerData
44
+ - **权限错误提示**:修改无权限文件失败时保留更具体的错误详情,减少排查成本
45
+ - **会话压缩**:修复 `/clear` 后压缩仍可能带入旧会话内容的问题
46
+ - **Galileo 字段大小写**:product.json 中统一为小写 `galileo`
@@ -63,6 +63,7 @@ CodeBuddy Code supports environment variables to control its behavior. These var
63
63
  | `CODEBUDDY_IMAGE_GEN_ENABLED` | Set to `false` or `0` to disable image generation |
64
64
  | `CODEBUDDY_IMAGE_EDIT_ENABLED` | Set to `false` or `0` to disable image editing |
65
65
  | `CODEBUDDY_COMPUTER_USE_ENABLED` | **Experimental**: Set to `true` or `1` to enable the macOS desktop control tool (screenshot, mouse, keyboard). Available only on macOS, disabled by default. The first invocation of keyboard/mouse actions requires authorizing the terminal in System Settings → Privacy & Security → Accessibility and Screen Recording |
66
+ | `CODEBUDDY_WAIT_FOR_MCP_SERVERS_ENABLED` | Set to `0` or `false` to disable the WaitForMcpServers tool. Enabled by default. In interactive mode, MCP connections are not awaited blockingly; when the LLM needs an MCP tool that is not yet ready, it can proactively call this tool to wait on demand. Set to `0` to disable in WorkBuddy scenarios |
66
67
  | `CODEBUDDY_DEFER_TOOL_LOADING` | Set to `false` or `0` to disable MCP tool deferred loading |
67
68
  | `CODEBUDDY_SHOW_ALL_DEFERRED_TOOLS` | Set to `true` or `1` to show full descriptions for all deferred tools |
68
69
  | `CODEBUDDY_DISABLE_CRON` | Set to `1` to disable scheduled tasks |
@@ -1,44 +1,117 @@
1
1
  # Monitoring CodeBuddy Code with OpenTelemetry
2
2
 
3
- CodeBuddy Code supports exporting internal traces to your own OpenTelemetry Collector via the standard OTLP protocol, making it easy to integrate with self-hosted observability platforms.
3
+ CodeBuddy Code supports exporting traces to your own OpenTelemetry Collector via the standard OTLP protocol, making it easy to integrate with self-hosted observability platforms.
4
4
 
5
- > **MVP Scope**: Currently only **traces** (distributed tracing) are supported; custom export of metrics and logs is not yet available. Support will be expanded as needed.
5
+ > **Current Scope**: Supports **traces** (distributed tracing) + 4 privacy opt-in switches. Custom export of metrics and logs is not yet supported.
6
6
 
7
- ## How to Enable
8
-
9
- Once the enable switch is set, traces will be exported using OTel standard environment variables:
7
+ ## Quick Start
10
8
 
11
9
  ```bash
10
+ # 1. Enable telemetry
12
11
  export CODEBUDDY_CODE_ENABLE_TELEMETRY=1
13
- export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector.example.com
12
+
13
+ # 2. Configure OTLP endpoint
14
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
15
+
16
+ # 3. (Optional) Enable privacy opt-in content recording
17
+ export OTEL_LOG_USER_PROMPTS=1
18
+ export OTEL_LOG_TOOL_DETAILS=1
19
+ export OTEL_LOG_TOOL_CONTENT=1
20
+
21
+ # 4. Run
14
22
  codebuddy
15
23
  ```
16
24
 
17
- > A legacy alias `CLAUDE_CODE_ENABLE_TELEMETRY` is also accepted for backward compatibility and is equivalent to `CODEBUDDY_CODE_ENABLE_TELEMETRY`.
25
+ > Claude Code compatibility: `CLAUDE_CODE_ENABLE_TELEMETRY` is equivalent to `CODEBUDDY_CODE_ENABLE_TELEMETRY`.
18
26
 
19
- ## Key Environment Variables
27
+ ## Configuration Variables
20
28
 
21
- For the full list, see [env-vars.md](env-vars.md#opentelemetry-custom-export-traces). Common ones:
29
+ ### Basic Configuration
22
30
 
23
- | Variable | Purpose |
24
- |----------|---------|
25
- | `CODEBUDDY_CODE_ENABLE_TELEMETRY=1` | Enable the OTel export switch |
26
- | `OTEL_TRACES_EXPORTER` | `otlp` (default) / `console` / `none` |
27
- | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP Collector address; `/v1/traces` is appended automatically |
28
- | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Full URL specific to traces; takes higher priority |
29
- | `OTEL_EXPORTER_OTLP_HEADERS` | Request headers `k1=v1,k2=v2`; values support URL encoding |
30
- | `OTEL_SERVICE_NAME` | Override the default `service.name` |
31
- | `OTEL_RESOURCE_ATTRIBUTES` | Additional resource attributes |
31
+ | Variable | Purpose | Example |
32
+ |----------|---------|---------|
33
+ | `CODEBUDDY_CODE_ENABLE_TELEMETRY` | Enable OTel export (required) | `1` |
34
+ | `OTEL_TRACES_EXPORTER` | Exporter type | `otlp` (default), `console`, `none` |
35
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP Collector address; `/v1/traces` is appended automatically | `http://localhost:4318` |
36
+ | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Full URL specific to traces; takes higher priority | `http://localhost:4318/v1/traces` |
37
+ | `OTEL_EXPORTER_OTLP_HEADERS` | Request headers `k1=v1,k2=v2`; values support URL encoding | `Authorization=Bearer%20token` |
38
+ | `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` | Transport protocol | `http/protobuf` (only supported) |
39
+ | `OTEL_SERVICE_NAME` | Override the default `service.name` | `codebuddy-code` |
40
+ | `OTEL_RESOURCE_ATTRIBUTES` | Additional resource attributes | `team=platform,env=prod` |
32
41
 
33
- ## Protocol Support
42
+ ### Privacy Opt-in Switches
34
43
 
35
- Only **`http/protobuf`** (OTLP/HTTP + Protobuf encoding) is supported, consistent with the CodeBuddy Code default.
44
+ Spans do not record any sensitive information by default (prompt content, tool parameters, tool output, etc.). You need to opt in progressively via the following environment variables:
45
+
46
+ | Variable | Purpose | Recorded Content |
47
+ |----------|---------|-----------------|
48
+ | `OTEL_LOG_USER_PROMPTS=1` | Record user prompts | `user_prompt` attribute (not recorded by default; only `user_prompt_length` is recorded) |
49
+ | `OTEL_LOG_TOOL_DETAILS=1` | Record tool parameters | `tool_input` attribute (~4KB truncation) + tool-specific attributes (`file.path`, `command`, etc.) |
50
+ | `OTEL_LOG_TOOL_CONTENT=1` | Record full tool input/output | `tool_input`/`tool_result` span events (60KB truncation) |
51
+ | `OTEL_LOG_RAW_API_BODIES=1` | Record full API request/response bodies | Reserved, not yet implemented |
52
+
53
+ ## Span Structure
54
+
55
+ Each user prompt produces a `codebuddy_code.interaction` root span. Tool calls are recorded as child spans:
56
+
57
+ ```
58
+ codebuddy_code.interaction
59
+ ├── codebuddy_code.tool (Read)
60
+ ├── codebuddy_code.tool (Bash)
61
+ └── codebuddy_code.tool (Agent -> child agent tool spans)
62
+ ```
36
63
 
37
- Setting `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` or `http/json` will be ignored with a warning logged, and will fall back to the default protobuf.
64
+ ### Span Attributes
65
+
66
+ All spans include a `span.type` attribute to identify the type.
67
+
68
+ **`codebuddy_code.interaction`**
69
+
70
+ | Attribute | Description | Controlled By |
71
+ |-----------|-------------|---------------|
72
+ | `span.type` | Fixed value `"interaction"` | |
73
+ | `conversation.id` | Conversation ID | |
74
+ | `conversation.agent` | Agent name | |
75
+ | `user_prompt` | User prompt content (not recorded when disabled) | `OTEL_LOG_USER_PROMPTS` |
76
+ | `user_prompt_length` | Prompt length (always recorded) | |
77
+ | `conversation.cancelled` | `true` when conversation is cancelled | |
78
+
79
+ **`codebuddy_code.tool`**
80
+
81
+ | Attribute | Description | Controlled By |
82
+ |-----------|-------------|---------------|
83
+ | `span.type` | Fixed value `"tool"` | |
84
+ | `tool_name` | Tool name | |
85
+ | `tool.call_id` | Tool call ID (always recorded) | |
86
+ | `file.path` | File path (Read/Write/Edit) | `OTEL_LOG_TOOL_DETAILS` |
87
+ | `command` | Bash command | `OTEL_LOG_TOOL_DETAILS` |
88
+ | `command.timeout` | Command timeout (milliseconds) | `OTEL_LOG_TOOL_DETAILS` |
89
+ | `glob.pattern` | Glob search pattern | `OTEL_LOG_TOOL_DETAILS` |
90
+ | `grep.pattern` | Grep regex pattern | `OTEL_LOG_TOOL_DETAILS` |
91
+ | `http.url` | WebFetch URL | `OTEL_LOG_TOOL_DETAILS` |
92
+ | `search.query` | WebSearch query | `OTEL_LOG_TOOL_DETAILS` |
93
+ | `agent.prompt` | Sub-agent prompt | `OTEL_LOG_TOOL_DETAILS` |
94
+ | `agent.type` | Sub-agent type | `OTEL_LOG_TOOL_DETAILS` |
95
+ | `mcp.server` | MCP server name | `OTEL_LOG_TOOL_DETAILS` |
96
+ | `mcp.tool` | MCP tool name | `OTEL_LOG_TOOL_DETAILS` |
97
+ | `tool_input` | Tool input JSON (~4KB truncation) | `OTEL_LOG_TOOL_DETAILS` |
98
+ | `tool_input_truncated` | Whether input was truncated | `OTEL_LOG_TOOL_DETAILS` |
99
+ | `tool_input_original_length` | Original length before truncation | `OTEL_LOG_TOOL_DETAILS` |
100
+
101
+ **`codebuddy_code.tool` span events** (requires `OTEL_LOG_TOOL_CONTENT=1`)
102
+
103
+ | Event Name | Attribute | Description |
104
+ |------------|-----------|-------------|
105
+ | `tool_input` | `content` | Full tool input (60KB truncation) |
106
+ | `tool_input` | `content_truncated` | Whether truncated |
107
+ | `tool_input` | `content_original_length` | Length before truncation |
108
+ | `tool_result` | `content` | Full tool output (60KB truncation) |
109
+ | `tool_result` | `content_truncated` | Whether truncated |
110
+ | `tool_result` | `content_original_length` | Length before truncation |
38
111
 
39
112
  ## Typical Scenarios
40
113
 
41
- ### 1. Export to a Self-Hosted Enterprise Collector
114
+ ### Export to a Self-Hosted Enterprise Collector
42
115
 
43
116
  ```bash
44
117
  export CODEBUDDY_CODE_ENABLE_TELEMETRY=1
@@ -48,16 +121,17 @@ export OTEL_SERVICE_NAME=codebuddy-code
48
121
  export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=prod,team=copilot
49
122
  ```
50
123
 
51
- ### 2. Local Debug Trace Output
52
-
53
- For debugging, send traces directly to stdout:
124
+ ### Local Debugging (Console Output)
54
125
 
55
126
  ```bash
56
127
  export CODEBUDDY_CODE_ENABLE_TELEMETRY=1
57
128
  export OTEL_TRACES_EXPORTER=console
129
+ export OTEL_LOG_USER_PROMPTS=1
130
+ export OTEL_LOG_TOOL_DETAILS=1
131
+ export OTEL_LOG_TOOL_CONTENT=1
58
132
  ```
59
133
 
60
- ### 3. Temporarily Disable
134
+ ### Disable Telemetry
61
135
 
62
136
  ```bash
63
137
  export OTEL_TRACES_EXPORTER=none
@@ -68,15 +142,25 @@ export DISABLE_TELEMETRY=1
68
142
  ## Priority and Fallback
69
143
 
70
144
  1. `DISABLE_TELEMETRY=1` has the highest priority and disables all telemetry.
71
- 2. Enable evaluation: enabled in the built-in product configuration **or** `CODEBUDDY_CODE_ENABLE_TELEMETRY` (or its legacy alias `CLAUDE_CODE_ENABLE_TELEMETRY`) is set to a truthy value (`1` / `true` / `yes` / `on`).
145
+ 2. Enable evaluation: enabled in the built-in product configuration **or** `CODEBUDDY_CODE_ENABLE_TELEMETRY` / `CLAUDE_CODE_ENABLE_TELEMETRY` is set to a truthy value (`1` / `true` / `yes` / `on`).
72
146
  3. Endpoint priority: `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` > `OTEL_EXPORTER_OTLP_ENDPOINT` > `telemetry.tracing.url` in the built-in product configuration.
73
147
  4. Headers: env and product configuration are merged; env keys with the same name override product configuration.
74
148
 
75
- ## FAQ
149
+ ## Protocol Support
150
+
151
+ Only **`http/protobuf`** (OTLP/HTTP + Protobuf encoding) is supported, consistent with the Claude Code default.
76
152
 
77
- ### Will prompts or code content be written into traces?
153
+ Setting `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` or `http/json` will be ignored with a warning logged, falling back to the default protobuf.
78
154
 
79
- No. CodeBuddy Code traces only record structured metrics such as tool calls, model calls, and durations. They do not contain user conversation content or source code. If you need to record code snippets, you must separately enable the standard reporting channel (which is outside the scope of this feature).
155
+ ## Security and Privacy
156
+
157
+ - Spans only record tool names and call IDs by default, **excluding** user prompts, tool parameters, file content, or source code
158
+ - `user_prompt_length` is always recorded (length only); prompt text requires `OTEL_LOG_USER_PROMPTS=1` to be written
159
+ - Tool parameters (file paths, commands, etc.) require `OTEL_LOG_TOOL_DETAILS=1`; individual values exceeding 512 characters are truncated, with a total limit of ~4KB
160
+ - Full tool input/output requires `OTEL_LOG_TOOL_CONTENT=1`, recorded via span events, truncated at 60KB
161
+ - All opt-in switches are disabled by default; enterprise administrators can configure them uniformly via managed settings
162
+
163
+ ## FAQ
80
164
 
81
165
  ### Does it conflict with the internal enterprise reporting channel?
82
166
 
@@ -85,3 +169,7 @@ No conflict. OTel custom export and the built-in standard reporting (`telemetry.
85
169
  ### Is metrics / logs supported?
86
170
 
87
171
  Not yet supported, but planned. If you have a strong need, please provide feedback on the corresponding Issue.
172
+
173
+ ### Is it compatible with Claude Code's OTEL format?
174
+
175
+ Yes. Span naming, attribute naming, and truncation strategies are aligned with Claude Code's conventions (`{product}.interaction` / `{product}.tool`), ensuring upstream analysis platforms can process them uniformly.
@@ -17,6 +17,8 @@ Difference from CHANGELOG.md:
17
17
 
18
18
  <!-- New versions are automatically added here -->
19
19
 
20
+ - [v2.99.1](./v2.99.1.md) - 2026-05-28
21
+ - [v2.99.0](./v2.99.0.md) - 2026-05-27
20
22
  - [v2.98.1](./v2.98.1.md) - 2026-05-25
21
23
  - [v2.98.0](./v2.98.0.md) - 2026-05-24
22
24
  - [v2.97.5](./v2.97.5.md) - 2026-05-22
@@ -0,0 +1,39 @@
1
+ # 🚀 CodeBuddy Code v2.99.0 Release
2
+
3
+ ## 📦 Version Information
4
+
5
+ | Component | Version |
6
+ |-----------|---------|
7
+ | CodeBuddy Code CLI | v2.99.0 |
8
+ | Agent SDK JS | v0.3.158 |
9
+ | Agent SDK Python | v0.3.157 |
10
+
11
+ ## ✨ New Features
12
+
13
+ ### `/goal` Command: Keep CodeBuddy Working Until Goal is Achieved
14
+
15
+ New `/goal` slash command that lets you set a completion condition, after which CodeBuddy will continue working across multiple turns until the condition is met:
16
+
17
+ - `/goal all tests pass` — At the end of each turn, a lightweight model evaluator checks whether the condition is met; if not, it automatically continues
18
+ - `/goal` — View current goal status (elapsed time, turn count, token consumption)
19
+ - `/goal clear` — End the goal early
20
+
21
+ Supports tri-state evaluation: achieved (stop), not achieved (continue working), unachievable (avoid infinite loops). Goals are automatically reloaded when resuming a session via `/resume`. Web UI supports progress bars and terminal state overlays.
22
+
23
+ ### Credit Consumption Push
24
+
25
+ Attaches `usage` details with a `credit` field to the standard ACP `usage_update`, enabling upstream systems to accumulate and display consumed Credits per turn.
26
+
27
+ ### Gemini-3.5-Flash Model
28
+
29
+ Added Gemini-3.5-Flash model support with million-token context window, balanced reasoning capabilities, suitable for everyday use.
30
+
31
+ ## 🐛 Bug Fixes
32
+
33
+ - **Security Fix (RCE)**: Fixed a remote code execution vulnerability where `apiKeyHelper` configuration was executed before the directory trust dialog appeared; project-scoped configurations now must wait for directory trust completion before execution
34
+ - **Hook Input Fix**: `agent_type` now correctly reflects the configured agent name; SubagentStop's `agent_transcript_path` now points to the correct path
35
+ - **Plan Mode Permission Restore**: Fixed an issue where ExitPlanMode incorrectly downgraded permissions when the session had already exited Plan Mode
36
+ - **Team Task Stop Reliability**: Fixed occasional inability to stop members immediately after startup, and members still showing as running after being force-terminated
37
+ - **Plugin Hot-Watch Infinite Loop**: Fixed an infinite loop issue with change events in PluginsProductProvider
38
+ - **Multi-line Input Arrow Keys**: Fixed down arrow key being intercepted by shortcuts after multi-line input while background tasks are running
39
+ - **Custom Model Tool Call**: Added `SkipToolCallSupportCheck` switch; dedicated editions no longer remove tools/tool_choice fields
@@ -0,0 +1,46 @@
1
+ # 🚀 CodeBuddy Code v2.99.1 Release
2
+
3
+ ## 📦 Version Information
4
+
5
+ | Component | Version |
6
+ |-----------|---------|
7
+ | CodeBuddy Code CLI | v2.99.1 |
8
+ | Agent SDK JS | v0.3.159 |
9
+ | Agent SDK Python | v0.3.158 |
10
+
11
+ ## 🔧 Improvements
12
+
13
+ ### Enhanced OTel Observability
14
+
15
+ - **Single Source of Truth for Span Schema**: Added `otel-span-schema.ts` to centrally manage span names, attribute keys, and event names, ensuring implementation stays consistent with documentation
16
+ - **Fine-grained Privacy Switches**: Support for environment variables such as `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_DETAILS`, and `OTEL_LOG_TOOL_CONTENT`, providing tiered opt-in control over sensitive data logging
17
+ - **Tool Span Enhancements**: Records tool input parameters and output content based on switches, with 60KB truncation protection
18
+ - **Trace Visualization**: Web UI TracesView adds new metrics including LLM call statistics, cache hit rate, and multi-model display
19
+
20
+ ### Galileo Monitoring System Upgrade
21
+
22
+ - Split tool tracking logic into independent GalileoToolPreHook / GalileoToolPostHook with more focused responsibilities
23
+ - Completed model dimension coverage for all Agent SLA metrics (ttfb / streaming / task_total / prompt_build / tool / request / cache)
24
+ - Added agent_name, agent_purpose, and conversation_request_id dimensions to support multi-angle aggregation analysis
25
+ - patchName is globally injected, with all three platforms uniformly controlled by the galileo.enable switch
26
+
27
+ ### ACP Session Stability
28
+
29
+ - Refined boundary handling for ACP team bridging, session replay, and message ID utilities to avoid rendering jitter
30
+ - Removed redundant state transitions in the session run state machine for more stable state progression
31
+
32
+ ### Skill and Tool Optimizations
33
+
34
+ - Skill list changed from XML format to Markdown list, reducing token usage
35
+ - Single skill description truncation threshold lowered from 250 to 150 characters
36
+ - Removed meaningless tag injection from tool return content
37
+ - Optimized deferred tool list size, reducing context occupation by large MCP tool collections
38
+ - Removed promotional links from the help panel
39
+
40
+ ## 🐛 Bug Fixes
41
+
42
+ - **Deferred Tool Loading**: Fixed the issue where bare-name MCP tools loaded via tool search could not be invoked correctly
43
+ - **Custom Model Pass-through**: Avoid passing internal reporting fields to customer gateways; merge providerData only for non-custom models
44
+ - **Permission Error Messages**: Preserve more specific error details when modifying permission-restricted files fails, reducing troubleshooting cost
45
+ - **Session Compaction**: Fixed the issue where compaction after `/clear` could still carry over old session content
46
+ - **Galileo Field Casing**: Unified to lowercase `galileo` in product.json