Repository navigation
endpoint.extra_body: refuse a field jevify sets when the backend is built - #4
Merged
Merged
Conversation
…uilt The clash check in #3 ran per request, so a key set only by one path (`logit_bias` by the equal-bias rung and the probe) passed warm and evaluate and failed inside probe. The refusal now comes from one registry, RESERVED_REQUEST_FIELDS in the endpoint client, checked when the client is built: probe, ask, eval and serve fail the same way, before any request. The per-request check stays as the backstop. A hand-kept registry drifts, so tests/guards/test_request_fields.py drives every adapter kind and dialect through the fakes (probe, apply the probe, warm, evaluate) and fails naming any request field the registry lacks. It already caught one the first time it ran: `top_n` in the rerank body. The fake records its tokenize and apply-template bodies apart from the scoring ones so request counts in existing tests stay as they were. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
haohao3k
pushed a commit
to haohao3k/jevify
that referenced
this pull request
Oct 6, 2026
Conflicts with endpoint.extra_body (fidecastro#3, fidecastro#4): - SKILL.md: keep both recipe notes. - tests/test_recipes.py: keep the extra_body tests and the frozen-hash canary. - tests/fakes/fake_openai_server.py: keep main's template_requests log and drop the branch's tokenize_requests; test_probe reads /tokenize bodies from template_requests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Follow-up to #3. The
extra_bodyclash check ran per request, so a key jevify sets on only one path was refused only when that path ran.logit_biasis set by the equal-bias rung and the probe: a recipe withextra_body: {logit_bias: ...}passedaskandeval(warm and top-k readout never set it) and failed insideprobe. Which command failed depended on which request happened to set the key first.The change
RESERVED_REQUEST_FIELDSinjevify/adapters/endpoint/client.py: every top-level request field jevify sets, across the readout requests of every dialect and rung, the probe, the tokenize and apply-template routes, and the rerank and embeddings bodies.probe,ask,evalandservefail the same way, before any request.build_backendis the one path all four take.Tests
tests/guards/test_request_fields.py: a ratchet guard in the style of the other structure guards. It drives every adapter kind and dialect through the fakes the way an operator does (probe,apply_probe, warm, evaluate each question type) and fails naming any request field the registry lacks. It caughttop_nin the rerank body on its first run, a field my read of the adapters had missed.test_extra_body_naming_a_field_jevify_sets_is_refused_before_any_request, parametrized overmax_tokens(set on every request) andlogit_bias(the case above). Replaces the per-request test from endpoint.extra_body: top-level request fields, so Ollama can turn thinking off #3, whose scenario it covers. Both cases were red before the change.template_requests, apart fromrequests, so request counts in existing tests are unchanged.Evidence
uv run pytest -m "not live and not encoder": 138 passed (137 before).ruff checkandruff format --check: clean.mypy jevify: 20 errors, the same 20 as onmain.top_nfrom the registry makes the guard fail namingtop_nand the rerank recipe.jevify probeon a recipe withextra_body: {logit_bias: ...}and an unreachablebase_urlprintsendpoint.extra_body may not set logit_bias: jevify sets itand never connects.Not exercised
🤖 Generated with Claude Code