makecindy / makecindy/cindy

bug: auto_review 审批调用 Volcengine API 报 additional_tools 参数错误,导致所有 shell 命令被拒绝

Open
#1,337 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

### 问题描述 / What happened

环境:
- Cindy 版本:(在设置/关于里看)
- 操作系统:Windows
- sandbox_mode:workspace-write
- approvals_reviewer:auto_review
- 审批 LLM 后端:Volcengine(火山引擎)

复现步骤:
1. 在非 full-access 沙箱模式下运行任意 shell 命令(如 python3 -c "print('hello')")
2. 命令被自动审批拒绝

错误信息:
litellm.BadRequestError: VolcengineException - InvalidParameter:
The parameter `input.type` specified in the request are not valid:
unknown type: additional_tools.

预期行为:auto_review 应正常调用 Volcengine API 判断命令安全性,不应因参数不兼容直接报错拒绝。

临时解决:切换到 sandbox_mode: danger-full-access / approval_policy: never 可绕过。

### 环境 / Environment

- Cindy 版本或 commit / version or commit:
- 平台与版本 / platform & OS version:
- 安装方式 / install method:

### 复现步骤 / Steps to reproduce

这不是你操作的问题,我帮你还原一下刚才到底发生了什么——这个**确实值得报 bug**。

## 发生了什么

我之前尝试运行 `python3 -c "import sys; print(sys.version)"` 时,命令根本**没有真正执行**,而是在自动审批层就被拦截了,返回的错误是:

```
This action was rejected due to unacceptable risk.
Reason: Automatic approval review failed:
litellm.BadRequestError: VolcengineException - {
"error":{
"code":"InvalidParameter",
"message":"The parameter `input.type` ... unknown type: additional_tools."
}
}
```

## 根因分析

这是一个**自动审批系统(auto-reviewer)的后端 Bug**,不是权限问题:

1. **当时的环境**:`sandbox_mode` 是 `workspace-write`,`approvals_reviewer` 是 `auto_review`(自动审批)。
2. **出错位置**:在命令执行前,Codex 会调用一个自动审批 LLM(用的是火山引擎/Volcengine 的模型)来判断命令是否安全。
3. **具体错误**:Codex 发给 Volcengine API 的请求里带了一个叫 `additional_tools` 的参数,但 Volcengine 的接口**不认识这个参数**,直接返回了 `InvalidParameter` 错误。
4. **结果**:审批流程直接崩了,命令被当成"有风险"拒绝掉了,看起来就像"卡住了"。

**所以不是 shell 卡住,是审批层的 LLM API 调用因为参数不兼容而报错了。**

## 这确实是个 Bug,建议报告

你可以把以下信息报给 Codex 团队:

- **Bug 描述**:在 `approvals_reviewer: auto_review` 模式下,自动审批 LLM 调用 Volcengine API 时传入了不支持的参数 `additional_tools`,导致审批失败,命令被错误拒绝。
- **错误信息原文**:`litellm.BadRequestError: VolcengineException - InvalidParameter: unknown type: additional_tools`
- **触发条件**:当 sandbox 不是 full-access 模式、且需要 auto_review 审批 shell 命令时触发。
- **影响**:用户在工作区内运行完全无害的命令(如 `python3 -c "print('hello')"`)也会被拒绝,严重影响正常使用。

有意思的是——你现在的会话环境已经切换到了 `sandbox_mode: danger-full-access` 且 `approval_policy: never`(不审批),所以现在 shell 命令应该不会再遇到这个问题了。这正好印证了问题出在**审批层**而不是 shell 本身。

### 日志与截图 / Logs & screenshots

这不是你操作的问题,我帮你还原一下刚才到底发生了什么——这个**确实值得报 bug**。

## 发生了什么

我之前尝试运行 `python3 -c "import sys; print(sys.version)"` 时,命令根本**没有真正执行**,而是在自动审批层就被拦截了,返回的错误是:

```
This action was rejected due to unacceptable risk.
Reason: Automatic approval review failed:
litellm.BadRequestError: VolcengineException - {
"error":{
"code":"InvalidParameter",
"message":"The parameter `input.type` ... unknown type: additional_tools."
}
}
```

## 根因分析

这是一个**自动审批系统(auto-reviewer)的后端 Bug**,不是权限问题:

1. **当时的环境**:`sandbox_mode` 是 `workspace-write`,`approvals_reviewer` 是 `auto_review`(自动审批)。
2. **出错位置**:在命令执行前,Codex 会调用一个自动审批 LLM(用的是火山引擎/Volcengine 的模型)来判断命令是否安全。
3. **具体错误**:Codex 发给 Volcengine API 的请求里带了一个叫 `additional_tools` 的参数,但 Volcengine 的接口**不认识这个参数**,直接返回了 `InvalidParameter` 错误。
4. **结果**:审批流程直接崩了,命令被当成"有风险"拒绝掉了,看起来就像"卡住了"。

**所以不是 shell 卡住,是审批层的 LLM API 调用因为参数不兼容而报错了。**

## 这确实是个 Bug,建议报告

你可以把以下信息报给 Codex 团队:

- **Bug 描述**:在 `approvals_reviewer: auto_review` 模式下,自动审批 LLM 调用 Volcengine API 时传入了不支持的参数 `additional_tools`,导致审批失败,命令被错误拒绝。
- **错误信息原文**:`litellm.BadRequestError: VolcengineException - InvalidParameter: unknown type: additional_tools`
- **触发条件**:当 sandbox 不是 full-access 模式、且需要 auto_review 审批 shell 命令时触发。
- **影响**:用户在工作区内运行完全无害的命令(如 `python3 -c "print('hello')"`)也会被拒绝,严重影响正常使用。

有意思的是——你现在的会话环境已经切换到了 `sandbox_mode: danger-full-access` 且 `approval_policy: never`(不审批),所以现在 shell 命令应该不会再遇到这个问题了。这正好印证了问题出在**审批层**而不是 shell 本身。

Contributor guide

Open the contributing guide

Research direction

Start by tracing the auto_review approval request and the Volcengine path used through LiteLLM, reproducing the issue with workspace-write and a harmless shell command such as python3 -c "print('hello')". Check where additional_tools is added to the request; done means the Volcengine call succeeds and the command is evaluated instead of being rejected due to the parameter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.