From 6e1355bfc1c4935ebdc76d915f065388bec08792 Mon Sep 17 00:00:00 2001 From: supreme0597 Date: Sun, 24 May 2026 19:26:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20sandbox=20backend?= =?UTF-8?q?=20edit=20=E6=96=B9=E6=B3=95=E9=94=99=E8=AF=AF=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=20result.data.success?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit str_replace_editor() 返回的 result 已经是 ResponseStrReplaceEditorResult, .success 和 .message 在顶层属性上,不应再经过 .data 访问。 此错误导致编辑文件时报 'StrReplaceEditorResult' object has no attribute 'success'。 --- backend/package/yuxi/agents/backends/sandbox/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package/yuxi/agents/backends/sandbox/backend.py b/backend/package/yuxi/agents/backends/sandbox/backend.py index 63d49ca8..ab069024 100644 --- a/backend/package/yuxi/agents/backends/sandbox/backend.py +++ b/backend/package/yuxi/agents/backends/sandbox/backend.py @@ -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}")