Skip to content

fix(tau_ai): ignore repeated empty tool-call name chunks in chat completions - #715

Closed
lxy914 wants to merge 12 commits into
huggingface:mainfrom
lxy914:main
Closed

lxy914 wants to merge 12 commits into
huggingface:mainfrom
lxy914:main

Conversation

@lxy914

@lxy914 lxy914 commented Sep 11, 2026 •

Copy link
Copy Markdown

Problem

Some OpenAI-compatible providers repeat "name": "" on every streamed
tool-call argument chunk instead of only sending the tool name on the
first chunk. The Chat Completions stream parser let that empty string
overwrite the tool name that had already been parsed, so Tau tried to run
an unnamed tool:

  • tool execution failed with Tool not found
  • replaying the nameless tool call in the next request was rejected by the
    provider with HTTP 400, ending the session

Fix

_ToolCallBuilder.add_delta now only updates the tool name for non-empty
strings, matching the guard already present in _ResponsesToolCallBuilder.
The name from the first chunk is preserved when later chunks repeat
"name": "".

Tests

  • Added test_openai_compatible_provider_keeps_tool_name_when_later_chunks_send_empty_name
    in tests/test_tau_ai.py; the regression test streams later chunks with
    empty names and asserts the parsed tool call keeps its original name.
  • uv run pytest tests/test_tau_ai.py — 89 passed
  • uv run ruff check . — passed
  • uv run ruff format --check . — passed

…letions

Some OpenAI-compatible providers repeat "name": "" on every streamed tool-call argument chunk. The parser overwrote the real tool name with that empty string, causing "Tool not found" and a provider HTTP 400 rejection on replay. Only non-empty names update the builder now (matching the Responses builder guard). Adds a regression test.
alejandro-ao
alejandro-ao previously approved these changes Oct 23, 2026
@lxy914 lxy914 closed this by deleting the head repository Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants