|
@@ -865,9 +865,17 @@ def _compile_react(cfg: Dict, overrides: Dict) -> Term:
|
|
|
# Capture original user input on first step, inject working directory
|
|
# Capture original user input on first step, inject working directory
|
|
|
if step == 0:
|
|
if step == 0:
|
|
|
cwd = overrides.get("workspace_path") or os.getcwd()
|
|
cwd = overrides.get("workspace_path") or os.getcwd()
|
|
|
|
|
+ # 区分「写产物」与「读输入」——历史上这里只说"ReadFile/WriteFile 基于
|
|
|
|
|
+ # 工作目录",导致模型把【读取】也拼到输出工作目录下,读不到放在别处的
|
|
|
|
|
+ # 输入数据,转而对程序运行目录的无关文件下手。现在分别说明:
|
|
|
|
|
+ # · 写 → 工作目录;· 读 → 用户/[数据来源目录] 给的绝对路径,
|
|
|
|
|
+ # 并禁止相对/无参调用(否则会落到进程运行目录)。
|
|
|
_user_input[0] = (
|
|
_user_input[0] = (
|
|
|
f"[工作目录] {cwd}\n"
|
|
f"[工作目录] {cwd}\n"
|
|
|
- f"ReadFile/WriteFile 使用绝对路径(基于上面的工作目录)。\n\n"
|
|
|
|
|
|
|
+ f"· 写产物:用 WriteFile 写到上面的【工作目录】(完整绝对路径)。\n"
|
|
|
|
|
+ f"· 读输入:用【用户消息】或 system 提示里 [数据来源目录] 给出的路径"
|
|
|
|
|
+ f"读取,务必用完整绝对路径;不要把读取路径拼到工作目录下,也不要用"
|
|
|
|
|
+ f"相对路径或无参调用 ListFiles/ReadFile(会落到程序运行目录、读到无关文件)。\n\n"
|
|
|
+ str(state)
|
|
+ str(state)
|
|
|
)
|
|
)
|
|
|
|
|
|