Skip to content

fix(providers): use mapped Sonnet model for connection tests - #663

Open
NickyLam wants to merge 1 commit into
op7418:mainfrom
NickyLam:fix/provider-connection-test-model-mapping
Open

fix(providers): use mapped Sonnet model for connection tests#663
NickyLam wants to merge 1 commit into
op7418:mainfrom
NickyLam:fix/provider-connection-test-model-mapping

Conversation

@NickyLam

Copy link
Copy Markdown

Summary

  • Connection tests for third-party Anthropic providers now send the user-mapped Sonnet model when no explicit default model is set, instead of falling back to the catalog alias sonnet.
  • Mapping-only presets no longer seed a hidden modelName from defaultModelId, so that alias cannot override the Sonnet mapping in the test payload.
  • Presets that expose model_names (for example MiMo) still pre-fill the editable model field, preserving #577A behavior.
  • Adds a small pure helper and unit coverage for the resolution order and the dialog wiring.

Root cause

PresetConnectDialog only sent a single modelName on connection test. Create-mode pre-fill wrote preset.defaultModelId (often the catalog alias sonnet) into that field even when the field was not shown. Users who only filled Sonnet mapping therefore still probed with model: "sonnet", while chat could already use the mapped upstream id.

Why not only #575

Open PR #575 also tries to prefer role mappings, but if the hidden default still pre-fills modelName with sonnet, that value wins before mapSonnet. This PR closes that gap with a narrower change and without the 503 classifier expansion.

Verification

  • Node 22 (v22.23.2)
  • npx tsc --noEmit — pass
  • Targeted: provider-connection-test-model, mimo-model-mapping, provider-key-lifecycle, provider-preset144 pass / 0 fail
  • Full unit suite (excluding pre-existing hang in native-timeout-reasons.test.ts): 4507 pass / 11 fail
    • All 11 failures are pre-existing provider-request-shape Anthropic tests polluted by a local default endpoint (ark.cn-beijing.volces.com), unrelated to this patch
  • Prior session browser smoke: intercepted request used the mapped Sonnet model and reported a successful connection

Related

Related: #461

Connection tests previously preferred a hidden preset catalog alias
(for example "sonnet") over the user's mapped Sonnet model, so third-
party Anthropic providers could fail the test while chat still worked.

Resolve the test payload as explicit default → mapped Sonnet → server
fallback, and only pre-fill modelName when the preset exposes the
model_names field (preserving MiMo #577A).

Related: op7418#461
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the op7418's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added area:ui PR/issue 影响面: ui area:tests PR/issue 影响面: tests labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests PR/issue 影响面: tests area:ui PR/issue 影响面: ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant