Skip to content
Source
Sign inSign up
pingdotgg/t3code

Expose reasoning effort for custom Claude models #4194

ClosedIsraelAraujo70(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/4194/headopened View on GitHub

Summary

  • discover reasoning capabilities dynamically for each custom Claude model ID through the Claude Agent SDK
  • build the T3 reasoning selector only from the supportedEffortLevels announced for that selected model
  • avoid assigning high or any other effort by default, and hide the control when no levels are advertised
  • preserve explicit selections such as xhigh end-to-end for Claude-compatible custom models

Why

Claude-compatible gateways can expose Codex/OpenAI models through Claude Code using custom model IDs. Claude Code only announces supportedEffortLevels for a custom model when that model is selected during initialization, so static capabilities would either hide valid reasoning levels or advertise options the model does not support. T3 should respect the model's dynamically discovered reasoning capabilities instead of assuming a fixed capability set.

The custom model IDs are therefore initialized individually through the Claude Agent SDK. The resulting initializationResult().models metadata drives the provider capabilities while preserving the existing generic provider-option UI. The adapter and CLI text generation now reuse the provider’s cached capabilities for runtime validation, so they stay aligned with the levels actually announced by each model. Custom-model probes run sequentially to preserve failure isolation without unbounded subprocess fan-out.

Closes #4192.

Before / After

BeforeAfter
Custom Claude models did not expose their model-specific reasoning capabilities.Each custom Claude model exposes only the reasoning levels announced by Claude Code; models with none do not show a reasoning control, and no effort is selected by default.
Before: no reasoning controlAfter: reasoning effort menu

Testing

  • vp test run apps/server/src/provider/Layers/ProviderRegistry.test.ts apps/server/src/provider/Layers/ClaudeAdapter.test.ts apps/server/src/textGeneration/ClaudeTextGeneration.test.ts (111 tests)
  • vp run --filter t3 typecheck
  • targeted vp lint on the four changed files
  • integrated web verification with custom gpt-5.6-sol Claude model: the Claude SDK advertised Low, Medium, High, Extra High, and Max, the selector initially had no selection, and an explicit Extra High selection worked end-to-end

Note

Medium Risk Increases probe subprocess work and changes effort handling for custom models; behavior is localized to Claude provider paths and covered by new tests, but mis-probes could hide or mislabel reasoning options.

Overview Custom Claude model IDs now get reasoning effort from Claude Code’s per-model SDK metadata instead of static or built-in assumptions.

The capabilities probe runs a lightweight init for each configured custom model (concurrency 2, 25s timeout per probe), merges supportedEffortLevels into provider model capabilities, and feeds that through a cached resolveModelCapabilities hook shared by the adapter, CLI text generation, and provider status. Custom models show a reasoning selector only when levels are advertised; nothing is defaulted when they are not. Explicit selections like xhigh pass through when advertised, and built-in-only mappings (e.g. coercing xhigh to max) no longer apply to custom slugs.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ec95dc64cb6a48db802cca2c7f5cbe5ca9a2c5e0. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Expose reasoning effort options for custom Claude models based on SDK capability probes

  • probeClaudeCapabilities in ClaudeProvider.ts now concurrently initializes the SDK for each custom model, collects advertised supportedEffortLevels, and returns them. Individual probes time out without discarding completed results.
  • getClaudeModelCapabilities and normalizeClaudeCliEffort are extended to use SDK-advertised effort levels for custom models, and xhigh is no longer coerced to max for custom models.
  • makeClaudeAdapter and makeClaudeTextGeneration accept an async resolveModelCapabilities resolver so capability lookups use the per-instance probe cache at runtime.
  • Provider status now surfaces custom models with effort-level selectors in the model selection UI when the SDK advertises them.
Macroscope summarized ec95dc6.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: a9dd7cfb-3beb-4c06-9bfc-1a0d377b94ca

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 89d24938e7

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces new feature behavior - enabling reasoning effort configuration for custom Claude models by probing each model individually and propagating capabilities through multiple layers. The concurrent probing logic and new capability resolution flow represent significant runtime changes that warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Resolved the Codex feedback: removed the default high, discover capabilities from initializationResult().models / supportedEffortLevels per custom model, and added regression coverage proving no --effort is sent when nothing is selected.

    6. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b7cff3567a0de386c2ddcb4d31cd9d36f8d83ab0. Configure [here](https://www.cursor.com/dashboard/bugbot).
    7. Closing in favor of #2829 (orchestration V2).

      #2829 deletes the V1 orchestration layer this PR builds on — apps/server/src/orchestration/**, provider/Layers/*Adapter.ts and provider/Services/** are removed and replaced by apps/server/src/orchestration-v2/**, with the IPC surface renamed to ORCHESTRATION_V2_WS_METHODS. The files this PR touches either no longer exist or are rewritten, so it can't be rebased — it would need reimplementing against the V2 adapters.

      This is not a judgement on the change itself. Several of these are real gaps we still want fixed; the base just moved out from under them.

      Once #2829 merges, please rebase onto main, port the change to the V2 equivalent, and reopen (or open a fresh PR). Ping me and I'll prioritise the review.

    8. juliusmarminge closed this

    9. Also reproduced on T3 Code 0.0.33 with Claude Code 2.1.229 and OpenCodex 2.14.1. The custom gpt-5.6-sol route works, but T3 hides the Reasoning picker, forcing gateway-side defaults or model aliases. Since this implementation was tested through xhigh/max and the change is still wanted, could the V2 port and review be prioritized after #2829 lands?

Sign in to join this conversation.