优化编辑工具调用的行号解析

This commit is contained in:
xintaofei
2026-03-28 15:46:52 +08:00
parent cb1c7211ef
commit c0b3e9aff9
8 changed files with 314 additions and 5 deletions

View File

@@ -1755,6 +1755,16 @@ function StructuredToolInput({
)
}
}
// Prefer tool output if it contains a structured diff with real line numbers
// (injected by backend from toolUseResult.structuredPatch)
if (output && typeof output === "string" && /^@@ /m.test(output)) {
return (
<>
{truncationBanner}
<UnifiedDiffPreview diffText={output} />
</>
)
}
if (isCanonicalEditPayload(parsed)) {
return (
<>