Repository navigation
Fix the status runtime-fields contract test left stale by #8074 - #8088
Conversation
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.
There was a problem hiding this comment.
💡 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".
| assert ( | ||
| "_runtime_fields = _llama_runtime_fields(llama_backend)" in self._source | ||
| ), "**_runtime_fields is not built from _llama_runtime_fields(llama_backend)" |
There was a problem hiding this comment.
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 👍 / 👎.
tests/test_native_context_length.py::TestRouteCompleteness::test_status_pathis 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:
The test scans the
InferenceStatusResponseconstruction block for a literal_llama_runtime_fields(llama_backend). #8074 had to bind that call to_runtime_fieldsone line above the construction so it could overwritechat_template_overridebefore passing it on, since passing it twice is aTypeError. 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_pathaccepts 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.pyis 39 passing on this branch, 38 passing and 1 failing on main.**_runtime_fieldsfrom the status route makes it fail again.