mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 08:11:42 +00:00
Agent: repair malformed tool calls and session files
This commit is contained in:
@@ -35,6 +35,12 @@ describe("formatAssistantErrorText", () => {
|
||||
"The AI service is temporarily overloaded. Please try again in a moment.",
|
||||
);
|
||||
});
|
||||
it("returns a recovery hint when tool call input is missing", () => {
|
||||
const msg = makeAssistantError("tool_use.input: Field required");
|
||||
const result = formatAssistantErrorText(msg);
|
||||
expect(result).toContain("Session history looks corrupted");
|
||||
expect(result).toContain("/new");
|
||||
});
|
||||
it("handles JSON-wrapped role errors", () => {
|
||||
const msg = makeAssistantError('{"error":{"message":"400 Incorrect role information"}}');
|
||||
const result = formatAssistantErrorText(msg);
|
||||
|
||||
Reference in New Issue
Block a user