Skip to content

Studio: pin the /status chat template echo behaviour - #8080

Merged
danielhanchen merged 2 commits into
mainfrom
fix/gguf-status-duplicate-chat-template-override
Aug 7, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/gguf-status-duplicate-chat-template-override

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Context

This started as a fix for the /api/inference/status 500, but #8074 landed that first. Rebased onto it, so the source fix is gone and only the missing test coverage is left.

What is still missing

#8074 added a source-level contract: no runtime field is also passed as an explicit keyword at a **_llama_runtime_fields(...) splat site. That is the right guard for the collision that caused the 500, but it reads source text, not values, so it cannot see whether the assignment it relies on is still there.

Delete the line #8074 added:

_runtime_fields["chat_template_override"] = _reported_chat_template_override

and the contract stays green, because there is no explicit keyword to collide with. /status quietly starts reporting llama_backend.chat_template_override raw. The auto-applied bundled family template that get_status deliberately reports as None now reads as a user override, the frontend adopts it as editable state, and re-sends it as an explicit override for the next, unrelated model. That is the exact behaviour the surrounding comment says must not happen.

Verified on this branch with that one line removed:

tests/studio/test_inference_status_runtime_fields_contract.py   2 passed
tests/test_inference_status_loaded_gguf.py                      1 failed, 5 passed

The failure is test_an_auto_applied_chat_template_is_not_reported_as_the_users.

Change

Two cases added to tests/test_inference_status_loaded_gguf.py, which already drives the real get_status handler against the real response model:

  • a user override is echoed back
  • an auto-applied bundled template still reports None

No source changes. The first case is the weaker of the two on its own, since the projected value and the expected value coincide there, but it documents the intended contract next to the one that catches the regression.

tests/test_inference_status_loaded_gguf.py                      6 passed
tests/studio/test_inference_status_runtime_fields_contract.py   2 passed

Note

The original diff here duplicated #8074 (same approach, assign into the dict before splatting). Reduced rather than closed, since the behavioural gap above is real and unclaimed. Happy to close instead if you would rather fold these into the contract file.

#8074 fixed the duplicate-keyword TypeError and added a source-level contract
that no runtime field is also passed as an explicit keyword at a splat site.
That contract cannot see the value, so the assignment it relies on can be
dropped without failing it.

Removing `_runtime_fields["chat_template_override"] = ...` leaves the contract
test green while /status starts reporting the raw backend value. An
auto-applied bundled family template then reads as a user override, and the
frontend re-sends it for the next, unrelated model.

Adds two cases to the existing loaded-GGUF status tests: the user override is
echoed, and an auto-applied template still reports None.
@shimmyshimmer
shimmyshimmer force-pushed the fix/gguf-status-duplicate-chat-template-override branch from 87cac47 to 91518f7 Compare August 7, 2026 04:26
@shimmyshimmer shimmyshimmer changed the title Studio: fix /api/inference/status 500 when a GGUF model is loaded Studio: pin the /status chat template echo behaviour Aug 7, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 65aa51ccae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit c652e76 into main Aug 7, 2026
30 of 34 checks passed
@danielhanchen
danielhanchen deleted the fix/gguf-status-duplicate-chat-template-override branch August 7, 2026 08:21
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