Repository navigation
Red control for #2651: tests without the change (do not merge) - #2652
Draft
jonathan308 wants to merge 10 commits into
Draft
jonathan308 wants to merge 10 commits into
jonathan308 wants to merge 10 commits into
Conversation
The call parser converted argument text with the render types the ingress repair writes for the chat template, so a union, `not` or if/then/else parameter read as its first or default member: under `oneOf: [integer, number]` the text "2.5" stayed a string, which the declaration refuses. The parser and the Qwen strict grammar's reading now use each tool's parameters as sent (`Prepared.argumentTools`, `ToolArgumentSchemas`), with a typeless enum/const node typed by its own values, which accepts the same instances. The template still renders the repaired declarations; auto validation already read the declarations as sent. GLM is unchanged. Tests cover the tool-call schema fuzz grid constructs: the reading accepts exactly the declared instances, the rendered parameter keeps its render type, and Qwen 3.5 calls parse to arguments their declaration accepts.
With reasoning on, Lightning sometimes closes its thought early to sketch the calls it plans, keeps reasoning in plain text, closes the thought again and then writes the real calls. The splitter absorbs the second </think> as a stray close and keeps everything before it as content, so the sketched frames were parsed as calls too: two parallel calls came back as four. On the Nemotron route (absorbStrayThinkClose with the nemotron parser), the splitter now holds content from the first tool frame after a closed thought. A stray </think> turns the held text into reasoning, so its frames never become calls; at the end of the output the held text is content as before. Calls are not deduplicated by value, since identical parallel calls can be intended.
…d tool-call arguments with the caller's declarations
…draft calls before a second thought close as reasoning
A JSON null in an earlier assistant tool call's arguments was dropped before
the chat template rendered, so the model saw a different call than the one it
made (Gemma 4: call:clear_project_deadline{} for {"deadline": null}) and
repeated the omission. The shared sanitizer now keeps those nulls as Jinja
null at their key or array position (sanitizeMessageForJinja, and Gemma 4's
string-argument path). Gemma 4's format_argument macro and the Qwen 3.5 /
Nemotron 3.5 Lightning XML parameter value gain a branch that writes null;
the rewrite is applied by the serving tokenizer and the render check only, so
the managed Nemotron Super contract renders as before. Tool parameter schemas
keep the drop policy. GLM-5.3, MiMo and Flint already kept these nulls.
The prompt contract stays darkbloom-request-normalization-v9, which still
renders such a call without its nulls. A coordinator request whose tool-call
history carries one, on a model that renders through the shared sanitizer, is
served without the prompt cache: no scope or receipt nonce, so no lookup or
ready receipt, no cached-token usage and no checkpoint write. The template
controls still come from the planned context. Each such request is logged
(public fixed line) and counted in the daemon state
(promptCacheSkippedToolCallNull).
ProductionPromptParityTests classifies a vector body with a history null as
provider-rendered and uncacheable: it checks that the body is served cold and
that the vectors still match the same body with those nulls dropped; the
vectors are unchanged. Guards updated because they asserted exactly the old
drop: JinjaSanitizationTests (the null unit argument stays Jinja null),
Gemma4ToolCallArgumentsTests (a parsed null leaf becomes Jinja null) and
FlintTemplateReplayTests' generic-architecture case (call arguments keep their
nulls; its schema assertions are unchanged).
Keeps the new API so the new tests compile, but brings back the previous behaviour: sanitizeMessageForJinja and Gemma 4's string-argument path drop nulls again, renderingToolArgumentNulls leaves templates unchanged and toolCallArgumentsCarryNull reports no null. Do not merge.
7 of 15 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 13 tasks
… pin the 14 cases ProductionPromptParityTests now classifies a vector body as provider-rendered by ToolCallHistoryNullCache.servingContext itself (the serving decision), builds the v9 body for the vector comparison by passing each history call's arguments through the production sanitizeForJinja instead of a test-only dropper, and requires the classified set to be exactly the 14 vector bodies (7 models x endpoint_messages_tool_turn and gemma_tool_turn) whose earlier call carries a null. Every other case is checked as before; the vectors are unchanged.
MiMoV26PromptContractTests.testOtherFamilyStillUsesExistingPermissiveControlAndNullNormalization rendered a MiMo reference body through another family's normalization and expected different tokens, because the shared sanitizer dropped the nulls in that body's earlier call arguments. Those are exactly the nulls it now keeps, as MiMo always has, so the two renders agree. The assertion now requires that agreement; the malformed-control half of the test is unchanged, and MiMo's own render is still pinned by the reference corpus.
…ps a null Adds a second body to testOtherFamilyStillUsesExistingPermissiveControlAndNullNormalization with a null outside any call's arguments (a tool parameter schema's default), which the shared sanitizer still drops and MiMo keeps. The other family's render of it must still differ from MiMo's. The arguments-only reference body keeps the agreement assertion from the previous commit.
The schema body now renders twice per family: without the default null the two families must render it alike, and with the default null they must differ, so the null is the only cause of the difference. The schema value is typed as MLXLMCommon.JSONValue explicitly.
This branch was successfully deployed
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.
Summary
Red control for #2651 (replaces #2650): #2651's tests run on #2651's head plus one commit that restores the previous behaviour while keeping the new API so the tests compile. That commit,
89ac2ecd7f, does three things:sanitizeMessageForJinjaand Gemma 4's string-argument path drop nulls again;renderingToolArgumentNullsreturns the template unchanged;toolCallArgumentsCarryNullreports no null, so no request is served cold.Do not merge.
Expected result: CI fails at exactly these tests, and nothing else fails.
ToolArgumentNullRenderTests:callArgumentsKeepNullsAndOtherFieldsDropThem,argumentsWithANullAnywhereCarryOne,gemmaRendersNullArguments,qwenXMLRendersNullParameters,qwenTojsonRendersNullParameters,gptOSSRendersNullArguments,inklingRendersNullArguments,rewritesMatchTheServedBlocksOnceAndAreIdempotent.ToolCallHistoryNullCacheTests:historyNullServesCold;templateInputKeepsHistoryNullsforgemma4,qwen3_5,qwen3_5_moe,qwen4_exp,nemotron_h,gpt_ossandinkling2_loop. Theglm5_next,mimo_v2andflintcases pass, because those families already kept the nulls.JinjaSanitizationTests.testMessageWithNullToolCallArgumentIsSanitized,Gemma4ToolCallArgumentsTests.nullLeavesInsideParsedObjectBecomeJinjaNullFlintTemplateReplayTests.otherArchitecturesKeepGenericNullSanitizationandMiMoV26PromptContractTests.testOtherFamilyStillUsesExistingPermissiveControlAndNullNormalization.ProductionPromptParityTests(in the prompt-parity job) fails only at the pinned-set assertion. No body is classified as provider-rendered here, so the set is empty instead of the 14 named cases; every per-case token check passes, because the provider renders the vectors' v9 prompt.Locally, the ProviderCoreFoundation target fails at exactly the
ToolArgumentNullRenderTestscases above. Its other 54 Swift Testing tests and 110 XCTest tests pass.Linked issue
None. This is the red control for #2651.
Test plan
Components touched
Protocol / interface changes
Documentation impact
Changelog
changelog.d/<topic>.mdfragment and ranmake changelog-check.