From d0a4581683c5c554bbdf5e714f8411fdfe5bf05b Mon Sep 17 00:00:00 2001 From: kvtodev Date: Thu, 9 Jul 2026 16:49:50 +0800 Subject: [PATCH] continue and retry instead of crash encounter invalid json output --- server-rs/crates/module-editor-agent/src/agent/run.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server-rs/crates/module-editor-agent/src/agent/run.rs b/server-rs/crates/module-editor-agent/src/agent/run.rs index 1bfd52a84..9ebd76f45 100644 --- a/server-rs/crates/module-editor-agent/src/agent/run.rs +++ b/server-rs/crates/module-editor-agent/src/agent/run.rs @@ -207,12 +207,9 @@ where } } Err(_) => { - // Not valid JSON — treat as plain-text final response + // Not valid JSON — push as assistant message and continue to next turn memory.push(agent.model.build_assistant_message(&text)); - return Ok(PromptOutput { - text, - tool_calls: vec![], - }); + continue; } } }