FN-043: add canonical thinking levels for custom providers

Custom-provider models now expose the full thinking-level selector and faithfully transmit the selected effort.

- Register all canonical thinking levels and preserve provider-specific API dialects.
- Remove the redundant reasoning toggle and update provider status and settings documentation.
- Add dashboard, engine, and provider registration coverage for thinking-level behavior.
- Add a minor changeset for the published CLI package.

Files changed:
 .../fn-043-custom-provider-thinking-levels.md      |  7 ++
 docs/settings-reference.md                         |  2 +
 .../dashboard/app/api/settings/provider-status.ts  |  1 -
 .../app/components/CustomProviderForm.css          |  5 +-
 .../app/components/CustomProviderForm.tsx          | 18 ++---
 .../__tests__/CustomProviderForm.test.tsx          | 35 ++++++---
 ...r-model-routes-custom-provider-thinking.test.ts | 91 ++++++++++++++++++++++
 .../custom-provider-thinking-levels.test.ts        | 49 ++++++++++++
 .../custom-providers-openai-completions.test.ts    |  2 +-
 .../custom-providers-openai-responses.test.ts      |  3 +-
 .../src/__tests__/pi-create-fn-agent.test.ts       | 31 +++++++-
 .../src/__tests__/provider-registration.test.ts    | 20 ++++-
 .../engine/src/auth/custom-provider-registry.ts    | 14 +++-
 packages/engine/src/pi.ts                          |  9 ++-
 14 files changed, 251 insertions(+), 36 deletions(-)

Fusion-Task-Id: FN-043

Fusion-Task-Lineage: fdd3308a-d5bd-4f54-911a-226c2b46a927

Co-authored-by: Fusion <noreply@runfusion.ai>
This commit is contained in:
Fusion Agent
2026-08-19 15:34:45 +00:00
parent a81c9b80d9
commit b1893a63af
14 changed files with 251 additions and 36 deletions

View File

@@ -99,6 +99,8 @@ Fallback thinking-level values are applied at runtime when Fusion swaps from the
Fusion persists one canonical ordered vocabulary: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Saved settings and runtime validation accept every canonical value so a model switch never silently rewrites a user's choice. Model-bound dashboard controls use the optional `supportedThinkingLevels` metadata from `/api/models` when pi documents a model's `thinkingLevelMap`; `null` entries are excluded, string entries are included, and `xhigh`/`max` are opt-in. Rows without capability metadata retain the full canonical fallback, including `max`, rather than guessing from provider or model names.
Custom-provider models are presumed thinking-capable and expose all seven levels by default; no capability checkbox or other configuration is required. Fusion registers these levels with pi as transmissible, while pi owns API-specific `off` translation and up-then-down clamping. Consequently, a global or inherited thinking level that custom providers previously ignored is now sent to the gateway. A strict gateway can reject an unsupported effort; select **Off** for that gateway, which pi translates to its explicit non-reasoning form or omits when the API has no such form.
| `ntfyEnabled` | `boolean` | `false` | Enable ntfy push notifications. |
| `agentClarificationEnabled` | `boolean` | `false` | Legacy default for programmatic Planning Mode session notification eligibility. Dashboard Planning Mode always starts its infinite, user-validated interview with follow-up questions enabled; this setting no longer suppresses questions or creates a final summary. |
| `failureNotificationMode` | `"sticky-only" \| "terminal-only" \| "all"` | `"sticky-only"` | Failure notification behavior. `sticky-only` defers failed-task notifications by `failureNotificationDelayMs` and suppresses transient self-recoveries. `terminal-only` suppresses while auto-retry is still active and only dispatches when `paused === true` or `column === "in-review"` with `status === "failed"`. `all` restores legacy immediate failure notifications. |