Skip to content

feat(model-access): let custom backends declare reasoning levels - #171

Merged
akemmanuel merged 1 commit into
akemmanuel:masterfrom
touch2be:feat/custom-backend-reasoning-efforts
Oct 23, 2026
Merged

akemmanuel merged 1 commit into
akemmanuel:masterfrom
touch2be:feat/custom-backend-reasoning-efforts

Conversation

@touch2be

Copy link
Copy Markdown
Collaborator

Problem

When a custom model connection is added in Settings → Providers, the editor only offers a reasoning on/off switch. The data model already supports modelCapabilities[modelId].reasoningEfforts: EditableUpstreamModel has the field, editCustomBackendDraft / buildCustomModelConnection round-trip it, and the host validates it. The composer's ReasoningEffortSelector only shows levels from that list. Because the UI never writes the list, manually added backends can't offer levels like low, medium, xhigh or max.

My use case is a local Anthropic-compatible proxy for Claude models (Meridian). Those models support low … max, but in OpenGUI the only choices were on or off.

Change

  • custom-backend.ts: adds REASONING_EFFORT_OPTIONS (the canonical order of ReasoningEffort) and toggleReasoningEffort(). The helper keeps the selection in that order no matter which order the boxes are clicked.
  • CustomBackendEditor.tsx: when reasoning is on, a checkbox row with all levels appears under the reasoning switch. It reuses the existing reasoningEffort.levels.* labels.
  • i18n: adds providers.reasoningEfforts and providers.reasoningEffortsHelp in en, de and es.
  • Test: covers the ordering helper and that the selected levels end up in modelCapabilities.

No change to how the selection is saved: it uses the existing buildCustomModelConnection path.

Open question for you

On the Anthropic Messages route, #streamAnthropic in packages/harness/src/models/openai-chat.ts doesn't seem to send the selected effort upstream; only the OpenAI Chat route sets reasoning_effort. If that's intended, the levels in this editor mainly matter for OpenAI-compatible routes. If not, I'm happy to follow up with a separate PR. I left it out here to keep this change small.

Checks

  • pnpm run check passes.
  • pnpm vp test src/components/SettingsProviders.test.ts src/lib/__tests__ passes (80 tests).
  • Full pnpm run test: 3 failures, none in files this PR touches. Run alone, shell.test.ts, strip-types-runtime.test.ts and email-change.integration.test.ts pass. openai-responses-websocket.test.ts (TTFT / connection reuse) also fails on unmodified master on my machine.
  • Not checked visually in the running app. If you'd like the layout changed (e.g. a toggle group instead of checkboxes), just say so.

🤖 Generated with Claude Code

Custom model connections already persist `reasoningEfforts`, and the
composer only shows the effort selector when that list is non-empty.
The custom backend editor, however, only exposed a reasoning on/off
switch, so manually added backends could never offer levels such as
low, medium, xhigh or max.

Show a checkbox per reasoning level under the reasoning switch and keep
the selection in canonical order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akemmanuel
akemmanuel merged commit 44b2317 into akemmanuel:master Oct 23, 2026
2 checks passed
@akemmanuel akemmanuel mentioned this pull request Oct 23, 2026
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.

2 participants