mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 11:53:16 +08:00
对齐 run_command 与 write_file 的默认路径行为。
将 run_command 在未传 cwd 时改为默认 data/workspace,并将 write_file 调整为相对路径写入 data/workspace、绝对路径直写(经路径守卫校验),同步更新测试与文档。 Made-with: Cursor
This commit is contained in:
parent
d0a66d190d
commit
e06184cc2f
5 changed files with 15 additions and 15 deletions
|
|
@ -73,8 +73,9 @@ class LocalAdapter:
|
|||
try:
|
||||
timeout_s = max(1, min(int(timeout or 30), 600))
|
||||
# run_command never follows adapter cd state.
|
||||
# It only uses explicit cwd; otherwise defaults to workspace root (".").
|
||||
workdir = str(resolve_workspace_path(cwd or "."))
|
||||
# It only uses explicit cwd; otherwise defaults to data/workspace.
|
||||
workdir = str(resolve_workspace_path(cwd or "data/workspace"))
|
||||
Path(workdir).mkdir(parents=True, exist_ok=True)
|
||||
run_kwargs: dict[str, Any] = {
|
||||
"cwd": workdir,
|
||||
"shell": True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue