grep_search: spurious "escapes workspace boundary" on first run in a directory with no .claw/ (Windows)
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
Start by reproducing the Windows fresh-directory case using the grep_search entry point, then trace its workspace-boundary check alongside first-run .claw/ initialization. Done means the first search succeeds in a directory without .claw/ and path containment works consistently for plain and extended-length Windows paths.
由索引模型根据 Issue 内容生成。
描述
Summary
On Windows, the first grep_search in a working directory that does not yet contain a .claw/ directory fails with a workspace-boundary error. The reported "escaping" path and the boundary path are the same path, differing only by the \?\ extended-length prefix — which suggests the boundary check compares a plain path against a canonicalized/extended path without normalizing the prefix first.
Once .claw/ exists in that directory, subsequent grep_search calls succeed. So this reads as an initialization-order race rather than a permanent failure.
Error
✗ grep_search
ExecutionError { message: "path C:\tmp\clawpath\normaldir escapes workspace boundary \\?\C:\tmp\clawpath\normaldir", source: None }
Note both sides are C:\tmp\clawpath\normaldir; only the prefix differs.
Reproduction
$env:OPENAI_BASE_URL="http://localhost:1234/v1" # any OpenAI-compatible local server
$env:OPENAI_API_KEY="local-dev-token"
mkdir C:\tmp\clawpath\brandnew
"hello TARGETSTRING here" | Set-Content C:\tmp\clawpath\brandnew\sample.txt
cd C:\tmp\clawpath\brandnew
claw --model "<your-local-model>" prompt "Use grep_search to find TARGETSTRING in this directory."
Observed
| Directory | .claw/ present beforehand |
grep_search |
|---|---|---|
| fresh dir, 1st run | no | fails — escapes workspace boundary |
| same dir, 2nd/3rd run | yes | succeeds |
Reproduced on 2 of 3 fresh directories; 0 of 3 already-initialized directories. The one fresh directory that succeeded had .claw/sessions/*.jsonl already flushed by the time grep ran, which is consistent with a race between workspace initialization and the tool's boundary check.
Expected
grep_search should resolve/normalize both paths (strip or apply the \?\ prefix consistently) before the containment comparison, and should not depend on .claw/ already existing.
Impact
read_file works in the same directory where grep_search fails, so the failure is partial and easy to misread as a model/tool-calling problem rather than a harness bug — it cost us some misdiagnosis while evaluating local models.
Environment
- Claw Code
v0.1.3(git4ea31c1bc91c), built from source - Windows 10 Pro 19045,
rustc/cargo1.97.1, MSVC (VS Build Tools 2019) - Provider: local OpenAI-compatible server (LM Studio,
:1234)
Workaround
Run any command that initializes .claw/ in the directory first, then grep_search works.
- 主要语言
- Rust
- 星标
- 195k
- 派生
- 108k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ultraworkers/claw-code 的其他 Issue
-
Fix markdown formatting issues in TUI streaming: block-level element newline omission and consecutive empty line accumulation可能重新可做 @Aditaya08 于 51 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
ultraworkers/claw-code#3259 · 7 条评论 ·
-
fix(cli): resolve duplicate assistant text printing after 'Done' in non-compact text mode可能已有人在做 @nankingjing 于 90 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ultraworkers/claw-code#3258 · 1 条评论 ·
-
bug: Missing newlines before paragraphs and code blocks in streamed Markdown rendering可能已有人在做 @nankingjing 于 90 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
ultraworkers/claw-code#3257 · 2 条评论 ·
-
[CRITICAL][SECURITY] Untrusted project hooks bypass read-only mode for arbitrary command execution未关闭
难度 4/5 3-5 天 新手友好度 68/100
ultraworkers/claw-code#3301 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 20/100
ultraworkers/claw-code#3300 · 2 条评论 ·
查看 ultraworkers/claw-code 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
mishraprafful/multihull#150 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
voidzero-dev/vite-plus#2970 ·
维护者通常 1 天内回复
-
ai_p2 comp-parquet-reader-v3
难度 2/5 半天 新手友好度 66/100
ClickHouse/ClickHouse#124986 ·
维护者通常 1 天内回复
-
bug(ktuner): exporter directories hide daemon processes可能已有人在做 @iloveeyjafjalla 今天认领。 未关闭component:ktuner
难度 2/5 1-3 小时 新手友好度 62/100
agentic-os-org/ANOLISA#6905 · 1 条评论 ·
维护者通常 1 天内回复
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked files未关闭
难度 2/5 1-3 小时 新手友好度 70/100
maniator/verticopolis#880 ·
维护者通常 1 天内回复