Skip to content

bugfix: fix OpenAI multi-turn tool calls and Content-Length FATAL crash.#79

Merged
JimHsiung merged 2 commits into
xLLM-AI:mainfrom
shifengmin:fengmin/fix-openai-tool-calls
Jul 16, 2026
Merged

bugfix: fix OpenAI multi-turn tool calls and Content-Length FATAL crash.#79
JimHsiung merged 2 commits into
xLLM-AI:mainfrom
shifengmin:fengmin/fix-openai-tool-calls

Conversation

@shifengmin

Copy link
Copy Markdown
Contributor

Summary

  • Preserve tool_calls / reasoning_content / tool_call_id in OpenAI chat messages, parse tool-call arguments as JSON objects for Jinja templates, and strip leaked GLM control tokens from streamed output.
  • Treat missing/invalid Content-Length as a request error (SetFailed) instead of LOG(FATAL), and use application/json for non-stream HTTP responses.
  • Bump third_party/minja for GLM-5.2 Jinja syntax support (.0 member access / capitalize filter).

Test plan

  • Multi-turn tool-call chat against GLM returns correct history (no dangling <|observation|> / leaked control tokens)
  • POST /v1/chat/completions without Content-Length returns error and process stays up
  • Normal chat with Content-Length still succeeds
  • Build xllm_master_serving on NPU/dev host

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@JimHsiung
JimHsiung merged commit 09c9f57 into xLLM-AI:main Jul 16, 2026
1 check passed
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.

3 participants