Regression: Tool Name Lost in Streaming Chat Completions After PR #6996
Resolved 💬 3 comments Opened Dec 4, 2025 by ivanmurashko Closed Dec 15, 2025
Error:
Invalid 'input[3].name': empty string. Expected a string with minimum length 1, but got an empty string instead.
Cause: PR #6996 introduced a regression in SSE streaming response parsing. When the Chat Completions API streams tool calls, the first delta contains the function name while subsequent deltas contain empty names at my case. The original code used get_or_insert_with() to preserve existing names, but the new code in codex-api/src/sse/chat.rs unconditionally overwrites with = Some(fname.to_string()), causing valid names to be replaced with empty strings.
Proposed Fix: Add !fname.is_empty() check before updating the tool name:
if let Some(fname) = func.get("name").and_then(|n| n.as_str()) {
if !fname.is_empty() {
call_state.name = Some(fname.to_string());
}
}This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