Repository navigation
Red control for #2649: tests without the change (do not merge) - #2650
Closed
jonathan308 wants to merge 11 commits into
Closed
jonathan308 wants to merge 11 commits into
jonathan308 wants to merge 11 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.
…schemas Moves the SDK pin from 20fa3d540d to 689f2f00bf (Layr-Labs/mlx-swift-lm#535), which reads a tool-call argument written as a JSON literal as that literal when its schema admits the literal and rejects the text as a string, including under not, if/then/else, unions and untyped schemas.
Inkling 2 Mini sometimes opens a text message where a call's header
belongs: <|content_text|>NAME<|content_invoke_tool_json|>{...}. Markers
inside an answer are its text, so the lexer returned the frame as answer
text: no call for a single call, one call fewer in a parallel response.
An answer's first bytes are now held while they can still be a function
name (letters, digits, _ or -, up to 64). If the marker follows, the
message is that call with the name as its header, checked against the
body's name as a header is; any other byte releases the held bytes as
the answer's text. Calls stay text when the request declares no tools.
Moves the SDK pin from 689f2f00bf to cba8c22177, the merge commit that landed Layr-Labs/mlx-swift-lm#535 on main. Its tree is #535's tree on main 52f81662a6.
…d tool-call arguments with the caller's declarations
…draft calls before a second thought close as reasoning
…call frame that opens an answer message as the call
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
Collaborator
Author
|
Superseded by #2652. |
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 #2649: #2649's tests run on #2649's head plus one commit that restores the previous behaviour while keeping the new API so the tests compile. That commit,
765bea8d0f, 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.nullLeavesInsideParsedObjectBecomeJinjaNullandFlintTemplateReplayTests.otherArchitecturesKeepGenericNullSanitization.ProductionPromptParityTestspasses here, because no body is classified as provider-rendered and 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 #2649.
Test plan
Components touched
Protocol / interface changes
Documentation impact
Changelog
changelog.d/<topic>.mdfragment and ranmake changelog-check.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.