@tencent-ai/agent-sdk 0.3.158 → 0.3.159

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.
@@ -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,7 @@ Release Notes 记录了每个版本的用户可见变更,包括:
17
17
 
18
18
  <!-- 新版本自动添加到此处 -->
19
19
 
20
+ - [v2.99.0](./v2.99.0.md) - 2026-05-27
20
21
  - [v2.98.1](./v2.98.1.md) - 2026-05-25
21
22
  - [v2.98.0](./v2.98.0.md) - 2026-05-24
22
23
  - [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 字段
@@ -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,7 @@ Difference from CHANGELOG.md:
17
17
 
18
18
  <!-- New versions are automatically added here -->
19
19
 
20
+ - [v2.99.0](./v2.99.0.md) - 2026-05-27
20
21
  - [v2.98.1](./v2.98.1.md) - 2026-05-25
21
22
  - [v2.98.0](./v2.98.0.md) - 2026-05-24
22
23
  - [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