Merge pull request #386 from kevin9327/fix/empty-tool-arguments

fix: handle tool calls with empty arguments
This commit is contained in:
leokun authored and GitHub committed 2026-08-31 13:57:45 +08:00
commit 45e694fd63
3 files changed
+78 -2

No files matched your search

+8 -1
View File
@@ -101,7 +101,14 @@ impl Store {
.bind(&call.call_id)
.bind(&call.model_call_id)
.bind(&call.name)
.bind(&call.arguments_text)
// A no-argument tool call streams no argument text; persist it as an
// empty object so the `arguments_json` column always holds valid JSON
// and can be re-parsed on load.
.bind(if call.arguments_text.trim().is_empty() {
"{}"
} else {
call.arguments_text.as_str()
})
.execute(&mut *tx)
.await?;
}