Skip to content

fix(kimi-web, qwen-web): align model catalog with live /models + map scenario per model - #5915

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.44from
janeza2:fix/kimi-web-models-and-qwen-alias
Jul 3, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.44from
janeza2:fix/kimi-web-models-and-qwen-alias

Conversation

@janeza2

@janeza2 janeza2 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Two follow-up fixes to the qwen-web / kimi-web migrations that landed in #5855 / #5858 (now in release/v3.8.43):

  1. kimi-web model catalog was guessed, not verified. The original migration shipped { kimi-default, kimi-k2.6, kimi-128k } — none of those ids exist in www.kimi.com's real /apiv2/kimi.gateway.config.v1.ConfigService/GetAvailableModels response. Likewise scenario was pinned to SCENARIO_K2D5 for every request, so the (never-shipped) thinking variant could never have selected itself.
  2. qwen-web alias shadowed a real model. MODEL_ALIASES had "qwen3-coder-plus": "qwen3.7-max", but qwen3-coder-plus is its own entry in GET /api/v2/models — the alias silently rewrote every coder request to the wrong model.

Evidence — Kimi catalog

Live capture of GetAvailableModels:

{
  "availableModels": [
    { "key": "k2d6",          "displayName": "K2.6 Instant",     "scenario": "SCENARIO_K2D5" },
    { "key": "k2d6-thinking", "displayName": "K2.6 Thinking",    "scenario": "SCENARIO_K2D5", "thinking": true },
    { "key": "k2d6-agent",    "displayName": "K2.6 Agent",       "scenario": "SCENARIO_OK_COMPUTER" },
    { "key": "k2d6-agent-ultra","displayName": "K2.6 Agent Swarm","scenario": "SCENARIO_OK_COMPUTER" }
  ],
  "defaultScenario": { "scenario": "SCENARIO_K2D5" }
}

Only the two chat-tier variants are exposed. Agent variants are filtered out — they need SCENARIO_OK_COMPUTER plus kimiPlusId / agentMode body fields that this executor doesn't shape; users who need agentic Kimi should use the kimi-coding (api.kimi.com) provider.

Evidence — Qwen catalog

Live capture of https://chat.qwen.ai/api/v2/models (22 entries) includes qwen3-coder-plus as a real id:

{ "id": "qwen3-coder-plus", "name": "Qwen3-Coder", "object": "model", "owned_by": "qwen", ... }

Changes

Commit 1 — kimi-web catalog + scenario + discovery

  • open-sse/config/providers/registry/kimi/web/index.ts — catalog rewritten to [{k2d6, K2.6 Instant}, {k2d6-thinking, K2.6 Thinking, supportsReasoning}]
  • open-sse/executors/kimi-web.ts — new exported resolveModelConfig(modelId) → { scenario, thinking } driven by the catalog truth. buildRequestBody now takes the resolved scenario and threads it into both top-level scenario and message.scenario (SPA sends both). Heuristic regex for thinking is removed; the only override is reasoning_effort: "none".
  • src/app/api/providers/[id]/models/discovery/providerModelsConfig.ts — new kimi-web entry pointing at GetAvailableModels with authHeader: "Authorization" + authPrefix: "Bearer ". Agent variants filtered at parse time.
  • Tests: new resolveModelConfig test cases (k2d6-thinking / k2d6 / unknown fallback); existing execution tests updated from retired kimi-default to real k2d6.

Commit 2 — qwen-web alias fix

  • open-sse/executors/qwen-web.ts — drop "qwen3-coder-plus": "qwen3.7-max" from MODEL_ALIASES (with a comment explaining why). qwen3-coder-flash keeps its alias (not in live catalog).

Test plan

  • npm run typecheck:core — passes (only pre-existing unrelated appConfig.ts errors)
  • ReadLints clean on all changed files (the node:test types + L450+ errors in web-cookie-providers-new.test.ts exist on release/v3.8.43 already)
  • Manual GetAvailableModels capture confirms the new catalog ids and scenario mapping
  • CI test-unit — needs upstream CI to run

Notes

@janeza2
janeza2 requested a review from diegosouzapw as a code owner July 2, 2026 09:45

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the model definitions and configuration for the kimi-web provider, transitioning to the k2d6 model family (k2d6 and k2d6-thinking) and adding dynamic model discovery. It also removes an incorrect alias for qwen3-coder-plus in the qwen-web executor. Feedback suggests defensively validating that availableModels is an array in the model discovery parser to prevent potential runtime crashes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +93 to +97
const list = (data?.availableModels || []) as Array<{
key?: string;
displayName?: string;
thinking?: boolean;
}>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To prevent potential runtime crashes (e.g., TypeError: list.filter is not a function) if the upstream API returns an unexpected response structure where availableModels is not an array, we should defensively validate that it is an array using Array.isArray before processing.

Suggested change
const list = (data?.availableModels || []) as Array<{
key?: string;
displayName?: string;
thinking?: boolean;
}>;
const list = (Array.isArray(data?.availableModels) ? data.availableModels : []) as Array<{
key?: string;
displayName?: string;
thinking?: boolean;
}>;

@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.43 to release/v3.8.44 July 2, 2026 16:18
@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks for the kimi-web/qwen-web catalog work, @janeza2! 🙏 The intent is great, but this PR can't be reviewed/merged in its current shape: it touches ~100 files with +41,904/−11,970 lines — including .github/workflows/*, README.md, CLAUDE.md, AGENTS.md, .env.example, bin/cli/*, and all of the quality baselines (config/quality/file-size-baseline.json, complexity-baseline.json, quality-baseline.json, test-masking-allowlist.json, dependency-allowlist.json). Those baseline/CI/docs changes almost certainly came from a stale base or an accidental rebase, and contributors shouldn't be moving the quality ratchets.

Could you please:

  1. Rebase onto the current release/v3.8.44, and
  2. De-scope to just the kimi-web/qwen-web catalog alignment — the model catalog + scenario mapping files — dropping the CI/README/CLAUDE.md/baseline churn?

Once it's a focused diff (ideally with a test asserting the catalog matches the live /models), we can get it reviewed and in. 🙌

janeza2 added 2 commits July 3, 2026 04:13
Update the kimi-web catalog and request scenario selection to match
www.kimi.com's live GetAvailableModels response.
Keep qwen3-coder-plus as its own model because it is present in the
live Qwen web models catalog.
@janeza2
janeza2 force-pushed the fix/kimi-web-models-and-qwen-alias branch from 7a5df63 to 356948f Compare July 2, 2026 21:14
@janeza2

janeza2 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Updated the branch as requested.

  • Rebuilt the PR branch on top of the current release/v3.8.44 head.
  • De-scoped the diff to the kimi-web/qwen-web catalog alignment only: 6 files, +94/-19.
  • Dropped the unrelated CI/docs/baseline churn from the previous branch history.
  • Kept the catalog/scenario mapping changes plus the focused tests for the Kimi model ids and scenario resolution.

Verification:

  • ReadLints on the changed files: clean
  • git diff --check upstream/release/v3.8.44...fix/kimi-web-models-and-qwen-alias-clean: passed
  • pre-push hooks passed (check:any-budget:t11, check:tracked-artifacts)
  • Local targeted unit test command could not run because this checkout cannot resolve tsx (ERR_MODULE_NOT_FOUND: Cannot find package 'tsx'), so CI should provide the runnable test signal.

@diegosouzapw
diegosouzapw merged commit 8d0ed4f into diegosouzapw:release/v3.8.44 Jul 3, 2026
3 checks passed
@diegosouzapw diegosouzapw mentioned this pull request Jul 4, 2026
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…scenario per model (diegosouzapw#5915)

* fix(kimi-web): align catalog with live models

Update the kimi-web catalog and request scenario selection to match
www.kimi.com's live GetAvailableModels response.

* fix(qwen-web): stop aliasing qwen3-coder-plus

Keep qwen3-coder-plus as its own model because it is present in the
live Qwen web models catalog.
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