mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-12-01 09:15:33 +08:00
Merge pull request #386 from kevin9327/fix/empty-tool-arguments
fix: handle tool calls with empty arguments
This commit is contained in:
3 files changed
+78
-2
No files matched your search
@@ -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?;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user