Skip to content

provider: every model that reasons takes every reasoning effort, as its own level (B-J2-1) - #1909

Merged
jonathan308 merged 10 commits into
devfrom
fix/reasoning-effort-every-value
Nov 9, 2026
Merged

jonathan308 merged 10 commits into
devfrom
fix/reasoning-effort-every-value

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

B-J2-1 (journey 2a, pair-2, DevNet .144 = dev 680a2fb): Qwen 3.8 27B answered reasoning_effort high and max with an untyped 400 {"message":"Invalid inference request."}, on one Mac, on the pair and through DevNet. Hermes sends the owner's max, 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, as reasoning_effort or reasoning.effort) as its own level:

  • its own level where the model has it, else the next one up between two, so minimal is the lowest and max the highest;
  • none switches thinking off where the model can;
  • each level comes from one table per family in ReasoningEffort.swift (qwen38Level, glmLevel, nemotronSuperMediumEffort, oneDepthThinking). Each table is a switch over the seven efforts with no default, 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, its param naming both fields. A model that doesn't reason ignores the effort.

Head d786300d89:

  • the refactor pass's 3f66103043;
  • this round's review fixes: 34ac774b54 (red), 7eab3ad6f1 and e66a984ab3;
  • dev 28ddc01605 merged.

#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:#7f1d1d
Loading

After

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:#78350f
Loading

What each effort renders

Family none minimal low medium high xhigh max Was
Qwen 3.8 27B, owned Flash-Next, Qwen 3.5 template family (3.5, 3.6, Bonsai 2) thinking off low low medium xhigh xhigh xhigh Qwen 3.8: 400 for high, max, minimal
GLM-5.3-Flash (low/high/max) off low low high high max max same (now the shared rule)
Nemotron 3.5 Super (medium_effort / default) off medium medium medium default default default 400 for low, minimal, xhigh, max
MiMo V2.6, DiffusionGemma (one depth) off on on on on on on MiMo: 400 for all but none; DiffusionGemma: 400 for max
Gemma 4, Nemotron Lightning (switch) off as before as before as before as before as before as before same
GPT-OSS (Harmony low/medium/high) as sent as sent low medium medium as sent as sent same
Flint (decides itself) no effect no effect no effect no effect no effect no effect taken 400 for max
A model that doesn't reason ignored ignored ignored ignored ignored ignored ignored same

