@tencent-ai/codebuddy-code 2.109.0 → 2.109.1
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.
- package/CHANGELOG.md +12 -0
- package/dist/codebuddy-headless.js +8 -8
- package/dist/codebuddy.js +9 -9
- package/dist/web-ui/docs/cn/cli/cli-reference.md +8 -3
- package/dist/web-ui/docs/cn/cli/env-vars.md +2 -1
- package/dist/web-ui/docs/cn/cli/iam.md +9 -5
- package/dist/web-ui/docs/cn/cli/interactive-mode.md +2 -2
- package/dist/web-ui/docs/cn/cli/permission-modes.md +373 -101
- package/dist/web-ui/docs/cn/cli/permissions.md +36 -14
- package/dist/web-ui/docs/cn/cli/prewarm.md +135 -0
- package/dist/web-ui/docs/cn/cli/release-notes/README.md +14 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.0.md +48 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.1.md +13 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.2.md +24 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.3.md +14 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.4.md +24 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.5.md +18 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.6.md +15 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.106.7.md +13 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.107.0.md +30 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.108.0.md +20 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.108.1.md +15 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.108.2.md +13 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.109.0.md +24 -0
- package/dist/web-ui/docs/cn/cli/settings.md +166 -2
- package/dist/web-ui/docs/en/cli/cli-reference.md +15 -10
- package/dist/web-ui/docs/en/cli/env-vars.md +6 -5
- package/dist/web-ui/docs/en/cli/iam.md +9 -5
- package/dist/web-ui/docs/en/cli/interactive-mode.md +3 -3
- package/dist/web-ui/docs/en/cli/permission-modes.md +373 -101
- package/dist/web-ui/docs/en/cli/permissions.md +46 -24
- package/dist/web-ui/docs/en/cli/prewarm.md +125 -0
- package/dist/web-ui/docs/en/cli/release-notes/README.md +14 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.0.md +48 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.1.md +13 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.2.md +24 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.3.md +14 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.4.md +24 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.5.md +18 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.6.md +15 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.106.7.md +13 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.107.0.md +30 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.108.0.md +20 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.108.1.md +15 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.108.2.md +13 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.109.0.md +24 -0
- package/dist/web-ui/docs/en/cli/settings.md +166 -2
- package/dist/web-ui/docs/search-index-en.json +1 -1
- package/dist/web-ui/docs/search-index-zh.json +1 -1
- package/dist/web-ui/docs/sidebar-en.json +1 -1
- package/dist/web-ui/docs/sidebar-zh.json +1 -1
- package/package.json +1 -1
- package/product.cloudhosted.json +2 -2
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +2 -2
- package/product.selfhosted.json +2 -2
|
@@ -60,6 +60,7 @@ CodeBuddy Code 使用分层配置系统,让您能够在不同级别进行个
|
|
|
60
60
|
| `env` | 应用于每个会话的环境变量 | `{"FOO": "bar"}` |
|
|
61
61
|
| `includeCoAuthoredBy` | 是否在 git 提交和拉取请求中包含 `co-authored-by CodeBuddy` 署名(默认:`true`) | `false` |
|
|
62
62
|
| `permissions` | 权限配置,见下表 | |
|
|
63
|
+
| `autoMode` | `auto` 权限模式的分类器规则,见 [Auto Mode 配置](#auto-mode-配置) | `{"allow": ["$defaults", "允许 dev 环境发布"]}` |
|
|
63
64
|
| `hooks` | 配置在工具执行前后运行的自定义命令。见 [hooks 文档](hooks.md) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |
|
|
64
65
|
| `disableAllHooks` | 禁用所有 [hooks](hooks.md) | `true` |
|
|
65
66
|
| `allowUntrustedFrontmatterHooks` | 是否允许执行来自**非 product 内置**来源的 agent/skill 的 frontmatter `hooks` 字段(包括用户本地 `.codebuddy/agents\|skills/*.md` 和插件市场)。默认 `false`,防止不可信的 md 文件静默启动 shell 命令;只有 product 内置 agent/skill 不受影响。 | `true` |
|
|
@@ -92,9 +93,172 @@ CodeBuddy Code 使用分层配置系统,让您能够在不同级别进行个
|
|
|
92
93
|
| `ask` | [权限规则](iam.md#配置权限)数组,在工具使用时询问确认 | `[ "Bash(git push:*)" ]` |
|
|
93
94
|
| `deny` | [权限规则](iam.md#配置权限)数组,拒绝工具使用。用于排除 CodeBuddy Code 访问敏感文件。**注意:** Bash 模式是前缀匹配,可以被绕过(参见 [Bash 权限限制](iam.md#工具特定的权限规则)) | `[ "WebFetch", "Bash(curl:*)", "Read(./.env)", "Read(./secrets/**)" ]` |
|
|
94
95
|
| `additionalDirectories` | CodeBuddy 可以访问的额外[工作目录](iam.md#工作目录) | `[ "../docs/" ]` |
|
|
95
|
-
| `defaultMode` | 打开 CodeBuddy Code 时的默认[权限模式](
|
|
96
|
+
| `defaultMode` | 打开 CodeBuddy Code 时的默认[权限模式](permission-modes.md)。常用值:`default`、`acceptEdits`、`auto`、`dontAsk`、`plan`、`bypassPermissions` | `"acceptEdits"` |
|
|
96
97
|
| `disableBypassPermissionsMode` | 设置为 `"disable"` 以防止激活 `bypassPermissions` 模式。这会禁用 `-y` 和 `--dangerously-skip-permissions` 命令行标志 | `"disable"` |
|
|
97
|
-
| `
|
|
98
|
+
| `disableAutoMode` | 设置为 `"disable"` 以防止激活 `auto` 模式。禁用后,`--permission-mode auto` 和 `defaultMode: "auto"` 都会回退到 `default` | `"disable"` |
|
|
99
|
+
| `subagentPermissionMode` | 覆盖 subagent/团队成员的默认权限模式。设置后所有 subagent 使用此模式,而非继承主 session 的模式。Agent 工具的 `mode` 参数优先级更高;但主会话若处于 `auto` / `dontAsk`,子代理仍会受父会话权限上限约束 | `"bypassPermissions"` |
|
|
100
|
+
|
|
101
|
+
### Auto Mode 配置
|
|
102
|
+
|
|
103
|
+
`autoMode` 是一个**顶层 settings 字段**,不是 `permissions` 的子字段。它定义 `auto` 权限模式使用的分类器上下文与规则。
|
|
104
|
+
|
|
105
|
+
#### `autoMode` 里有哪些字段?
|
|
106
|
+
|
|
107
|
+
| 配置键 | 作用 | 示例 |
|
|
108
|
+
|:------|:-----|:-----|
|
|
109
|
+
| `environment` | 描述哪些仓库、域名、服务、存储位置属于你的受信边界,帮助分类器判断什么算“内部” | `["$defaults", "Trusted internal domains: staging.example.com"]` |
|
|
110
|
+
| `allow` | 补充“在 auto 下通常可自动放行”的自然语言规则 | `["$defaults", "允许 dev namespace 的发布"]` |
|
|
111
|
+
| `soft_deny` | 补充“通常应拦截,但在明确用户意图下可重试”的规则描述 | `["$defaults", "修改共享测试数据库 schema"]` |
|
|
112
|
+
| `hard_deny` | 补充“默认必须阻断”的高风险规则描述 | `["$defaults", "把私有仓库内容发布到公网"]` |
|
|
113
|
+
|
|
114
|
+
这些字段的值都是**字符串数组**。数组项不是正则,也不是工具模式,而是写给分类器看的**自然语言规则**。
|
|
115
|
+
|
|
116
|
+
#### 分类器会从哪里读取 `autoMode`?
|
|
117
|
+
|
|
118
|
+
CodeBuddy 只会从以下来源读取 `autoMode`:
|
|
119
|
+
|
|
120
|
+
| 来源 | 典型位置 | 用途 |
|
|
121
|
+
|:-----|:---------|:-----|
|
|
122
|
+
| user settings | `~/.codebuddy/settings.json` | 跨项目的个人受信边界 |
|
|
123
|
+
| project-local settings | `.codebuddy/settings.local.json` | 某个项目、某台机器上的本地补充规则 |
|
|
124
|
+
| CLI `--settings` | `codebuddy --settings '{...}'` | 一次性自动化或临时覆盖 |
|
|
125
|
+
|
|
126
|
+
不会读取的来源:
|
|
127
|
+
|
|
128
|
+
- 共享项目配置 `.codebuddy/settings.json`
|
|
129
|
+
|
|
130
|
+
原因是:`autoMode` 属于本地安全边界定义,仓库提交的配置不应该悄悄改变你本机对“哪些地方算内部、哪些动作算允许”的判断。
|
|
131
|
+
|
|
132
|
+
#### 与 `permissions.defaultMode: "auto"` 的区别
|
|
133
|
+
|
|
134
|
+
这里有两个容易混淆的限制:
|
|
135
|
+
|
|
136
|
+
1. **`autoMode` 规则来源**:允许来自 user / project-local / CLI
|
|
137
|
+
2. **默认进入 `auto` 模式的授权来源**:只允许来自 user / CLI
|
|
138
|
+
|
|
139
|
+
也就是说:
|
|
140
|
+
|
|
141
|
+
- `.codebuddy/settings.local.json` **可以**补充 `autoMode.environment / allow / soft_deny / hard_deny`
|
|
142
|
+
- 但 `.codebuddy/settings.local.json` **不能**通过 `permissions.defaultMode: "auto"` 让会话默认进入 `auto`
|
|
143
|
+
- `.codebuddy/settings.json` 两者都不行:既不能提供 `autoMode`,也不能授予 `defaultMode: "auto"`
|
|
144
|
+
|
|
145
|
+
#### 多个来源如何合并?
|
|
146
|
+
|
|
147
|
+
`autoMode` 的四个字段会按来源顺序合并:
|
|
148
|
+
|
|
149
|
+
1. user
|
|
150
|
+
2. project-local
|
|
151
|
+
3. CLI
|
|
152
|
+
|
|
153
|
+
合并时遵循两个原则:
|
|
154
|
+
|
|
155
|
+
- 每个字段**独立合并**,互不影响
|
|
156
|
+
- 每个字段都是把不同来源的数组**追加**在一起,再统一处理 `"$defaults"`
|
|
157
|
+
|
|
158
|
+
这意味着:
|
|
159
|
+
|
|
160
|
+
- 你只设置 `environment`,不会影响 `allow` / `soft_deny` / `hard_deny` 的默认值
|
|
161
|
+
- 你可以在 user settings 里放组织级受信域名,再在 project-local 补充某个项目独有的 staging 服务
|
|
162
|
+
|
|
163
|
+
#### `"$defaults"` 怎么工作?
|
|
164
|
+
|
|
165
|
+
`"$defaults"` 是一个特殊占位符,表示“把内置默认规则插到这里”。
|
|
166
|
+
|
|
167
|
+
例如:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"autoMode": {
|
|
172
|
+
"environment": [
|
|
173
|
+
"$defaults",
|
|
174
|
+
"Trusted internal domains: staging.example.com"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
表示:
|
|
181
|
+
|
|
182
|
+
- 先使用内置 `environment` 默认规则
|
|
183
|
+
- 再追加你自定义的 `staging.example.com`
|
|
184
|
+
|
|
185
|
+
关键语义:
|
|
186
|
+
|
|
187
|
+
- 字段**未配置**:该字段直接使用内置默认规则
|
|
188
|
+
- 字段里**包含** `"$defaults"`:在该位置展开默认规则
|
|
189
|
+
- 字段里**不包含** `"$defaults"`:表示**完整替换**该字段的内置默认规则
|
|
190
|
+
- 多个来源都写了 `"$defaults"` 时,内置规则只会展开**一次**,不会重复注入
|
|
191
|
+
|
|
192
|
+
额外提醒:
|
|
193
|
+
|
|
194
|
+
- `soft_deny` / `hard_deny` 如果不写 `"$defaults"`,等于主动放弃内置安全规则
|
|
195
|
+
- 运行时会对此打 warning,但不会阻止你这样配置
|
|
196
|
+
|
|
197
|
+
#### 如何检查当前生效结果?
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
codebuddy auto-mode defaults
|
|
201
|
+
codebuddy auto-mode config
|
|
202
|
+
codebuddy auto-mode critique
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
这三个命令分别用于:
|
|
206
|
+
|
|
207
|
+
- `defaults`:打印内置默认规则
|
|
208
|
+
- `config`:打印**最终生效**的规则(含多来源合并、`"$defaults"` 展开后的结果)
|
|
209
|
+
- `critique`:让 lite 模型审视你自定义的 `allow` / `soft_deny` / `hard_deny` 是否含糊、冗余或容易误伤
|
|
210
|
+
|
|
211
|
+
如果你准备完全接管某个字段,最稳妥的做法通常是:
|
|
212
|
+
|
|
213
|
+
1. 先运行 `codebuddy auto-mode defaults`
|
|
214
|
+
2. 复制内置规则
|
|
215
|
+
3. 在你的 settings 中显式改写
|
|
216
|
+
4. 再运行 `codebuddy auto-mode config` 检查最终结果
|
|
217
|
+
|
|
218
|
+
#### 配置示例
|
|
219
|
+
|
|
220
|
+
##### 只补充受信环境
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"autoMode": {
|
|
225
|
+
"environment": [
|
|
226
|
+
"$defaults",
|
|
227
|
+
"Source control: git.example.com/acme and all repos under it",
|
|
228
|
+
"Trusted internal domains: staging.example.com, api.internal.example.com",
|
|
229
|
+
"Trusted buckets: s3://acme-build-artifacts"
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
##### 同时补充 allow / deny 规则
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"permissions": {
|
|
240
|
+
"defaultMode": "auto"
|
|
241
|
+
},
|
|
242
|
+
"autoMode": {
|
|
243
|
+
"environment": [
|
|
244
|
+
"$defaults",
|
|
245
|
+
"Trusted internal domains: staging.example.com"
|
|
246
|
+
],
|
|
247
|
+
"allow": [
|
|
248
|
+
"$defaults",
|
|
249
|
+
"允许 dev namespace 的发布"
|
|
250
|
+
],
|
|
251
|
+
"soft_deny": [
|
|
252
|
+
"$defaults",
|
|
253
|
+
"修改共享测试数据库 schema"
|
|
254
|
+
],
|
|
255
|
+
"hard_deny": [
|
|
256
|
+
"$defaults",
|
|
257
|
+
"把私有仓库内容发布到公网"
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
```
|
|
98
262
|
|
|
99
263
|
### 记忆功能配置
|
|
100
264
|
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
| `codebuddy daemon stop` | Stop the Daemon | `codebuddy daemon stop` |
|
|
20
20
|
| `codebuddy daemon status` | View Daemon status | `codebuddy daemon status` |
|
|
21
21
|
| `codebuddy daemon restart` | Restart the Daemon | `codebuddy daemon restart` |
|
|
22
|
+
| `codebuddy auto-mode defaults` | Print the built-in classification rules for `auto` mode | `codebuddy auto-mode defaults` |
|
|
23
|
+
| `codebuddy auto-mode config` | Print the currently active `auto` mode configuration | `codebuddy auto-mode config` |
|
|
24
|
+
| `codebuddy auto-mode critique` | Use a lite model to critique your custom `auto` rules | `codebuddy auto-mode critique` |
|
|
22
25
|
| `codebuddy ps` | List all active Worker processes | `codebuddy ps` |
|
|
23
26
|
| `codebuddy logs <pid\|name>` | View Worker logs | `codebuddy logs feature-x` |
|
|
24
27
|
| `codebuddy attach <pid\|name>` | Attach to a background Worker | `codebuddy attach feature-x` |
|
|
@@ -51,8 +54,8 @@ Command-line parameters to customize CodeBuddy Code behavior:
|
|
|
51
54
|
| `--model` | Set the model for the current session using an alias, such as the latest model alias (`sonnet` or `opus`) or full model name | `codebuddy --model gpt-5` |
|
|
52
55
|
| `--text-to-image-model` | Set the model ID for text-to-image generation | `codebuddy --text-to-image-model your-image-model` |
|
|
53
56
|
| `--image-to-image-model` | Set the model ID for image-to-image generation | `codebuddy --image-to-image-model your-edit-model` |
|
|
54
|
-
| `--permission-mode` | Start with specified [permission mode](./
|
|
55
|
-
| `--subagent-permission-mode` | Set the default permission mode for subagents/team members, overriding the mode inherited from the main session
|
|
57
|
+
| `--permission-mode` | Start with specified [permission mode](./permission-modes.md). Common values: `default`, `acceptEdits`, `auto`, `dontAsk`, `plan`, `bypassPermissions` | `codebuddy --permission-mode auto` |
|
|
58
|
+
| `--subagent-permission-mode` | Set the default permission mode for subagents/team members, overriding the mode inherited from the main session. Supports `acceptEdits`, `default`, `plan`, `auto`, `dontAsk`, `bypassPermissions` | `codebuddy --subagent-permission-mode dontAsk` |
|
|
56
59
|
| `--permission-prompt-tool` | Specify MCP tool to handle permission prompts in non-interactive mode | `codebuddy -p --permission-prompt-tool mcp_auth_tool "query"` |
|
|
57
60
|
| `--resume` | Resume a specific session by ID, or select interactively in interactive mode | `codebuddy --resume abc123 "query"` |
|
|
58
61
|
| `--continue` | Load the most recent conversation in the current directory | `codebuddy --continue` |
|
|
@@ -66,8 +69,10 @@ Command-line parameters to customize CodeBuddy Code behavior:
|
|
|
66
69
|
| `--bg` | Run session in the background (detached mode), logs output to `~/.codebuddy/logs/`. See [Daemon documentation](daemon.md) | `codebuddy --bg "implement login page"` |
|
|
67
70
|
| `--name <name>` | Background session name (used with `--bg`, makes it easy to find via `ps`/`logs`/`kill`) | `codebuddy --bg --name feature-x "implement feature"` |
|
|
68
71
|
| `--serve` | Start HTTP server (Web UI, REST API, ACP protocol) | `codebuddy --serve --port 8080` |
|
|
72
|
+
| `--prewarm` | Start in prewarm standby mode: complete startup initialization then suspend, waiting for external wake-up via IPC (working directory is bound only upon wake-up). Used to eliminate cold-start latency when spinning up sessions. Disabled by default. | `codebuddy --prewarm --prewarm-id pool1` |
|
|
73
|
+
| `--prewarm-id <id>` | Prewarm IPC endpoint identifier (defaults to the process PID), used to construct local socket/pipe addresses. Used with the `cbc-prewarm` management command. | `codebuddy --prewarm --prewarm-id pool1` |
|
|
69
74
|
|
|
70
|
-
> **Important Note**: When using
|
|
75
|
+
> **Important Note**: When using `-p/--print` for non-interactive execution, operations involving file reading/writing, command execution, network requests, etc. must have an explicit permission strategy: the most common approach is `-y` / `--dangerously-skip-permissions`, but you can also use `--permission-mode auto`, `--permission-mode dontAsk`, pre-configured `permissions.allow` rules, or a dedicated permission prompt MCP tool. Otherwise, operations requiring human confirmation will be blocked.
|
|
71
76
|
|
|
72
77
|
<Tip>
|
|
73
78
|
The `--output-format json` parameter is particularly useful for scripting and automation, allowing you to programmatically parse CodeBuddy's responses.
|
|
@@ -77,13 +82,13 @@ Command-line parameters to customize CodeBuddy Code behavior:
|
|
|
77
82
|
|
|
78
83
|
The `--agents` parameter accepts a JSON object defining one or more custom Sub-Agents. Each Sub-Agent requires a unique name (as the key) and a definition object containing the following fields:
|
|
79
84
|
|
|
80
|
-
| Field
|
|
81
|
-
|
|
|
82
|
-
| `description`
|
|
83
|
-
| `prompt`
|
|
84
|
-
| `tools`
|
|
85
|
-
| `disallowedTools` | No
|
|
86
|
-
| `model`
|
|
85
|
+
| Field | Required | Description |
|
|
86
|
+
| :---------------- | :------- | :----------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `description` | Yes | Natural language description of when the Sub-Agent should be invoked |
|
|
88
|
+
| `prompt` | Yes | System prompt that guides the Sub-Agent's behavior |
|
|
89
|
+
| `tools` | No | Array of specific tools the Sub-Agent can use (e.g., `["Read", "Edit", "Bash"]`). Omit to inherit all tools |
|
|
90
|
+
| `disallowedTools` | No | Array of tools the Sub-Agent is forbidden to use (blacklist), unioned with the session-level `--disallowedTools` |
|
|
91
|
+
| `model` | No | Model alias to use: `sonnet`, `opus`, or `haiku`. Omit to use the default Sub-Agent model |
|
|
87
92
|
|
|
88
93
|
Example:
|
|
89
94
|
|
|
@@ -39,10 +39,10 @@ CodeBuddy Code supports environment variables to control its behavior. These var
|
|
|
39
39
|
| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands (default: 120000) |
|
|
40
40
|
| `BASH_MAX_OUTPUT_LENGTH` | Maximum characters of bash output retained in memory (default: 30000, max: 150000). Content exceeding the limit is mid-truncated (keeping head 20% + tail 80%), and the full output is automatically saved to disk |
|
|
41
41
|
| `BASH_MAX_TIMEOUT_MS` | Maximum timeout the model can set for long-running bash commands (default: 600000) |
|
|
42
|
-
| `CODEBUDDY_BASH_ASSISTANT_BUDGET_MS` | Main conversation response budget (milliseconds, default `0`=off). When set to `>0`, foreground Bash/PowerShell commands in the main session that exceed this duration are automatically converted into background tasks to keep the conversation responsive. Sub-agents are not affected by this budget. Aligns with
|
|
42
|
+
| `CODEBUDDY_BASH_ASSISTANT_BUDGET_MS` | Main conversation response budget (milliseconds, default `0`=off). When set to `>0`, foreground Bash/PowerShell commands in the main session that exceed this duration are automatically converted into background tasks to keep the conversation responsive. Sub-agents are not affected by this budget. Aligns with Claude Code's `ASSISTANT_BLOCKING_BUDGET_MS` (official default value is `15000`) |
|
|
43
43
|
| `CODEBUDDY_BASH_AUTO_BACKGROUND_DISABLED` | Set to `1` to disable timeout auto-backgrounding; foreground commands fall back to the old SIGTERM/kill hard-kill behavior on timeout. Only used for debugging or temporary rollback when encountering regressions; keep the default (unset) in normal scenarios |
|
|
44
|
-
| `CODEBUDDY_BASH_BG_MAX_OUTPUT_BYTES` | Total byte limit for the on-disk file of stdout+stderr for background bash tasks (default `52428800` = 50MB). When exceeded, the size watchdog fires `SIGKILL` and marks the task as `killed`, with a notice injected at the end of stderr.
|
|
45
|
-
| `CODEBUDDY_BASH_BG_PIPE_MODE` | Set to `1` to force background tasks back to pipe mode (not using file fds), for rollback or debugging. The default (unset) uses file fd mode, which solves the zombie process issue caused by grandchild processes (e.g., spawned via `nohup`) holding parent pipe fds; the sandbox path automatically falls back to pipe and does not require explicit setting. There is no equivalent toggle
|
|
44
|
+
| `CODEBUDDY_BASH_BG_MAX_OUTPUT_BYTES` | Total byte limit for the on-disk file of stdout+stderr for background bash tasks (default `52428800` = 50MB). When exceeded, the size watchdog fires `SIGKILL` and marks the task as `killed`, with a notice injected at the end of stderr. Claude Code in `ShellCommand.ts` hardcodes the equivalent threshold as a constant; here it is exposed as an env var for operators to tune. Only effective in file fd mode (in pipe mode, child process output is not persisted to disk) |
|
|
45
|
+
| `CODEBUDDY_BASH_BG_PIPE_MODE` | Set to `1` to force background tasks back to pipe mode (not using file fds), for rollback or debugging. The default (unset) uses file fd mode, which solves the zombie process issue caused by grandchild processes (e.g., spawned via `nohup`) holding parent pipe fds; the sandbox path automatically falls back to pipe and does not require explicit setting. There is no equivalent toggle in Claude Code; this is a CodeBuddy fallback to remain compatible with legacy sandbox/PTY paths |
|
|
46
46
|
|
|
47
47
|
## Tool Output Externalization
|
|
48
48
|
|
|
@@ -131,7 +131,8 @@ CodeBuddy Code supports environment variables to control its behavior. These var
|
|
|
131
131
|
| Environment Variable | Description |
|
|
132
132
|
|---------|------|
|
|
133
133
|
| `CODEBUDDY_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates |
|
|
134
|
-
| `
|
|
134
|
+
| `CODEBUDDY_INCLUDE_PROMPT_SUGGESTION` | Explicitly enable prompt suggestions, overriding the headless default (off) and `promptSuggestionEnabled=false` configuration |
|
|
135
|
+
| `CODEBUDDY_PROMPT_SUGGESTION_DISABLED` | Set to `1` / `true` to disable prompt suggestions, takes priority over `CODEBUDDY_INCLUDE_PROMPT_SUGGESTION` |
|
|
135
136
|
| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization |
|
|
136
137
|
|
|
137
138
|
## Security and Authentication
|
|
@@ -282,7 +283,7 @@ codebuddy --model your-model-name
|
|
|
282
283
|
|
|
283
284
|
#### Connecting to DeepSeek Example
|
|
284
285
|
|
|
285
|
-
To connect to any third-party model service compatible with the protocol (such as DeepSeek), you only need to configure the Base URL, API Key, and model variables — no additional `models.json` modifications are required:
|
|
286
|
+
To connect to any third-party model service compatible with the Anthropic protocol (such as DeepSeek), you only need to configure the Base URL, API Key, and model variables — no additional `models.json` modifications are required:
|
|
286
287
|
|
|
287
288
|
```bash
|
|
288
289
|
# Endpoint and key
|
|
@@ -201,14 +201,18 @@ Rules with only the tool name match any use of that tool. For example, adding `B
|
|
|
201
201
|
|
|
202
202
|
#### Permission Modes
|
|
203
203
|
|
|
204
|
-
CodeBuddy Code supports several permission modes,
|
|
204
|
+
CodeBuddy Code supports several permission modes, configurable via `permissions.defaultMode` in [settings](settings.md) or specified with `--permission-mode`. Common modes are as follows:
|
|
205
205
|
|
|
206
206
|
| Mode | Description |
|
|
207
207
|
|:-----|:------------|
|
|
208
|
-
| `default` | Standard
|
|
209
|
-
| `acceptEdits` |
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
208
|
+
| `default` | Standard step-by-step approval mode |
|
|
209
|
+
| `acceptEdits` | Auto-approves file edits; Bash still requires approval |
|
|
210
|
+
| `auto` | Uses a classifier to automatically determine whether to allow or deny actions that would otherwise prompt for approval |
|
|
211
|
+
| `dontAsk` | Never prompts; unapproved actions are directly denied |
|
|
212
|
+
| `plan` | Plan mode; primarily reads and explores, produces a plan before writing source code |
|
|
213
|
+
| `bypassPermissions` | Skips all permission prompts (requires secure environment) |
|
|
214
|
+
|
|
215
|
+
For complete mode semantics, switching methods, status bar indicators, and subagent inheritance rules, see [Permission Modes](permission-modes.md).
|
|
212
216
|
|
|
213
217
|
<Warning>
|
|
214
218
|
`bypassPermissions` mode should only be used in secure, isolated environments, such as Docker containers or VMs. Using this mode on production environments or systems with sensitive data may pose security risks.
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
| `Up/Down Arrow Keys` | Navigate command history | Recall previous inputs | ✅ Supported |
|
|
22
22
|
| `Esc` + `Esc` | Rewind code/conversation | Restore code and/or conversation to previous state (requires pressing ESC twice consecutively when the input box is empty) | ✅ Supported |
|
|
23
23
|
| `Tab` | Toggle thinking mode | Switch between thinking on and thinking off | ✅ Supported |
|
|
24
|
-
| `Shift+Tab` (macOS/Linux) or `Alt+M` (Windows) | Toggle permission mode |
|
|
24
|
+
| `Shift+Tab` (macOS/Linux) or `Alt+M` (Windows) | Toggle permission mode | Cycle between `default`, `bypassPermissions`, `acceptEdits`, `auto` (when available), `plan`, `delegate` | ✅ Supported |
|
|
25
25
|
| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Quickly open model selection panel | ✅ Supported |
|
|
26
26
|
|
|
27
27
|
> **Notes:**
|
|
28
28
|
> - `Esc` + `Esc` rewind functionality is now supported: when the input box is empty, pressing the ESC key twice consecutively activates the `/rewind` feature, allowing you to quickly revert code or conversation to a previous state
|
|
29
29
|
> - `Tab` key in CodeBuddy Code is primarily used for auto-completion, with partial support for thinking mode toggle
|
|
30
|
-
> - `Shift+Tab` (macOS/Linux) or `Alt+M` (Windows) is used to toggle permission modes
|
|
30
|
+
> - `Shift+Tab` (macOS/Linux) or `Alt+M` (Windows) is used to toggle permission modes. The current cycle order is: `default → bypassPermissions → acceptEdits → auto (when available) → plan → delegate`. `dontAsk` is not in the keyboard cycle; it must be entered via `--permission-mode dontAsk` or settings. Note: On Windows, you must use `Alt+M`; `Shift+Tab` does not work
|
|
31
31
|
|
|
32
32
|
### Multi-line Input
|
|
33
33
|
|
|
@@ -199,7 +199,7 @@ CodeBuddy Code supports multiple permission modes to control how tool usage is a
|
|
|
199
199
|
|
|
200
200
|
### Toggling Permission Modes
|
|
201
201
|
|
|
202
|
-
* Use `Shift+Tab` (macOS/Linux) or `Alt+M` (Windows) to
|
|
202
|
+
* Use `Shift+Tab` (macOS/Linux) or `Alt+M` (Windows) to switch between modes. **Note: Windows users must use `Alt+M`**
|
|
203
203
|
* Specify startup mode using the `--permission-mode` command line argument:
|
|
204
204
|
```bash
|
|
205
205
|
codebuddy --permission-mode acceptEdits
|