continue and retry instead of crash encounter invalid json output
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user