Skip to content

Fix the status runtime-fields contract test left stale by #8074 - #8088

Merged
danielhanchen merged 1 commit into
mainfrom
fix/studio-status-runtime-fields-contract
Aug 7, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/studio-status-runtime-fields-contract

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

tests/test_native_context_length.py::TestRouteCompleteness::test_status_path is red on main and on every PR branched from it. I hit it on two unrelated Studio PRs and traced it back here.

Bisected to #8074:

commit result
2d231f8 (parent) passes
e99651b (#8074) fails

The test scans the InferenceStatusResponse construction block for a literal _llama_runtime_fields(llama_backend). #8074 had to bind that call to _runtime_fields one line above the construction so it could overwrite chat_template_override before passing it on, since passing it twice is a TypeError. That moved the call outside the block the test reads.

Nothing is actually wrong with the route. The runtime fields are still applied, through **_runtime_fields. The test's pattern is just stale.

Change

test_status_path accepts either shape now: the helper called inline, or its result splatted from a dict. The splat only counts when that dict is the helper's, so this does not degrade into a test that passes on anything.

Testing

  • test_native_context_length.py is 39 passing on this branch, 38 passing and 1 failing on main.
  • Checked the test still catches what it is there for: deleting **_runtime_fields from the status route makes it fail again.

test_status_path scans the InferenceStatusResponse construction for a
literal _llama_runtime_fields(llama_backend). #8074 had to bind that call
to _runtime_fields one line above the construction so it could overwrite
chat_template_override before passing it on, which moved the call out of
the block the test reads. The route still applies the runtime fields, so
the test has been red on main since that merge and on every PR branched
from it.

Accept either shape, and only count the splat when the dict is the
helper's, so removing the fields from the route still fails the test.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5308219edc

ℹ️ 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".

Comment on lines +452 to +454
assert (
"_runtime_fields = _llama_runtime_fields(llama_backend)" in self._source
), "**_runtime_fields is not built from _llama_runtime_fields(llama_backend)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Tie the helper assignment to the response block

When a status response splats **_runtime_fields, this repository-wide string check does not establish that the splatted variable was produced by the helper in that control-flow path. If another function or branch contains the exact assignment while this response receives _runtime_fields from another source, the contract test still passes even though the llama runtime fields can be omitted. Inspect the assignment immediately preceding the construction or use an AST/control-flow-aware check so the claimed provenance is actually verified.

Useful? React with 👍 / 👎.

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