Skip to content

server: malformed tool-call history returns HTTP 500 #43

Description

@am17an

Upstream: ggml-org#25510

Malformed client-supplied tool_calls[].function.arguments in replayed chat history is treated as an internal server failure instead of a client error.

Environment: Linux aarch64, NVIDIA GB10 / CUDA 13, current upstream df03399b885831b2a1603b3abb0d8c156808e363, Qwen2.5 0.5B Instruct Q4_K_M.

llama-server -m qwen2.5-0.5b-instruct-q4_k_m.gguf -ngl 99 --jinja -c 2048 -b 256

Send POST /v1/chat/completions with a prior assistant message containing:

{"role":"assistant","tool_calls":[{"id":"call_1","type":"function","function":{"name":"echo","arguments":"{"}}]}

Observed: HTTP 500 with Failed to parse tool call arguments as JSON. Repeating the malformed history repeats the 500.

Likely path: func_args_not_string() in common/chat.cpp converts the parse error to std::runtime_error, which the server maps to HTTP 500.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserver

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions