Skip to content

fix(accounts): reasoning effort in every account test that can send one - #224

Merged
HTExplicit merged 1 commit into
mainfrom
fix/account-test-reasoning
Oct 2, 2026
Merged

HTExplicit merged 1 commit into
mainfrom
fix/account-test-reasoning

Conversation

@HTExplicit

Copy link
Copy Markdown
Owner

Problem

  1. No reasoning selector on many API-key accounts. The account test dialog shows the effort select only for model rows carrying reasoning_efforts. Only OpenAI rows were ever annotated: a single OpenAI-only loop in openAIAccountTestModels. The resolver had no Anthropic wire, and none of the Claude test payloads carried an effort. In production that covered all 12 Anthropic API-key accounts plus the OAuth account (e.g. 16510).
  2. OpenRouter accounts showed no selector even for gpt-5.5. OpenRouter's /models states reasoning as an object ({mandatory, default_enabled, supported_efforts, default_effort}). Decoding it into *bool stored false, which hid efforts in the test dialog and in the Codex levels for those models.

Change

  • One resolver, one annotation point. Model rows of every platform are annotated in one place (accountTestReasoningRows), and the raw and plan views share it. Levels come from one wire-gated resolver evaluated on the upstream ID the test actually sends (accountTestClaudeUpstreamModel, also used by the tester).
  • Claude (API key, third-party base URL, OAuth, Vertex):
    • levels and default from claude.EffortLevelsForModel / DefaultEffortForModel (Opus 5.5 medium, others high);
    • writes output_config.effort, plus thinking:{type:adaptive} where the family pairs them (not Opus 4.5);
    • drops temperature and sets max_tokens 64000;
    • runs validateClaude55Request like forwarding does.
  • Bedrock: efforts only where InvokeModel keeps output_config.effort, via one predicate shared with PrepareBedrockRequestBodyWithTokens; the effort body goes through that same preparation.
  • Grok and Chat tests:
    • Grok offers efforts only where grokSupportsReasoningEffort holds on the forwarding-canonical ID, and the body goes through normalizeGrokResponsesReasoningEffort;
    • Chat tests apply NormalizeGLMOpenAIReasoningEffort;
    • the effective effort shown to the dialog is read from the final wire body.
  • Upstream metadata: reasoning is decoded as raw JSON. Booleans work as before; the OpenRouter object supplies its efforts (lightest first) and default; any other shape leaves reasoning unknown, never false. Stored snapshots refresh through the existing API-key 24h catalog refresh.
  • Capacity catalog: official rows for claude-opus-5-5 and claude-sonnet-5-5 (1M / 128K, checked 2026-10-02 on platform.claude.com). Advertised values do not change.
  • Unchanged: a test with no effort selected sends exactly the same body as before.

Verification

Run locally:

  • gofmt, go build ./..., and go vet on the changed packages;
  • targeted tests: effort catalog, resolver per wire (Anthropic mapping, OAuth, Bedrock gate, Grok gate, Gemini/CN-anthropic still none), Claude/Bedrock/Grok/GLM wire bodies, handler row annotation, OpenRouter parsing, official catalog integrity.

Not run: real model calls.

🤖 Generated with Claude Code

The test dialog offered a reasoning effort only on OpenAI rows: a single
OpenAI-only loop annotated rows, the resolver had no Anthropic wire, and the
Claude test payloads never carried an effort. Rows of every platform are now
annotated in one place from one wire-gated resolver, and each test path sends
the effort the way production forwarding does:

- Claude (API key, third-party base URL, OAuth, Vertex): output_config.effort,
  adaptive thinking where the family pairs effort with it, no temperature,
  max_tokens 64000, validated like forwarding. Levels and default come from
  the effort catalog for the upstream ID the test actually sends.
- Bedrock: only where InvokeModel keeps output_config.effort (one predicate
  shared with request preparation), body prepared by the production transform.
- Grok: only models whose forwarding keeps the effort; the body goes through
  the same normalisation. Chat tests apply the glm-* effort normalisation.
- The effective effort reported to the dialog is read from the final body.

OpenRouter's catalog states reasoning as an object; decoding it into a bool
stored false and hid efforts (and the Codex levels) for those models. The
object's efforts and default are now read, lightest first; any other shape
leaves reasoning unknown, never false.

Adds the official Claude Opus 5.5 and Sonnet 5.5 capacity rows (1M / 128K,
checked 2026-10-02); advertised values are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HTExplicit
HTExplicit merged commit 6333d4d into main Oct 2, 2026
18 checks passed
@HTExplicit
HTExplicit deleted the fix/account-test-reasoning branch October 2, 2026 10:56
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