Skip to content

feat(provider): let custom providers declare reasoning effort levels - #1307

Merged
TheGreatAxios merged 6 commits into
mainfrom
cl-9833-let-custom-openai-compatible-providers-configure-reasoning
Oct 3, 2026
Merged

TheGreatAxios merged 6 commits into
mainfrom
cl-9833-let-custom-openai-compatible-providers-configure-reasoning

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Custom OpenAI-compatible providers explicitly select enabled reasoning levels (none/low/medium/high/xhigh/max) and one enabled default; empty ladders and disabled defaults cannot save.
  • Persisted ladders/defaults govern startup, resume, model switching, local/profile validation, worker role clamping, displayed effort, and cycling. Legacy and protocol-specific providers keep their existing behavior.
  • Toggle focus and hidden-field isolation remain stable. Reasoning and sampling options compose, with current settings overriding stale discovery catalogs so disabled efforts and cleared sampling values cannot leak onto requests.

Verification

  • Full bun run check with all four PRs composed passes: 8,314 tests, zero failures.
  • Failing-then-passing regressions cover custom defaults, empty selections, local/profile pins, role cascading, cycling, toggle focus, and stale settings/catalog precedence.
  • Combined submit → settings reload → source assembly → adapter request verifies context/maxTokens, enabled default, temperature zero, and omission of cleared top-p.
  • Independent review findings are resolved; no live provider API smoke runs.

Fixes CL-9833

@linear-code

linear-code Bot commented Oct 3, 2026

Copy link
Copy Markdown

CL-9833

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review · Comment

Custom OpenAI-compatible providers persist an operator effort ladder and default; Shift+Tab, the prompt label, and the openai-compatible fall-through use that set instead of the family table.

Findings

  • src/config/index.ts:1150 — loadConfig still calls validateEffort(model, local.reasoningEffort, isCodex) with no providerEfforts. A custom ladder that includes none (or any level the family table rejects for that model id) cannot round-trip through .corbits/settings.json: restart throws Invalid reasoningEffort in local settings. The same miss is at src/subagent/agent-fleet.ts:1039, so spawn_agent rejects an inherited custom-only pin against the family table. Pass entry.reasoningEfforts into both calls. Verified: validateEffort("fp-custom-model", "none") is {ok:false} while the same call with ["none","low","high"] is {ok:true}.

  • src/config/inference-sources.ts:191 and src/provider/reasoning-effort.ts:244 — the prompt label resolves defaultReasoningEffort via resolveSessionEffort(..., providerDefault), but the custom source only computes customEffort when configured !== undefined, and cycleReasoningEffort never forwards providerDefault. A fresh session shows the operator default and sends nothing; the first Shift+Tab starts at supported[0], not the picked default. Hydrate session reasoningEffort from resolveSessionEffort at startup (including providerDefault), and pass providerDefault through cycleReasoningEffort.

  • src/tui/runner/wiring.ts:459 — Shift+Tab and the model label read settings.providers[name].reasoningEfforts with no custom-path guard. The second commit closed that leak on the wire for first-class builders; the TUI still honors a hand-edited ladder on Go/Claude/Codex and can cycle onto a level the source will clamp away. Gate the TUI the same way as buildInferenceSourceForRef (only the openai-compatible fall-through).

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

All five initial reasoning findings are resolved: defaults serialize without session pins; the form represents the explicit six-level set and rejects an empty ladder; config/profile and role resolution honor enabled levels; cycling advances from the effective default; toggles keep cursor focus. Further test-first regressions establish current-settings precedence over stale catalogs and complete reasoning/sampling serialization without resurrecting disabled/cleared values. Twelve overlap conflicts are composed without dropping either feature or its tests. Original changed files and follow-ups are reviewed. Full bun run check with all four PRs composed passes: 8,314 tests, zero failures. No remaining actionable findings or live API smoke claims.

@TheGreatAxios
TheGreatAxios merged commit f4dfc0b into main Oct 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant