fix(agents): clear orphan tool state on string assistant turns · openclaw/openclaw@72eff6b
obviyus
·
2026-05-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -934,6 +934,29 @@ describe("claudeCliSessionTranscriptHasOrphanedToolUse", () => {
|
934 | 934 | ).toBe(false); |
935 | 935 | }); |
936 | 936 | |
| 937 | +it("returns false when a later string assistant message supersedes an old orphan", async () => { |
| 938 | +await writeJsonlSession("buried-string", [ |
| 939 | +{ |
| 940 | +type: "assistant", |
| 941 | +message: { |
| 942 | +role: "assistant", |
| 943 | +content: [{ type: "tool_use", id: "toolu_old_string", name: "Bash", input: {} }], |
| 944 | +}, |
| 945 | +}, |
| 946 | +{ |
| 947 | +type: "assistant", |
| 948 | +message: { role: "assistant", content: "moving on" }, |
| 949 | +}, |
| 950 | +]); |
| 951 | +expect( |
| 952 | +await claudeCliSessionTranscriptHasOrphanedToolUse({ |
| 953 | +sessionId: "buried-string", |
| 954 | + workspaceDir, |
| 955 | +homeDir: tmpDir, |
| 956 | +}), |
| 957 | +).toBe(false); |
| 958 | +}); |
| 959 | + |
937 | 960 | it("rejects path-like session ids instead of escaping the Claude projects tree", async () => { |
938 | 961 | await writeJsonlSession("safe", []); |
939 | 962 | expect( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。