Skip to content

[Engine] serve: tool-result messages lose the tool name, so the Inkling header renders <|message_tool|><|content_text|> (0.2.21) #7051

Backlog

Description

@subourbonite

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

Tool-result messages reach the Inkling chat template without the tool's name, so the rendered header is <|message_tool|><|content_text|> instead of <|message_tool|>get_weather<|content_text|>.

The template names a tool result from message.name, or from the earlier assistant tool_calls[].id that matches tool_call_id. The front end removes both:

  • openai_to_messages (terminal/serve/frontend.py ~678–696) builds each tool message as {"role", "content", "_call_id"} and never copies name.
  • _order_chat_tool_results (~663–666) then pops _call_id from every message and tool call before the template renders, so the id match can't happen either.
  • The Anthropic /v1/messages path (~881–901) stores tool_use_id as _call_id and goes through the same _order_chat_tool_results, so it loses the name the same way.

Sending name on the tool message doesn't help, because it is dropped too. Clients that follow the OpenAI format send only tool_call_id; Pi 1.6.0 is one.

Expected: the tool name appears in the tool-result header, as the chat template intends. For example, keep name on tool messages, or resolve it from the matching assistant call before _call_id is popped.

Impact: the model sees every tool result without being told which tool produced it. Single round trips still answered correctly in my tests (22/22), but agent sessions with several tools in flight lose that cue on every result. I haven't measured the effect on long tool chains.

Smallest steps or command that reproduce it

  1. Start the server from source with Inkling-2-Mini.
  2. Send /v1/chat/completions with tools declaring get_weather and these messages: a user asks for the weather; an assistant turn with one get_weather call, id: "call_1"; a tool message with tool_call_id: "call_1" and the result. Use chat_template_kwargs: {"reasoning_effort": "medium"}.
  3. Log the prompt Strata tokenizes, for example by wrapping encode_prompt, and compare it with llama.cpp's /apply-template for the same messages and the same GGUF.
prompt tokens tool-result header
llama.cpp (same GGUF, same template) 728 <|message_tool|>get_weather<|content_text|>
Strata 0.2.21 725 <|message_tool|><|content_text|>
Strata 0.2.21, name added to the tool message 725 <|message_tool|><|content_text|>

The same conversation without the tool round trip renders byte-identically on both, so the difference is only the header.

Reproduction status

Reproduced locally

Strata version

v0.2.21 (d46f5f268), terminal/serve/server.py started directly, strata-inkling 0.1.67 built from source

Graphics card, memory and system

Apple M4 Pro, 48 GB unified memory, macOS 27.2 (Metal)

Model, size and settings

Inkling-2-Mini, ggml-org IQ4_NL GGUF (17.6 GB), --max-context 131072, one slot, drafting off, vision off, reasoning effort medium

Logs

Rendered tool-result turn from the logged prompt (Strata), for a get_weather round trip (Lisbon):

<|message_tool|><|content_text|>{"location":"Lisbon","temperature":18,"unit":"celsius","condition":"light rain","humidity_percent":82}<|end_message|>

llama.cpp /apply-template for the same messages:

<|message_tool|>get_weather<|content_text|>{"location":"Lisbon","temperature":18,"unit":"celsius","condition":"light rain","humidity_percent":82}<|end_message|>

Activity

  1. added
    needs-format
    on Nov 24, 2026
  2. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

    • Fill in "Reproduction status".
    • Fill in "Strata version".
    • Fill in "Graphics card, memory and system".

    Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

    Details: CONTRIBUTING.md

  3. removed
    needs-format
    on Nov 24, 2026
  4. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks, this follows the format now.

  5. Niko1221 commented on Nov 24, 2026

    @Niko1221
    Owner

    Thank you, this is a precise report and your numbers match what we see.

    We reproduced it. The front end removes the tool call ids before the chat template runs, and it never copies the tool's name onto the result, so the Inkling header comes out as <|message_tool|><|content_text|>. With the name filled in from the call that the result answers, the header becomes <|message_tool|>get_weather<|content_text|>, also when two calls are answered in the other order. The Anthropic /v1/messages path goes through the same function, so it is fixed by the same change.

    This is not new in 0.2.21 and not a regression: Inkling has had this since it was added. It does not touch the other model families.

    We plan to fix it for the next release. The change is small and only in the server's Python part (terminal/serve/frontend.py, where the ids are removed), no new engine is needed. There is nothing to change on the client side meanwhile: a name field on the tool message is dropped too, as you saw.

  6. subourbonite commented on Nov 24, 2026

    @subourbonite
    Author

    We plan to fix it for the next release. The change is small and only in the server's Python part (terminal/serve/frontend.py, where the ids are removed), no new engine is needed. There is nothing to change on the client side meanwhile: a name field on the tool message is dropped too, as you saw.

    I have a PR coming for this, it's just taking a while to run through the full test suite. If you don't need/want the PR, feel free to close it.

  7. subourbonite commented on Nov 25, 2026

    @subourbonite
    Author

    PR is up on #7073

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions