fix(agents): repair smart-quoted edit arrays · openclaw/openclaw@059bed7
ferminquant
·
2026-05-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -282,6 +282,21 @@ const re = /\d+/;
|
282 | 282 | }); |
283 | 283 | }); |
284 | 284 | |
| 285 | +it("repairs smart-quoted edit args that use the current edits array schema", async () => { |
| 286 | +const result = await runToolCallRepairCase({ |
| 287 | +toolName: "edit", |
| 288 | +delta: String.raw` {“path”:“notes/报告.md”,“edits”:[{“oldText”:“旧的 **草稿**”,“newText”:“更新 \"草稿\"\nnext”},{“oldText”:“tail”,“newText”:“done”}]}`, |
| 289 | +}); |
| 290 | + |
| 291 | +expectAllToolCallArgs(result, { |
| 292 | +path: "notes/报告.md", |
| 293 | +edits: [ |
| 294 | +{ oldText: "旧的 **草稿**", newText: '更新 "草稿"\nnext' }, |
| 295 | +{ oldText: "tail", newText: "done" }, |
| 296 | +], |
| 297 | +}); |
| 298 | +}); |
| 299 | + |
285 | 300 | it("preserves smart quotes inside ASCII-delimited JSON content with trailing junk", async () => { |
286 | 301 | const result = await runToolCallRepairCase({ |
287 | 302 | toolName: "read", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。