Skip to content

feat: configurable edit tools (hashline default), path policy, safer headless, CI - #4

Merged
cursor[bot] merged 6 commits into
mainfrom
cursor/cli-edit-tools-config-17c0
Aug 29, 2026
Merged

feat: configurable edit tools (hashline default), path policy, safer headless, CI#4
cursor[bot] merged 6 commits into
mainfrom
cursor/cli-edit-tools-config-17c0

Conversation

@gaoyu06

@gaoyu06 gaoyu06 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

本次改动范围

  • edit_tools 配置:默认只向模型暴露 hashline_edit,可再打开 str_replace / write / apply_patch
  • 文件工具的工作区路径边界(不是沙箱;bash 仍可出界)
  • browser_open 保持仅 Desktop 环境,并可用配置关掉
  • headless 默认 read-only,需显式 --approval-mode;审批请求自动拒绝以免挂死
  • README 与内置 provider 表述对齐
  • PR CI:fmt / clippy -D warnings / test

未做:沙箱、LSP、MCP、ACP、vendor crate。

是否可直接上线

否。默认编辑工具集与 headless 审批都是行为变化,旧脚本若依赖隐式 full-auto 或 write/str_replace 会失败。

上线前是否需要 review

需要。

review 的前置条件

  1. cargo test --workspace 与 clippy 绿
  2. 确认 Desktop 走 serve、不受 headless 默认影响
  3. 确认「只拦文件工具、不拦 bash」符合「基础权限、不做沙箱」
  4. cursor/cli-vendor-providers-17c0cursor/cli-mcp-skills-17c0 合并时注意 config.rs 冲突
Open in Web Open in Cursor 

cursoragent and others added 6 commits August 28, 2026 18:48
Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
Default exposes only hashline_edit; str_replace (alias edit), write, and apply_patch must be enabled via the edit_tools array in config.json. Disabled edit tools are filtered from the model's tool definitions and rejected with a clear error if called anyway. Also adds enable_browser_open to switch off the desktop-only browser_open tool.

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
read/write/str_replace/hashline_edit/apply_patch/ls/outline/checkpoint reject paths that resolve outside the workspace cwd (absolute paths, .., and symlinks pointing outside). This is a permission/path policy, not an OS sandbox; bash and ripgrep are intentionally not gated.

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
Headless no longer forces full-auto: it accepts any --approval-mode, defaults to read-only, and auto-denies approval requests (which could never be answered) with a clear message instead of hanging. Use --approval-mode full-auto for mutating tasks.

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
@cursor
cursor Bot merged commit 1ba73f3 into main Aug 29, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants