Skip to content

Red control for #2651: tests without the change (do not merge) - #2652

Draft
jonathan308 wants to merge 10 commits into
devfrom
test/tool-call-history-nulls-v9-cold-c8-red
Draft

jonathan308 wants to merge 10 commits into
devfrom
test/tool-call-history-nulls-v9-cold-c8-red

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • sanitizeMessageForJinja and Gemma 4's string-argument path drop nulls again;
  • renderingToolArgumentNulls returns the template unchanged;
  • toolCallArgumentsCarryNull reports 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; templateInputKeepsHistoryNulls for gemma4, qwen3_5, qwen3_5_moe, qwen4_exp, nemotron_h, gpt_oss and inkling2_loop. The glm5_next, mimo_v2 and flint cases pass, because those families already kept the nulls.
  • The guards Render an earlier tool call's null arguments; serve those requests cold #2651 updates: JinjaSanitizationTests.testMessageWithNullToolCallArgumentIsSanitized, Gemma4ToolCallArgumentsTests.nullLeavesInsideParsedObjectBecomeJinjaNull FlintTemplateReplayTests.otherArchitecturesKeepGenericNullSanitization and MiMoV26PromptContractTests.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 ToolArgumentNullRenderTests cases above. Its other 54 Swift Testing tests and 110 XCTest tests pass.

Linked issue

None. This is the red control for #2651.

Test plan

  • CI (dev) on this head fails at exactly the tests above, and nothing else fails.

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated
  • No documentation needed — reason: red control, not for merge.

Changelog

  • Added or updated this PR's unique changelog.d/<topic>.md fragment and ran make changelog-check.
  • No user-visible change, or an explicitly authorized release/history change.

jonathan308 and others added 6 commits November 24, 2026 05:34
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.
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 24, 2026 3:05pm UTC
darkbloom-status Ready Ready Preview Nov 24, 2026 3:05pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 24, 2026 3:05pm UTC

Request Review

… 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.
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
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

3 active deployments
Preview – eigen-homepages-darkbloom — 89ac2ecd Deployed Nov 24, 2026 by vercel[bot]
Preview – d-inference-landing — 89ac2ecd Deployed Nov 24, 2026 by vercel[bot]
Preview – darkbloom-status — 89ac2ecd Deployed Nov 24, 2026 by vercel[bot]
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.

1 participant