fix: 修复 sandbox backend edit 方法错误访问 result.data.success
str_replace_editor() 返回的 result 已经是 ResponseStrReplaceEditorResult, .success 和 .message 在顶层属性上,不应再经过 .data 访问。 此错误导致编辑文件时报 'StrReplaceEditorResult' object has no attribute 'success'。
This commit is contained in:
parent
fd6803e477
commit
6e1355bfc1
@ -293,8 +293,8 @@ class ProvisionerSandboxBackend(BaseSandbox):
|
||||
new_str=new_string,
|
||||
replace_mode=replace_mode,
|
||||
)
|
||||
if not result.data.success:
|
||||
return EditResult(error=result.data.message or f"Error editing file '{file_path}'")
|
||||
if not result.success:
|
||||
return EditResult(error=result.message or f"Error editing file '{file_path}'")
|
||||
except Exception as exc: # noqa: BLE001
|
||||
return EditResult(error=f"Error editing file: {exc}")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user