Repository navigation
provider: every model that reasons takes every reasoning effort, as its own level (B-J2-1) - #1909
Merged
Merged
Conversation
… a client sends Red first. Journey 2a (B-J2-1): Hermes sends the owner's reasoning_effort "max"; Qwen 3.8 27B on pair-2 answered 400 "Invalid inference request." for "high" and "max", locally and through DevNet, and Hermes fell back to the user's other, paid provider. Low, medium and xhigh were served. The tests send none, minimal, low, medium, high, xhigh and max, as reasoning_effort and as reasoning.effort, through the production prompt pipeline for every family served here, and ask for the model's own level: the nearest one, rounding up between two, max the highest, minimal the lowest, none thinking off where the model can switch it off. - Qwen 3.8 and the owned Flash-Next build: minimal low, high and max xhigh (its template renders low, medium and xhigh); dev refuses high, max and minimal. The Qwen 3.5 template family gets the same level. - DiffusionGemma refuses max, MiMo every effort but none, Flint max, Nemotron Super low, minimal, xhigh and max. - An effort that is none of the seven names is ignored, and rendered, by Qwen 3.5, Bonsai, Gemma 4, GPT-OSS and Nemotron Lightning; it should be refused. A model that doesn't reason (llama) ignores any effort. - On one Mac's local API and on a pair leader's (the parity harness, both servers), max and high are refused with the untyped 400; an unknown effort gets no code, field or accepted names. Local run on dev 680a2fb (CPU, prod identity): ReasoningEffortValuesTests 8 tests, 39 issues; ReasoningEffortLocalAPITests 2 tests, 72 issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-every-value Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… as its own level B-J2-1 (journey 2a): Qwen 3.8 27B refused reasoning_effort "high" and "max" with an untyped 400 "Invalid inference request.", on one Mac, on pair-2 and through DevNet, so Hermes (which sends the owner's "max") fell back to the user's paid provider. Owner rule: direct and local use get the model's full ability; OpenRouter is separate. One rule, ReasoningEffort.level(in:): the seven names (none, minimal, low, medium, high, xhigh, max), as reasoning_effort or reasoning.effort, become the model's own level: its own where it has it, the next one up between two, the highest past them all. So minimal is the lowest and max the highest; none switches thinking off where the model can. - Qwen 3.5 template family (qwen3_5, qwen3_5_moe, prism_hadamard_qwen35) and the owned Flash-Next build: Qwen 3.8's low/medium/xhigh while thinking. high and max render xhigh, minimal low (the coordinator's first-party pool already sends high as xhigh). Thinking off: as sent. Qwen4SupportPolicy.validateReasoningContext, which refused them, goes. - GLM-5.3-Flash: unchanged levels (low/high/max), now through the shared rule; its exact-spelling contract with the sidecar is kept. - Nemotron 3.5 Super: minimal/low/medium set medium_effort, high/xhigh/max keep the default depth (it refused low, minimal, xhigh and max). - MiMo V2.6 and DiffusionGemma (one depth): every effort but none thinks (MiMo refused every positive effort; DiffusionGemma refused max). - Flint takes max (no effect, as for the others). - Gemma 4, Nemotron Lightning: none switches thinking off, others as before. GPT-OSS keeps its Harmony policy (high renders medium): both renders are planned by the coordinator's prompt sidecar, so they change with it. An effort that is none of the names, on a model that reasons, is refused before anything renders or is reserved: MultiModelBatchSchedulerEngineError .unsupportedReasoningEffort(field) (it absorbs unsupportedNativeReasoningEffort). The local API (one Mac, a pair's leader; the router passes a 400 on as it is) answers 400 code invalid_reasoning_effort, param the field, "<field> must be one of: none, minimal, low, medium, high, xhigh, max." The coordinator path keeps the closed invalid_request failure (the coordinator shows only its closed text). A model that doesn't reason ignores any effort. The shared native_reasoning_vectors.json follows (25 -> 28 cases): Flash-Next high/minimal/" low " render a level, max renders xhigh, turbo is refused, and Qwen 3.8's raw max renders xhigh. The platform's sidecar and pool read these cases. Tests: the red suites pass; the updated pins (Qwen4ReasoningEffortValidation, DiffusionGemma, Flint, MiMo, Super, cache parity, refusal logging) pass. Docs: direct-mode (request shape, refusal row), inference (the family table), qwen4-next-support, test.md; changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
CI on 698039a (the fix merged with All four commits show Verified. Local red/green evidence is in the description. |
4 tasks done
jonathan308
added a commit
that referenced
this pull request
Nov 8, 2026
…enCode follows it B-J2-1 part 2. This Mac's /v1/models said nothing of reasoning, so `darkbloom start --opencode` took it from the catalog alone, and Qwen 3.8 27B, whose catalog row lacks "reasoning", was offered none though it takes every reasoning effort (#1909). The list now says it in the coordinator's field and name: "supported_features": ["reasoning"] for each model this Mac or its pair serves that reasons, loaded or not, and [] for one that doesn't, by the model's type through the table that takes every effort for it (ReasoningEffortPolicy.reasons, via the new LocalModelFeatures). So a model listed as reasoning is exactly one that takes none ... max and refuses an unknown effort. - makeLocalInferenceApplication asks each model's type of the server's modelTypeProvider (ProviderLoop: the slot's, else the advertised ModelInfo's; StandaloneServer the same; DistributedLocalServer: the pair's installed type), so a pair's leader lists it before its slot is up. LocalModelLimits carries it to the router; limits and input are unchanged. - The router keeps the coordinator's supported_features for your Macs' and the network's models (the catalog's word); a model served here keeps its engine's word over the coordinator's entry for it. - IntegrationModels: for a model served here the engine's word decides, catalog or not, offline too; elsewhere the catalog's, with the reasoning the list adds. Fallback.endpointSettlesReasoning keeps an earlier tool entry from taking the engine's word away. OpenCode writes "reasoning": { "supported": true } from it; Hermes reads reasoning only from its catalog or model_overrides, not a provider's models, so its block is unchanged (it sends the effort, which every model that reasons now takes). Tests: the red suites (060ffdb) failed in CI exactly as planned: LocalModelReasoningTests 7 tests, 27 issues; EngineReasoningTests 5 tests, 7 issues; nothing else (the run's 34 issues are theirs). No local Swift run: no build slot on this host for hours (disk at its floor); CI runs the green. Docs: direct-mode (the /v1/models field table, reasoning effort), tool-integrations, inference, cli-reference, local-first, two-mac-cluster; changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The required refactor pass (AGENTS.md) for #1909. Behaviour is unchanged; the tests only gain checks. - Each family's table of the seven efforts is in ReasoningEffort.swift, as a switch that names all seven with no default, so a table that misses one doesn't build: Qwen 3.8's levels (`qwen38Level`: the Qwen 3.5 template family and the owned Flash-Next build), GLM-5.3-Flash's (`glmLevel`), Nemotron 3.5 Super's `medium_effort` (`nemotronSuperMediumEffort`), and the one depth of MiMo V2.6 and DiffusionGemma (`oneDepthThinking`). The families read these instead of `level(in:)` over level lists kept in three files (`qwen38Levels`, GLM's inline list, Super's `effortLevels`) and three `!= .none` checks. `level(in:)`, and the `Comparable` conformance only it used, go. - GLM reads an effort in one place, `namedEffort` (exactly as written, `off` for `none`); both of its readers take the level, or thinking off, from the table. `disablingRequests` and `Effort(requested:)` go. - The rules are said once, atop ReasoningEffort.swift: a model that reasons never answers one of the seven with a 400; any other value is refused before anything renders or is reserved, and the local API names the field and the seven names, never the value; a model that doesn't reason ignores the effort. The families without a table (Flint, Gemma 4, Lightning, GPT-OSS) are named there with their rule. - `ReasoningEffortPolicy.validate` and Flint's typed check are plain ifs instead of a tuple pattern and an optional inside a ternary. - Tests, only stronger: `everyFamilyTableCoversEveryEffort` checks each table's row for each of the seven against the rounding rule (and that the enum is exactly those seven), with Flint's, Gemma 4's, Lightning's and GPT-OSS's rules. The unknown-effort test now requires, for every family, the typed error naming the field it came in (it took any error), and covers GLM's `chat_template_kwargs.reasoning_effort`. - Docs: inference.md points at the tables and says the local router passes a body on unchanged; test.md; two over-long lines rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 8, 2026
4 tasks done
jonathan308
added a commit
that referenced
this pull request
Nov 8, 2026
…ony level, as the coordinator plans them B-J2-1's last two families. #1909 kept Gemma 4 and GPT-OSS on the prompts they rendered before, because the coordinator's prompt sidecar planned those. The sidecar in darkbloom-platform#721 now plans them like the other families, from a copy of these tables, so the provider renders the same: - Gemma 4 (gemma4, gemma4_text, gemma4_vision) and DiffusionGemma take an effort as their thinking switch (ReasoningEffortPolicy .effortSetsThinkingSwitch, ReasoningEffort.oneDepthThinking): on for every effort but none, which turns it off. An explicit switch wins, and no effort keeps the template's default. - GPT-OSS renders each effort at the nearest Harmony level, a new table ReasoningEffort.harmonyLevel (none, minimal and low as low; medium; high, xhigh and max as high), thinking or not (templateEffort). GPTOSSHarmonyTemplateFix.effectiveReasoningEffort, the high->medium of #703, goes: the coordinator keeps OpenRouter's traffic at medium, service accounts only, so a direct caller's high renders high. ReasoningEffort.swift's notes name the coordinator's copies and the agreement test. Two tests that asserted the old GPT-OSS medium (GPTOSSHarmonyTemplateFixesTests, BenchmarkProductionInputTests) now assert high. The fixtures are darkbloom-platform 92a208a7da5c1020c5a19ac4c29ba302d34b0838, byte for byte: production_vectors.json 0bba2b663a1bfe112a08230ac15f7e57d9dfdbb0302e26c0e4884cc2d7ee05f9 reasoning_effort_vectors.json 6ca08c3e1db6d5fdd906cf76b818d6d60d212fa19cfd3bea10bcbafecec16aa4 native_reasoning_vectors.json c4d496f6a6b7e4fdcaa9d59debf8f40c16a1cc1d86e0e76f8aadb916922ea9d2 Tests: the red commit (7079a37) failed in CI exactly as planned. Shard 1 had 36 issues: the agreement test on 35 cases (16 Gemma 4, 19 GPT-OSS) and the native vector. Its prompt-parity gate (verify-prompt-parity.sh) failed on the three Gemma 4 reasoning_effort cases. Shard 2 had 75 issues: Gemma 4 one-depth 36, GPT-OSS levels 20, GPT-OSS template context 14, table rule 5. Locally, with Xcode 27.2 on CPU only, these pass: CachePromptParityTests, ReasoningEffortValuesTests, templateContext*, GPTOSSHarmonyTemplateFixesTests, BenchmarkProductionInputTests, DiffusionGemmaReasoningControlTests, PromptDateRenderingTests, Qwen4ReasoningEffortValidationTests, InboundDecodeTests, NemotronSuperPromptContractTests and GLM5NextPromptPolicyTests. So does ProductionPromptParityTests (PROMPT_PARITY_REQUIRED=1, the manifests' artifacts): Swift and the platform's Rust render every case of the seven production models token for token. EngineV2VisionRoutingTests needs a Metal device, so it is left to CI. Docs: inference.md (the family table; the pending marker goes) and test.md (the agreement fixture and its generator), plus a changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sal that names both fields Red first, for #1909's review (N2). Nemotron 3.5 Super reads both reasoning_effort and reasoning.effort, and doesn't choose between two that differ, even two names (high and max). controls(body:) throws conflictingControls, which the local API answers with an untyped 400: no code, no field, and for a media request the wrong words. ReasoningEffortLocalAPITests.superRefusesTwoDifferentEffortsInWords takes what controls(body:) throws for high/max, max/high, minimal/medium and turbo/low, maps it through SuperHTTPErrors (text and media) and renders it through CORSResponder, the local API's error layer. It requires the shape an unknown name gets: - 400, invalid_request_error, code invalid_reasoning_effort; - param "reasoning_effort, reasoning.effort"; - a message naming both fields and the seven names, never the values. The same effort in both fields, in any spelling, is still served. NemotronSuperLocalHTTPTests' live text route, the real application over the Super hook, now also sends an unknown reasoning.effort and two differing efforts end to end, streamed and not. It needs Metal, so it runs in CI only. Local run (Xcode 27.2, CPU only, on 3f66103 plus this commit): the new test fails with 24 issues, the code, param and message for each of the 4 pairs on text and media. Text requests got {"message":"Invalid inference request.","type":"invalid_request_error"}, and media requests {"message":"Invalid media input.",...}. The suite's two other tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ames both fields For #1909's review (N2). Nemotron 3.5 Super keeps its rule: it reads both reasoning_effort and reasoning.effort, and refuses two that differ after trimming and case, even two names at one depth (minimal and medium), rather than choose one. Only the refusal changes: - controls(body:) throws the new NemotronSuperPromptContract.Failure .conflictingReasoningEfforts instead of the generic conflictingControls. An unknown reasoning.effort is still refused for its own field first (unknownReasoningEffort), so the shared effort vectors' Super case (turbo and low: "error", not "refused") reads as before. - SuperHTTPErrors maps it to the new MultiModelBatchSchedulerEngineError .conflictingReasoningEfforts, for text and media requests alike. - CORSResponder answers it as it answers an unknown name: 400, invalid_request_error, code invalid_reasoning_effort, param "reasoning_effort, reasoning.effort", and the message "reasoning_effort and reasoning.effort must be the same when both are sent, one of: none, minimal, low, medium, high, xhigh, max." It is fixed text (ReasoningEffortField.conflictParam and .conflictMessage), never the values sent. - Through the coordinator the wire is unchanged: closed invalid_request, 400, client_error. darkbloom logs now names the reason, contradictory_reasoning_controls, where it had none. Other contradictions on Super (an effort against enable_thinking or medium_effort) keep the untyped 400: they are not two effort fields. Tests: ReasoningEffortValuesTests.nemotronSuperRefusesTwoDifferentEfforts pins the contract's failures (high/max, minimal/medium and turbo/low conflict; low/turbo is an unknown reasoning.effort; high/" HIGH " and Low/low render). InferenceRefusalLoggingTests maps the new case to its log reason, and Qwen4ReasoningEffortValidationTests' coordinator classification (400, invalid_request, client_error) now runs for both typed effort errors. Docs: inference.md (Reasoning effort, and the failure-modes row), direct-mode.md (the request section and a refused-shape row), test.md, and the changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s or any KV is reserved, not before anything For #1909's review (N1). "Refused before anything renders or is reserved" overstated the order. The engine checks the effort in MultiModelBatchSchedulerEngine.prepareCompletion, after acquireForCompletion, so: - a cold model may load first; - on one Mac's unified endpoint the request holds the local reservation, which counts as the owner's use for "me first" (acquireModelForLocal); - the refusal then releases the model. Super's owner refuses in NemotronSuperRequestPlan, after its own admission. MiMo's and Flint's efforts are checked before acquisition when the model is resident. Through the coordinator, MiMo's, Flint's and GLM-5.3-Flash's are refused before the request is accepted (nativeControlsRefusal). The order itself is unchanged: dev's DiffusionGemma check sat on the same line. The sentence now says what holds on every path: the refusal comes before the prompt renders or any KV is reserved. That is what ReasoningEffortLocalAPITests checks: no template context, and no reservation on the pair. The changes: - ReasoningEffort.swift's header; - inference.md's Reasoning effort paragraph, with the paths above; - direct-mode.md's refused-shape row, which now says a cold model may load and, with Both, me first, the request counts as your use; - the local API test's description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 8, 2026
…n wording, dev 28ddc01) into fix/local-models-list-reasoning Two conflicts, both in the Reasoning effort text that the two PRs each edited: - docs/architecture/inference.md: #1909's reworded refusal paragraph (before the prompt renders or any KV is reserved), then this PR's sentence on /v1/models listing the same table's models as reasoning. - docs/provider/direct-mode.md: this PR's /v1/models sentence, then #1909's advice to send the effort in one field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 8, 2026
dev merged #1902 (route choice) after #1909's head was carried here, and GitHub showed this PR as conflicting, so CI (dev) could not run. One conflict: LocalRouterTestSupport.swift's RouterFixture.init, where #1902 added settingsFile and this PR added modelTypes. Both parameters are kept. #1902's other changes merge cleanly with this PR's router list: LocalRouter(config:localModels:localLimits:) is unchanged, and no code passes LocalModelLimits a reasoning: argument or reads LocalModelFeatures.reasoning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-every-value Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
jonathan308
marked this pull request as ready for review
November 9, 2026 00:31
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
dev moved again after a788ef2: #1909 (every model that reasons takes every reasoning effort) and #1919 (the MiMo cancellation test's flake), 43 files. Shared with this PR: MultiModelBatchSchedulerEngine.swift, which merges cleanly and keeps the MeFirstOwnerRequest.makeRoom binding around prepareAcquiredCompletion, and docs (inference.md, direct-mode.md), which merge cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
…-gemma-harmony One conflict, docs only, as #1916's review predicted (its N16): docs/architecture/inference.md, where #1909 added the Nemotron 3.5 Super paragraph just above the paragraph this PR rewrites ("Gemma 4 and GPT-OSS keep the prompts they rendered before", with its pending B-J2-1 note). Kept #1909's Super paragraph, then this PR's agreement-test paragraph, which replaces the old one and its note. ReasoningEffort.swift, ReasoningEffortValuesTests.swift and test.md auto-merge: the header keeps #1909's two bullets (the refusal before the prompt renders or any KV is reserved; Super's two differing efforts), and both sides' additions stand. The shared fixture is unaffected: Super's turbo+low case stays "error", since conflictingReasoningEfforts is no unknown-name refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
Brings dev c5263de, which #1910 merged after 344fd29: #1907 (the pair's progress comments on the probes' own clock), #1909 (every model that reasons takes every reasoning effort), #1919 (a MiMo test flake) and #1904 (the tools wait for the model). No conflict. Shared with this PR: StandaloneServer+HTTP.swift, where #1909's reasoning-effort refusals and the envelope's param sit beside this PR's memory case, which stands; and docs (direct-mode.md, inference.md), which merge cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
…rmony provider: Gemma 4 thinks for an effort, GPT-OSS renders its Harmony level; the coordinator's effort table is checked against the provider's (B-J2-1, stacked on #1909)
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
…ember-relay Two docs conflicts, each kept true to the merged code: - docs/provider/quickstart.md: #1904 rendered its own <!-- pending LS-4 --> marker and added <!-- pending LS-3: in a pair, start with opencode on either Mac. -->, which this branch's text already says; both markers are gone. The Two Macs bullet says "darkbloom --opencode on either Mac" (this branch) with #1904's note that the wait for the model and the tool-points-elsewhere line are for one Mac for now (a pair's tools wait for its API to listen, setUpToolsBesidePair). - docs/provider/direct-mode.md: the key-file row keeps this branch's rule (the key the discovery record names: this Mac's own local_token, a pair's API or its relay included) with #1904's sentence on a start without a tool flag and its LocalEndpoint.tokenPath() source; this branch's pair-key row stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
… fix/local-models-list-reasoning No conflicts. #1916 is in, so #1914's review condition C2 holds: Gemma 4 lists reasoning, and an effort now turns its thinking on. #1904 (tools wait for the model) adds no location.servedHere and no pair location. IntegrationModels.Location is still thisMac, yourMacs and network, and a pair's own /v1/models entries are still this-mac. So this PR's `location == .thisMac` remains exactly "served here", and a pair keeps its engine's "no". #1911, which merges after this PR, makes the switch to location.servedHere (review condition C1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
provider: this Mac's model list says which models reason, and OpenCode follows it (B-J2-1 part 2, stacked on #1909)
This was referenced Nov 9, 2026
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
dev moved 27 PRs past this branch's base d9d36fe. Two files conflicted, both because #1909 (every reasoning effort, typed 400 for an unknown one) replaced the unsupportedReasoningEffort and unsupportedNativeReasoningEffort cases with unsupportedReasoningEffort(ReasoningEffortField) and conflictingReasoningEfforts: - MultiModelBatchSchedulerEngineError.swift: dev's two cases and their messages, then this branch's reasoningCannotBeDisabled and responseFormatNotEnforced with theirs. - ProviderLoop+ErrorMapping.swift: dev's case lists plus this branch's two cases, in the client-error category, invalid_request code and 400 status, as before. The libs/mlx-swift-lm pin (ae63a65c, Layr-Labs/mlx-swift-lm#304 on SDK main 67110e7b) is unchanged: dev still pins 67110e7b. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch had an error being 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
B-J2-1 (journey 2a, pair-2, DevNet
.144=dev680a2fb): Qwen 3.8 27B answeredreasoning_efforthighandmaxwith an untyped400 {"message":"Invalid inference request."}, on one Mac, on the pair and through DevNet. Hermes sends the owner'smax, so it silently fell back to his other, paid provider. Owner rule: direct and local use get the model's full ability; OpenRouter is separate.Now every model that reasons takes every effort a client sends (
none,minimal,low,medium,high,xhigh,max, asreasoning_effortorreasoning.effort) as its own level:minimalis the lowest andmaxthe highest;noneswitches thinking off where the model can;ReasoningEffort.swift(qwen38Level,glmLevel,nemotronSuperMediumEffort,oneDepthThinking). Each table is aswitchover the seven efforts with nodefault, so a table that misses one doesn't build.An effort that is none of the names gets a typed 400 on the local API (
invalid_reasoning_effort,param, the accepted names). Nemotron 3.5 Super, which reads both fields, answers two that differ with the same typed 400, itsparamnaming both fields. A model that doesn't reason ignores the effort.Head
d786300d89:3f66103043;34ac774b54(red),7eab3ad6f1ande66a984ab3;dev28ddc01605merged.#1914 and #1916 are stacked on this PR.
Before
flowchart LR H["Hermes: reasoning_effort max"]:::client --> API["Local API, pair leader,<br/>or coordinator path"]:::svc API --> CTX["templateAdditionalContext<br/>passes the effort as sent"]:::svc CTX --> Q{"Qwen4SupportPolicy<br/>.validateReasoningContext:<br/>low, medium, xhigh only"}:::bad Q -- "high, max, minimal" --> E["400 Invalid inference request.<br/>no code, no field"]:::bad E --> F["Hermes falls back to<br/>the user's paid provider"]:::bad Q -- "low, medium, xhigh" --> OK["200"]:::good CTX --> O["MiMo: every effort but none refused<br/>Super: low, minimal, xhigh, max refused<br/>DiffusionGemma, Flint: max refused<br/>Qwen 3.5, Gemma 4, GPT-OSS: turbo rendered"]:::bad classDef client fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef svc fill:#f3f4f6,stroke:#4b5563,color:#111827 classDef good fill:#dcfce7,stroke:#15803d,color:#14532d classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1dAfter
flowchart LR H["Hermes, OpenAI clients:<br/>none … max"]:::client --> API["Local API, pair leader,<br/>or coordinator path"]:::svc API --> V{"ReasoningEffortPolicy.validate<br/>(family policies for MiMo,<br/>GLM, Flint, Super)"}:::svc V -- "one of the seven names" --> L["the family's table<br/>in ReasoningEffort.swift"]:::good L --> T["Qwen 3.8: high, max → xhigh<br/>minimal → low"]:::good T --> OK["200, Darkbloom serves it"]:::good V -- "turbo" --> R["400 invalid_reasoning_effort<br/>param + accepted names"]:::warn V -- "Super: two efforts that differ" --> R2["400 invalid_reasoning_effort<br/>param names both fields"]:::warn V -- "model doesn't reason" --> I["effort ignored"]:::good classDef client fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef svc fill:#f3f4f6,stroke:#4b5563,color:#111827 classDef good fill:#dcfce7,stroke:#15803d,color:#14532d classDef warn fill:#fef3c7,stroke:#b45309,color:#78350fWhat each effort renders
noneminimallowmediumhighxhighmaxlowlowmediumxhighxhighxhighhigh,max,minimallow/high/max)lowlowhighhighmaxmaxmedium_effort/ default)low,minimal,xhigh,maxnone; DiffusionGemma: 400 formaxlow/medium/high)lowmediummediummaxNotes:
enable_thinking: false,reasoning.enabled: false, a forced Qwen tool), the Qwen family's effort goes as sent (the template ignores it), as the coordinator's pool does.reasoning.effortwins overreasoning_effort, except on Nemotron 3.5 Super, which reads both. Super refuses two that differ, even two names at one depth (minimalandmedium); the same effort in both, in any spelling, is served.Review round ("approve with nits")
N1: the docs overstated the order (
e66a984ab3). They said "refused before anything renders or is reserved". In fact the engine checks the effort inMultiModelBatchSchedulerEngine.prepareCompletion, afteracquireForCompletion:acquireModelForLocal);The code is unchanged; dev's DiffusionGemma check sat on the same line.
ReasoningEffort.swift,inference.md(Reasoning effort) anddirect-mode.md(the refused-shape row) now say what holds on every path: before the prompt renders or any KV is reserved. They also name the earlier checks: MiMo's and Flint's efforts when the model is resident, and through the coordinator MiMo's, Flint's and GLM's before the request is accepted (nativeControlsRefusal).N2: Super's untyped 400 for two different efforts. Super still refuses
reasoning_effortandreasoning.effortthat differ (after trimming and case), even two names. Only the refusal changes, and it is now typed.Red (
34ac774b54):ReasoningEffortLocalAPITests.superRefusesTwoDifferentEffortsInWordsrenders whatcontrols(body:)throws throughSuperHTTPErrorsandCORSResponder. On3f66103043it fails with 24 issues: the code,paramand message forhigh/max,max/high,minimal/mediumandturbo/low, each on text and media. Text requests gotInvalid inference request., and media requestsInvalid media input.Fix (
7eab3ad6f1): a newNemotronSuperPromptContract.Failure.conflictingReasoningEffortsmaps to a newMultiModelBatchSchedulerEngineError.conflictingReasoningEfforts. The local API answers it as it answers an unknown name, in fixed text, never the values sent:{"error": {"type": "invalid_request_error", "code": "invalid_reasoning_effort", "param": "reasoning_effort, reasoning.effort", "message": "reasoning_effort and reasoning.effort must be the same when both are sent, one of: none, minimal, low, medium, high, xhigh, max."}}An unknown
reasoning.effortis still refused for its own field first. So the shared vectors in provider: Gemma 4 thinks for an effort, GPT-OSS renders its Harmony level; the coordinator's effort table is checked against the provider's (B-J2-1, stacked on #1909) #1916 read as before: Super'sturbo+lowiserror, notrefused.Through the coordinator the wire is unchanged: closed
invalid_request, 400,client_error.darkbloom logsnow names the reason,contradictory_reasoning_controls.The live Super HTTP route (
NemotronSuperLocalHTTPTests, the real application over the Super hook) now sends an unknownreasoning.effortand two differing efforts end to end. It needs Metal, so it runs in CI.Not changed:
enable_thinkingormedium_effort) keep the untyped 400: they are not two effort fields.N3: non-owned Flash-Next builds. Left as a follow-up (Limitations).
N4: this body, refreshed.
The coordinator's mapping (darkbloom-platform
masterd7de2162f, read-only)This is still
master. Draft darkbloom-platform#721, with #1916 here, ports this table to the coordinator's pool, sidecar and ingress. Until thenmastermaps the same way, with these differences:Qwen (
firstparty/chattemplate/qwen3_5.goqwenPoolEffort): the first-party pool sendshighasxhigh, the same. The differences:minimal,maxand" low ", so the request falls to Macs, which now renderlow,xhighandlow;promptsidecar/src/normalize.rs) refuses Flash-Next efforts other thanlow/medium/xhigh, and its Qwen 3.8 render raises forhigh. So cache planning goes cold for those requests: cold, never a mismatched plan.GLM-5.3-Flash (
glm5_next.goreadEffort,glm5_next.rs): an identical table.Nemotron Super (
nemotron_super.go/.rs), MiMo (mimo_v2.go/mimo_v26.rs), DiffusionGemma (diffusion.rs): they still refuse what the Mac now takes (Superminimal/low/xhigh/max, MiMo's positive efforts, DiffusionGemmamax). The pool declines and the sidecar goes cold.GPT-OSS: the sidecar mirrors the Mac's
high→medium: the same (kept).An unknown effort through the coordinator: the coordinator relays no provider prose (
failure/inference_error_sanitize.goSanitizeProviderError), so a network client still reads400 invalid inference request. [bug] doctor's "model fits in RAM" check reports a false FAIL: it samples free memory once while the load gate evicts and resamples #721 adds a typed ingress 400.Shared vectors:
fixtures/prompt-contract/v1/native_reasoning_vectors.jsongoes from 25 to 28 cases:high,minimaland" low "now render a level, andmax→xhigh;turbois refused;max→xhigh.The platform's
promptsidecar/tests/cache_prompt_parity.rsandchattemplate/qwen3_5_test.go(it counts 6 served and 1 raised) read this file, so they change when the platform syncs it.Left as they were (prompt contract)
nonekeeps the template's default (thinking off). Turning thinking on changes a prompt that the platform'sproduction_vectors.jsonpins (Gemma'sreasoning_effort: mediumcase), and only the platform's sidecar regenerates that file.highstill rendersmedium(fix(provider): harden GPT-OSS Harmony requests #703, "to avoid upstream timeouts", an OpenRouter concern), andnone/minimal/xhigh/maxreach Harmony as sent (Reasoning: max). Mapping them to Harmony's levels changes prompts the sidecar plans for cache routing.<!-- pending B-J2-1 … -->indocs/architecture/inference.md. provider: Gemma 4 thinks for an effort, GPT-OSS renders its Harmony level; the coordinator's effort table is checked against the provider's (B-J2-1, stacked on #1909) #1916, stacked on this PR, changes both, together with [bug] doctor's "model fits in RAM" check reports a false FAIL: it samples free memory once while the load gate evicts and resamples #721's sidecar.Test plan
Red first (
191e9d02f6, ondev680a2fb), CPU only, prod identity, Xcode 27.2, nice 19, in a sandbox denying the GPU,~/.darkbloom*and ports 8000/47420-47423:ReasoningEffortValuesTests: 8 tests, 39 issues ondev:high/max/minimal, DiffusionGemmamax, MiMo its positive efforts, Flintmax, Superlow;turbo.ReasoningEffortLocalAPITests: 2 tests, 72 issues ondev. One Mac and the pair leader (the parity harness's realDistributedLocalServer) answerreasoning_effort=max stream=truewith400 {"error":{"message":"Invalid inference request.","type":"invalid_request_error"}}, exactly B-J2-1, andturbogets no code or field.dev, and its mutant F1 (MiMo names the wrong field) is caught.This round: red as in N2 above (24 issues). Then, on the merged head
d786300d89(withdev28ddc01605), 36 focused filters, 353 tests, 0 failures, 1 skipped:ReasoningEffortValuesTests10, including the newnemotronSuperRefusesTwoDifferentEfforts;ReasoningEffortLocalAPITests3, including the new Super test;Qwen4ReasoningEffortValidationTests8, whose coordinator classification (400,invalid_request,client_error) now runs for both typed effort errors;InferenceRefusalLoggingTests/promptRefusalReasonsComeFromTheTypedError;NemotronSuperPromptContractTests15,NemotronSuperOpenRouterCapabilityTests4,CachePromptParityTests3,GLM5NextPromptPolicyTests36,FlintPolicyTests10,FlintTemplateReplayTests5;DiffusionGemmaReasoningControlTests5,DiffusionGemmaReasoningEmissionTests5;MiMoV26TemplateFixTests19, andMiMoV26PromptContractTests5 andMiMoV26ConsumerParityTests11 (1 skipped), run with the pinned public MiMo metadata;Qwen4ReasoningControlTests3,Qwen4SupportPolicyTests11,Qwen35TemplateFixesTests19,GPTOSSHarmonyTemplateFixesTests6;MultiModelBatchSchedulerEngineTests32, the engine'stemplateContexttests (9),ToolChoicePromptPolicyTests18,NativeMediaToolPreparationTests5,NativeOutputControlRefusalTests4,ProductionPromptParityTests1;LocalChatRequestTests5,LocalContentPartRefusalTests2,LocalStreamingFailureTests2,LocalContextWindowTests10,LocalRouterTests31,VideoReaderFailureMappingTests5;ClusterAPIParityTests7,ClusterSetupProbeRequestTests3,InboundDecodeTests32,InboundChatRequestDecodeTests3,ProviderLoggerPrivacyTests5.Also on the merged head:
make docs-check(211 files OK),docs-impact-check --base 28ddc01605(coverage OK),changelog.py check(53 valid) andgit diff --check(clean).CI on
d786300d89(CI (dev) run 42526116613): green.d-inference,d-inference-console-ui-dev) appear on every open PR.Components touched
Protocol / interface changes
param, omitted when nil, so every other envelope is unchanged. Its codeinvalid_reasoning_effortcovers an unknown effort and, on Super, two that differ (param"reasoning_effort, reasoning.effort").invalid_request, 400,client_error.MultiModelBatchSchedulerEngineError.unsupportedReasoningEffortnow carries the field and absorbsunsupportedNativeReasoningEffort. The new.conflictingReasoningEffortsis Super's.native_reasoning_vectors.jsonchanges as above, and the platform follows.Documentation impact
docs/architecture/inference.md: the "Reasoning effort" section, with the family table, where the refusal happens and Super's two fields; the failure-mode rows; Flint.docs/provider/direct-mode.md: the request shape and the refused-shape rows, including Super's.docs/reference/qwen4-next-support.mdanddocs/developer/test.md.changelog.d/reasoning-effort-every-value.md.Limitations
Qwen4SupportPolicy.ownsEffortTemplatekeys on the owned model ID (and the concrete Qwen 3.8 IDs), not on the template.qwen4_expbuild, such as a communityQwen3.8-Flash-Next-*a user serves locally, gets its effort as sent.high,maxandminimalreach that template'sraise_exceptionwhile thinking: HTTP 500jinja_template, the provider-fault class. The same happens ondev.metal::load_devicein the GPU-denying sandbox (the live Super HTTP route,StandaloneServerTests,EngineV2VisionRoutingTests, the rest ofInferenceRefusalLoggingTests). CI runs them.NemotronSuperManagedEffortLiveTests,FlintOpenRouterLiveTests) were not run.qwen3_vl_moeis not treated as reasoning (it holds instruct-only Qwen3-VL builds), so Qwen 3.6 VL under that type ignores an unknown effort rather than refusing it.Refactor pass
Done (
3f66103043), behaviour-preserving:ReasoningEffort.level(in:)over level lists kept in three files.ReasoningEffort.swift, and the control flow is plainer.everyFamilyTableCoversEveryEffortchecks every row against the rounding rule, and the unknown-effort test now requires the typed error naming its field. Mutants F1–F5 (a family naming the wrong field) survived the PR's tests and are caught by the pass's.The independent review then approved with nits N1–N4, addressed above.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.