Skip to content

fix(engine): warn when requested thinking tier changes - #1661

Merged
mgoldsborough merged 1 commit into
NimbleBrainInc:mainfrom
Coding-Professional:fix/809-thinking-tier-warning
Oct 8, 2026
Merged

mgoldsborough merged 1 commit into
NimbleBrainInc:mainfrom
Coding-Professional:fix/809-thinking-tier-warning

Conversation

@Coding-Professional

Copy link
Copy Markdown
Contributor

Summary

When an operator sets thinkingEffort: "low" for openai:gpt-5.2-pro, the model has no supported tier at or below low. The engine correctly sends no tier and the provider uses its default, but the operator received no warning. Gemini level step-downs had the same visibility gap.

This change warns at the shared pickTier decision when an operator-selected tier is stepped down or dropped. The warning names the requested tier and the tier sent (or provider default), once per model and requested tier. Unknown xAI effort ladders use the same path; measured-empty xAI ladders stay silent because those models are known to expose no effort knob. Regression tests cover all three providers, deduplication, and silent platform/default cases. The config docs describe the behavior.

Related issue

Closes #809

Validation

  • bun test --no-env-file test/unit/engine.test.ts test/unit/catalog.test.ts test/unit/resolve-thinking.test.ts — 221 passed.
  • bun run check, targeted Biome check, bun run docs:build, and git diff --check — passed.
  • All static checks passed locally after temporary Windows path-separator fixes to check:cycles and check:no-raw-console; those workaround edits were reverted. Plain bun run verify stops at those existing Windows path assumptions.
  • The full local unit run stalled, and the integration run ended with 1,153 passed, 5 skipped, 29 failures and 1 error outside the changed engine path. This machine has Bun 1.3.14; the repo pins 1.4.2. CI should provide the definitive full-suite result.

Checklist

  • Linked the resolved issue with a closing keyword.
  • Updated docs/ for the operator-facing warning.
  • Ran bun run verify and the relevant subset; local full-suite limits are documented above.

@Coding-Professional
Coding-Professional requested a review from a team as a code owner October 8, 2026 19:55
Copilot AI balanced review requested due to automatic review settings October 8, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mgoldsborough

Copy link
Copy Markdown
Contributor

QA Review: fix/809-thinking-tier-warning

Scope: 4 files, +105/−19 · reviewed: db81fd38
Risk: LOW
Why this exists: an operator's explicit thinkingEffort that a model doesn't offer is stepped down or dropped with no log line, often toward a deeper and more expensive provider default (#809).

Critical (must fix)

None.

Fix in-PR

None.

Suggestions (optional)

  • r1s1 [src/engine/engine.ts:233, docs/src/content/docs/config/nimblebrain-json.mdx:179] The unknown-xAI-ladder warning covers a state that test/unit/catalog.test.ts:541 already forbids (xaiUnmeasuredReasoningModels() must be empty), and resolveThinking drops overrides for uncatalogued and non-reasoning models before the builder runs. So in a shipped build this branch is defense in depth, not an operator-visible path. [reasoned] The code is harmless. The operator docs sentence about "an xAI model with no measured ladder" describes a case an operator can't hit, so consider dropping it from the docs and keeping it in the pickTier comment.
  • r1s2 [test/unit/engine.test.ts:2297] warnedTierDivergence is process-wide, so the exact-count assertions depend on no earlier test warning for the same (model, tier) key. They pass today because the earlier gpt-5-pro and flash-lite-image cases use source: "platform" or tier medium. Using model/tier keys unique to this test would remove the coupling. [reproduced] The test passes alone (-t "warns once per model") and in the full unit run.

What Looks Good

  • The warning sits at the one shared decision point (pickTier), so OpenAI, Gemini levels and xAI get the same rule without per-provider copies. This matches the shape A dropped or stepped-down thinking tier is silent on both Google and OpenAI #809 asked for.
  • Nothing changes on the wire. pickTier returns the same tier as before in every case, and xAI's off/adaptive paths still send nothing when no ladder exists.
  • A measured-empty xAI ladder (grok-build-0.1) stays silent. So do platform and mode sources. Only an explicit operator choice is reported.
  • The test checks the step-down text (sending "minimal"), the drop text, dedup across effort and enabled modes, and the silent cases through a final total count. Removing either the warning or the size === 0 guard would make it fail.

Body claims

  • ✅ "221 passed" across engine/catalog/resolve-thinking. Reproduced: 221 pass, 0 fail.
  • ✅ Tests cover all three providers, dedup, and the silent platform/default cases.
  • ✅ Full unit suite passes locally: 6558 pass, 0 fail (Bun 1.3.12).
  • ⚠️ CI: Lint & Typecheck pass, but Unit, Integration and docs jobs show skipping on this run, so the full-suite result the body defers to CI hasn't come in yet. Those checks still need to go green before merge.
machine record
{
  "kind": "review", "pr": 1661, "round": 1,
  "reviewed": "db81fd38d4ecdcf9aa4aae49883cc9e81b1a5164", "delta_base": null,
  "risk": "LOW", "stop_gate": "n/a",
  "verdict": "Correct, minimal, matches the issue's shape; no Criticals. Mergeable once required checks run green.",
  "findings": [
    {"id": "r1s1", "bucket": "suggestion", "file": "src/engine/engine.ts", "line": 233,
     "claim": "Unknown-xAI-ladder warning guards a state catalog.test.ts:541 forbids; operator docs describe an unreachable case.",
     "evidence": "reasoned", "receipt": "grep xaiUnmeasuredReasoningModels -> test/unit/catalog.test.ts:541 expects []",
     "preconditions": null, "fix": "drop the xAI-unknown sentence from nimblebrain-json.mdx; keep code", "scope": "peripheral"},
    {"id": "r1s2", "bucket": "suggestion", "file": "test/unit/engine.test.ts", "line": 2297,
     "claim": "Process-wide dedup set couples the new test's exact counts to earlier tests' keys.",
     "evidence": "reproduced", "receipt": "bun test -t 'warns once per model' -> pass; bun test test/unit -> 6558 pass",
     "preconditions": null, "fix": "use model/tier keys unique to this test", "scope": "peripheral"}
  ]
}

@mgoldsborough mgoldsborough added the qa-reviewed QA review completed with no critical issues label Oct 8, 2026
@mgoldsborough

Copy link
Copy Markdown
Contributor

Thanks for the contribution @Coding-Professional

@mgoldsborough
mgoldsborough added this pull request to the merge queue Oct 8, 2026
Merged via the queue into NimbleBrainInc:main with commit 853d462 Oct 8, 2026
9 checks passed
@Coding-Professional

Coding-Professional commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@mgoldsborough Thank you for the opportunity! Glad to contribute. Looking forward to contributing more and building together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa-reviewed QA review completed with no critical issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A dropped or stepped-down thinking tier is silent on both Google and OpenAI

3 participants