diff --git a/crates/openfang-runtime/src/drivers/openai.rs b/crates/openfang-runtime/src/drivers/openai.rs index 7d54c432..5ef38cf7 100644 --- a/crates/openfang-runtime/src/drivers/openai.rs +++ b/crates/openfang-runtime/src/drivers/openai.rs @@ -1173,7 +1173,10 @@ impl LlmDriver for OpenAIDriver { // ID (sent in first chunk for this tool) if let Some(id) = call["id"].as_str() { - tool_accum[idx].0 = id.to_string(); + // Fix: Empty string IDs are overwritten, leading to inconsistencies in certain models. + if !id.is_empty() { + tool_accum[idx].0 = id.to_string(); + } } if let Some(func) = call.get("function") {