Notes:

  • While thinking is off (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.
  • Spellings are trimmed and read in any case, except by GLM-5.3-Flash and Flint, which keep their exact contracts.
  • reasoning.effort wins over reasoning_effort, except on Nemotron 3.5 Super, which reads both. Super refuses two that differ, even two names at one depth (minimal and medium); 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 in MultiModelBatchSchedulerEngine.prepareCompletion, after acquireForCompletion:

    • 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 it.

    The code is unchanged; dev's DiffusionGemma check sat on the same line. ReasoningEffort.swift, inference.md (Reasoning effort) and direct-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_effort and reasoning.effort that differ (after trimming and case), even two names. Only the refusal changes, and it is now typed.

    • Red (34ac774b54): ReasoningEffortLocalAPITests.superRefusesTwoDifferentEffortsInWords renders what controls(body:) throws through SuperHTTPErrors and CORSResponder. On 3f66103043 it fails with 24 issues: the code, param and message for high/max, max/high, minimal/medium and turbo/low, each on text and media. Text requests got Invalid inference request., and media requests Invalid media input.

    • Fix (7eab3ad6f1): a new NemotronSuperPromptContract.Failure.conflictingReasoningEfforts maps to a new MultiModelBatchSchedulerEngineError.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.effort is 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's turbo + low is error, not refused.

    • Through the coordinator the wire is unchanged: closed invalid_request, 400, client_error. darkbloom logs now names the reason, contradictory_reasoning_controls.

    • The live Super HTTP route (NemotronSuperLocalHTTPTests, the real application over the Super hook) now sends an unknown reasoning.effort and two differing efforts end to end. It needs Metal, so it runs in CI.

    • Not changed:

      • Other Super contradictions (an effort against enable_thinking or medium_effort) keep the untyped 400: they are not two effort fields.
      • A shadowed unknown top-level name is still treated unevenly. Qwen, Gemma 4, GPT-OSS, DiffusionGemma and Lightning serve it (the nested effort wins), while GLM, MiMo and Flint refuse it typed.
  • N3: non-owned Flash-Next builds. Left as a follow-up (Limitations).

  • N4: this body, refreshed.

The coordinator's mapping (darkbloom-platform master d7de2162f, 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 then master maps the same way, with these differences:

  • Qwen (firstparty/chattemplate/qwen3_5.go qwenPoolEffort): the first-party pool sends high as xhigh, the same. The differences:

    • the pool declines minimal, max and " low ", so the request falls to Macs, which now render low, xhigh and low;
    • the prompt sidecar (promptsidecar/src/normalize.rs) refuses Flash-Next efforts other than low/medium/xhigh, and its Qwen 3.8 render raises for high. So cache planning goes cold for those requests: cold, never a mismatched plan.
  • GLM-5.3-Flash (glm5_next.go readEffort, 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 (Super minimal/low/xhigh/max, MiMo's positive efforts, DiffusionGemma max). 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.go SanitizeProviderError), so a network client still reads 400 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.json goes from 25 to 28 cases:

    • Flash-Next high, minimal and " low " now render a level, and max → xhigh;
    • turbo is refused;
    • Qwen 3.8 raw max → xhigh.

    The platform's promptsidecar/tests/cache_prompt_parity.rs and chattemplate/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)

Test plan

Red first (191e9d02f6, on dev 680a2fb), 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 on dev:
    • Qwen 3.8 and Flash-Next refuse high/max/minimal, DiffusionGemma max, MiMo its positive efforts, Flint max, Super low;
    • Qwen 3.5, Bonsai, Gemma 4, GPT-OSS and Lightning render turbo.
  • ReasoningEffortLocalAPITests: 2 tests, 72 issues on dev. One Mac and the pair leader (the parity harness's real DistributedLocalServer) answer reasoning_effort=max stream=true with 400 {"error":{"message":"Invalid inference request.","type":"invalid_request_error"}}, exactly B-J2-1, and turbo gets no code or field.
  • The independent review reproduced both counts on today's 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 (with dev 28ddc01605), 36 focused filters, 353 tests, 0 failures, 1 skipped:

  • ReasoningEffortValuesTests 10, including the new nemotronSuperRefusesTwoDifferentEfforts;
  • ReasoningEffortLocalAPITests 3, including the new Super test;
  • Qwen4ReasoningEffortValidationTests 8, whose coordinator classification (400, invalid_request, client_error) now runs for both typed effort errors;
  • InferenceRefusalLoggingTests/promptRefusalReasonsComeFromTheTypedError;
  • NemotronSuperPromptContractTests 15, NemotronSuperOpenRouterCapabilityTests 4, CachePromptParityTests 3, GLM5NextPromptPolicyTests 36, FlintPolicyTests 10, FlintTemplateReplayTests 5;
  • DiffusionGemmaReasoningControlTests 5, DiffusionGemmaReasoningEmissionTests 5;
  • MiMoV26TemplateFixTests 19, and MiMoV26PromptContractTests 5 and MiMoV26ConsumerParityTests 11 (1 skipped), run with the pinned public MiMo metadata;
  • Qwen4ReasoningControlTests 3, Qwen4SupportPolicyTests 11, Qwen35TemplateFixesTests 19, GPTOSSHarmonyTemplateFixesTests 6;
  • MultiModelBatchSchedulerEngineTests 32, the engine's templateContext tests (9), ToolChoicePromptPolicyTests 18, NativeMediaToolPreparationTests 5, NativeOutputControlRefusalTests 4, ProductionPromptParityTests 1;
  • LocalChatRequestTests 5, LocalContentPartRefusalTests 2, LocalStreamingFailureTests 2, LocalContextWindowTests 10, LocalRouterTests 31, VideoReaderFailureMappingTests 5;
  • ClusterAPIParityTests 7, ClusterSetupProbeRequestTests 3, InboundDecodeTests 32, InboundChatRequestDecodeTests 3, ProviderLoggerPrivacyTests 5.

Also on the merged head: make docs-check (211 files OK), docs-impact-check --base 28ddc01605 (coverage OK), changelog.py check (53 valid) and git diff --check (clean).

CI on d786300d89 (CI (dev) run 42526116613): green.

  • These pass: Build provider test products, Provider Unit Tests shards 1 and 2 (no failed test), Provider Tests, Check the CI plans and Darkbloom sandbox integrity.
  • The new tests ran there and passed, including the live Super HTTP route, which needs Metal.
  • The plan skipped the cluster jobs.
  • The two Vercel failures (d-inference, d-inference-console-ui-dev) appear on every open PR.

Components touched

  • provider-swift (Swift CLI)
  • docs

Protocol / interface changes

  • Yes:
    • The local API's error envelope gains an optional param, omitted when nil, so every other envelope is unchanged. Its code invalid_reasoning_effort covers an unknown effort and, on Super, two that differ (param "reasoning_effort, reasoning.effort").
    • The coordinator wire is unchanged: closed invalid_request, 400, client_error.
    • MultiModelBatchSchedulerEngineError.unsupportedReasoningEffort now carries the field and absorbs unsupportedNativeReasoningEffort. The new .conflictingReasoningEfforts is Super's.
    • The shared native_reasoning_vectors.json changes as above, and the platform follows.

Documentation impact

  • Canonical documentation updated:
    • 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.md and docs/developer/test.md.
    • changelog.d/reasoning-effort-every-value.md.

Limitations

  • Follow-up: community Flash-Next builds can still 500. Qwen4SupportPolicy.ownsEffortTemplate keys on the owned model ID (and the concrete Qwen 3.8 IDs), not on the template.
    • So a non-owned qwen4_exp build, such as a community Qwen3.8-Flash-Next-* a user serves locally, gets its effort as sent.
    • If it ships the official template, high, max and minimal reach that template's raise_exception while thinking: HTTP 500 jinja_template, the provider-fault class. The same happens on dev.
    • The follow-up: key the mapping on the template's SHA-256 rather than the model ID.
  • CPU only here:
    • Suites that touch MLX abort on metal::load_device in the GPU-denying sandbox (the live Super HTTP route, StandaloneServerTests, EngineV2VisionRoutingTests, the rest of InferenceRefusalLoggingTests). CI runs them.
    • No real model or real Mac was run. The gated live suites updated here (NemotronSuperManagedEffortLiveTests, FlintOpenRouterLiveTests) were not run.
  • The Qwen 3.5 template family is mapped by model type.
  • qwen3_vl_moe is 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:

  • One table per family replaces ReasoningEffort.level(in:) over level lists kept in three files.
  • GLM reads an effort in one place, the invariants are stated once atop ReasoningEffort.swift, and the control flow is plainer.
  • The tests only got stronger: everyFamilyTableCoversEveryEffort checks 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.
  • 33 focused suites: 335 tests, 0 failures. CI (dev) green.

The independent review then approved with nits N1–N4, addressed above.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

jonathan308 and others added 4 commits November 7, 2026 23:49
… 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>
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
d-inference Error Error Nov 8, 2026 11:42pm UTC
d-inference-console-ui-dev Error Error Nov 8, 2026 11:42pm UTC
d-inference-landing Ready Ready Preview Nov 8, 2026 11:42pm UTC
darkbloom-status Ready Ready Preview Nov 8, 2026 11:42pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 8, 2026 11:42pm UTC

Request Review

@jonathan308 jonathan308 added area:provider Provider (Rust, runs on Apple Silicon) area:docs Documentation work specific to a component or feature labels Nov 8, 2026
@jonathan308

Copy link
Copy Markdown
Collaborator Author

CI on 698039a (the fix merged with dev 8d545e8): green: Build provider test products (4m12s), Provider Unit Tests shard 1 (6m28s) and shard 2 (17m27s), Provider Tests, Check the CI plans, Darkbloom sandbox integrity. The two Vercel failures (d-inference, d-inference-console-ui-dev) are the console-ui projects, failing the same way on #1906.

All four commits show Verified. Local red/green evidence is in the description.

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
… reasoning effort) into fix/local-models-list-reasoning

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
jonathan308 and others added 4 commits November 8, 2026 13:26
…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>
…d) into fix/reasoning-effort-every-value

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
…ocal-models-list-reasoning

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308
jonathan308 marked this pull request as ready for review November 9, 2026 00:31
@jonathan308
jonathan308 merged commit c8933e6 into dev Nov 9, 2026
19 of 21 checks passed
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)
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

2 failed and 3 active deployments
Preview – d-inference-landing — 7ee9fe7f Deployed Nov 8, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 7ee9fe7f Deployed Nov 8, 2026 by vercel[bot]
Preview – darkbloom-status — 7ee9fe7f Deployed Nov 8, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 7ee9fe7f Deployed Nov 8, 2026 by vercel[bot]
Preview – d-inference — 7ee9fe7f Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation work specific to a component or feature area:provider Provider (Rust, runs on Apple Silicon)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant