continue and retry instead of crash encounter invalid json output

This commit is contained in:
2026-07-09 16:49:50 +08:00
parent 6d13239c1c
commit d0a4581683
@@ -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;
}
}
}