32 Commits
Author SHA1 Message Date
Jason 50a9d103d3 chore(presets): refresh preset models to the latest vendor lineups
Move first-party, sponsor and relay presets to current model IDs so a
pasted Key works without editing the model list.

- Claude: opus/sonnet 5 -> 5.5, haiku 4.5 -> 5.5, fable 5 -> 5.1
- GPT: gpt-5.6-sol / gpt-6-sol -> gpt-6.1-sol; add gpt-6-astra/luna
- Gemini 3.6 Flash -> 3.8 Flash, 3.1 Pro preview -> 4 Argon;
  Grok 4.5 -> 4.7; GLM 5.1/5.2 -> 5.3 (+5.3 Flash);
  DeepSeek V4 Flash -> V4.1 Flash; Doubao 2.1 Pro 260628 -> 260915;
  StepFun Step Plan -> step-5-preview; add Kimi K3.1 Pro, Qwen3.8 Max,
  MiniMax M3.1 Flash where the site serves them
- Drop retired models: NVIDIA moonshotai/kimi-k3 (EOL 2026-10-15,
  now kimi-k2.6 without unverified Codex reasoning levels),
  MiMo V2.5 / V2.5 Pro, Claude Sonnet 4.5, MiniMax M2.7 on Tencent
  Token Plan Enterprise Pro
- Relay presets follow each site's own ID spelling and catalog;
  DIT.ai, BuyToken and hao.ai are left as configured from their docs;
  Soshow, SiliconFlow CN, OpenCode Zen and the Ark rolling alias stay
- MoArk Codex keeps the tested Kimi-K2.7-Code; K3.1 Pro and Qwen3.8
  Max stay out of its Codex catalog until their levels are verified

Tests updated to the new IDs; cross-app invariants unchanged.
2026-10-24 22:56:15 +08:00
SaladDay 734c4831dd feat(minimax): add MiniMax-M3.1-Flash to the official MiniMax presets (#8518)
Make MiniMax-M3.1-Flash the default model on the official MiniMax / MiniMax en presets across Claude Code, Claude Desktop, Codex, Hermes, OpenCode, OpenClaw and Pi, keeping MiniMax-M3 selectable, and seed its pricing.

Claude Code keeps M3 in the Opus slot so it stays selectable through the local route. Hermes pins the background title model to M3 (M3.1 cannot turn thinking off) only when the user has not chosen their own title model or route, and releases the pin when no active card declares it.
2026-10-19 16:42:20 +08:00
Richard Zhang bf5f34d016 fix(codex): add vision-capable glm-5.3-flash to Zhipu GLM presets (#7689)
Add a glm-5.3-flash row to both the Zhipu GLM and Zhipu GLM en Codex
presets, declaring ["text", "image"] input, a 1M context and the same
low/high/max reasoning levels (default max) as glm-5.3.

Without this row, users renamed the seeded glm-5.3 row to flash and
inherited its hidden text-only declaration, so Codex rejected image
input. The official Codex models.json on both sites does not list
flash yet; the rows follow the model pages instead (natively
multimodal, 1M context, fully available on the GLM Coding Plan, text
parameters matching GLM-5.3).

Fixes #7688
2026-09-26 11:48:44 +08:00
funkpopo da193d4f7a fix: 更新预设供应商模型与标准定价,清理已下线模型条目 (#7621)
* feat: Add new AI models and update presets

- Introduced new models in piModelCatalog including:
  - DeepSeek V4.1 Flash
  - Step 5 Preview
  - Step 3.7 Flash
  - Claude Opus 5.5
  - Claude Fable 5.1
  - GPT-6 variants (Sol, Luna, Astra)
  - Gemini 3.8 Flash
  - MiMo V2.6 variants (Pro, Flash, Pro UltraSpeed)

- Updated piProviderPresets to include new models and their configurations.
- Enhanced piThinkingProfiles with new response mappings for GPT-6 Astra and other models.
- Adjusted tests to reflect new models and their expected behaviors in PiProviderForm and other configurations.
- Updated reasoning level presets for Xiaomi MiMo models to include new categories.
- Added new test cases for xAI OAuth provider presets to validate new model configurations.

* fix: 保留历史定价并修正供应商预设

* fix: 补回 MiMo Codex 官方系统提示词
2026-09-23 22:32:19 +08:00
Jason 48e572cc87 feat(codex): refresh CN presets from the Responses API audit
- Kimi For Coding: kimi-for-coding now serves K2.8 Preview (up to 1M,
  text+image, low/high/max); the highspeed variant stays at 256K.
- DeepSeek: default to deepseek-flash (V4.1 Flash, text+image) and
  declare deepseek-v4-pro text-only, matching the bundled official
  catalog.
- Add native Responses presets for StepFun API (CN/intl,
  step-3.7-flash), Baidu Qianfan pay-as-you-go (/v2) and iFlytek Astron
  Coding Plan; subscription plans on the same hosts stay on Chat.
- Add hy4-preview to Tencent Hunyuan, and the open-weight
  qwen3.8-2.4t-a95b / qwen3.8-27b to both pay-as-you-go Qwen platforms.
- MiniMax CN moves to api.minimax.cn and BaiLing to api.ant-ling.com.
- Disable Codex web_search on StepFun (function tools only), and
  conservatively on Qianfan and Astron, whose Responses docs document no
  hosted tools. The new hosts stay out of CODEX_NATIVE_RESPONSES_HOSTS
  so Chat plans on the same hosts are never reclassified as native.
- Tencent Enterprise Token Plans stay on Chat: /plan/v3/responses is
  listed, but TokenHub marks Kimi K2.7 Code unsupported and several
  models as server-side Chat conversions, and the catalog levels were
  verified on Chat only.
2026-09-21 21:45:23 +08:00
Jason f874803f27 feat(presets): rename DouBaoSeed preset to localized Volcengine Doubao
Rename the DouBaoSeed provider preset across all seven app preset files
and localize its display name: zh/zh-TW show "火山 豆包AI", en/ja show
"Volcengine Doubao" via the new providerForm.presets.doubaoseed key.

Following the existing Qiniu/Compshare convention, the top-level name
holds the latin fallback (so the preset stays searchable in both
scripts) and the localized name lives in the locale files. OpenCode and
Pi settingsConfig.name, which is written into the client config files,
keeps the ASCII form.

Live-config identifiers are deliberately untouched: the Codex TOML
provider name, the Hermes node key doubao_seed, Pi's providerKey, the
OpenClaw model-ref prefix, partnerPromotionKey and icon.
2026-09-11 16:47:47 +08:00
Jason 5e1292736e feat(codex): refresh aggregator model presets and catalogs 2026-09-11 16:47:47 +08:00
Jason 08984ba591 feat(codex): switch Kimi presets to native Responses direct-connect
Both Kimi open platform (api.moonshot.cn/v1) and Kimi For Coding
(api.kimi.com/coding/v1) now serve /v1/responses natively and their
official Codex guides require wire_api = "responses", so the two presets
move from openai_chat (proxy Responses->Chat conversion, routing takeover
required) to openai_responses (Codex connects directly). Verified against
both endpoints with real keys using the exact Codex 0.153.4 request shape
(include reasoning.encrypted_content, reasoning.summary, hosted web_search,
replayed reasoning items) and with codex exec end-to-end tool loops.

- kimi-k3 becomes the default open-platform model and first catalog row;
  kimi-k2.7-code stays as a second row (it also answers on /v1/responses,
  although the OpenAPI only lists kimi-k3)
- drop codexChatReasoning (Chat-conversion only) from both presets and
  promptCacheRouting from Kimi For Coding (Codex sends prompt_cache_key
  itself on the native path; the proxy auto-detects the host anyway)
- declare supportsParallelToolCalls on every Kimi row, mirroring the
  official Kimi Code models.json
- no reasoning default is declared: config.toml model_reasoning_effort
  wins over the catalog default, which only marks the /model picker
- move the two presets from the Chat list to the native list in the
  preset tests; invert the prompt-cache-routing assertion
- refresh the user manual (zh/en/ja) so the "Chat-only" examples name
  providers that still use Chat routing, and correct the stale
  userAgentPresets note about Kimi Code rejecting codex-cli

No backend change. Existing Kimi cards keep their stored openai_chat
format and continue to work through routing; switch a card's upstream
format to Responses (or re-add the preset) to connect directly.
2026-09-11 16:47:46 +08:00
shigz 2f3c026242 feat(presets): rebrand DashScope as 千问AI平台 and refresh Qwen models (#7183)
Rename the domestic Bailian presets to 千问AI平台 with a dedicated icon, refresh the Qwen family to the 3.8 generation across Claude Code, Claude Desktop, Codex, Hermes, OpenClaw, OpenCode and Pi, add the domestic Token Plan presets, restore the international QwenCloud Coding Plan presets, and align OpenClaw/OpenCode/Pi model metadata with the official client docs.
2026-09-10 15:59:38 +08:00
Jack ThomasandJason e47b5fca15 fix(codex): point Zhipu GLM presets at the official Responses endpoint (#6957)
Zhipu documents three separate base URLs per site (Anthropic /api/anthropic,
Chat /api/coding/paas/v4, Responses /api/v1) and warns that the wrong one
cannot use Coding Plan quota. Codex direct-connect speaks Responses, so the
presets must target /api/v1; the 400 in #6944 (`unknown variant custom`)
came from the Chat endpoint's strict legacy gateway.

- Switch the Zhipu GLM / Zhipu GLM en presets to apiFormat openai_responses
  (NativeResponses catalog: shell_command edits, no freeform apply_patch)
- Point base_url/endpointCandidates at /api/v1 and mirror the official
  models.json: glm-5.3 (1M context, low/high/max, default max) plus
  glm-5-turbo on the CN site; drop glm-5.2 and the `none` level
- Host fallback: rows saved with a stale openai_chat apiFormat but a native
  Responses base_url get the NativeResponses catalog without a re-save;
  Chat-endpoint paths (/paas/v4, /chat/completions) are excluded
- Match vendor hosts on DNS label boundaries via a shared helper, so `z.ai`
  no longer captures xyz.ai; add bigmodel.cn / z.ai and the glm prefix to
  the Codex web_search reject list

Existing Zhipu providers still point at the Chat endpoint; re-import the
preset to pick up /api/v1.

Fixes #6944

Co-authored-by: Jason <farion1231@gmail.com>
2026-09-04 12:50:28 +08:00
zayokaandClaude Fable 5 d01eab979e fix(codex): route OpenCode Zen reasoning effort through the platform config (#6123)
* fix(codex): route OpenCode Zen reasoning effort through the platform config

Zen 网关的合法 reasoning_effort 档位是逐模型的(models.dev
reasoning_options:glm-5.2 仅 high|max、deepseek-v4-flash 为
low|high|max、kimi-k3 仅 max,glm-5.1 等为 toggle 型无 effort),
opencode 客户端也严格按模型声明发值。此前统一并集映射会把 Codex
默认的 medium 发给只声明 high|max 的 glm-5.2(默认路径必现),
也会把 low 发给不支持 low 的 deepseek-v4-pro(回归)。

- infer_aggregator_platform_config 新增 opencode.ai 平台条目(仅按
  name+base_url 判定,不看模型名),zen 模式:顶层 reasoning_effort
  + reasoning_content,不发厂商原生 thinking 形状
- CodexChatReasoningConfig 新增运行时字段 effort_levels(#[serde(skip)]
  不持久化);resolve 末端对 zen 模式按请求模型从供应商
  settings_config.modelCatalog 的 reasoningLevels(复用 #6228 引入的
  逐模型声明,camelCase/snake_case 双格式兼容)查表附上,查不到则
  None —— 转换层完全不发 reasoning_effort
- transform_codex_chat 的 zen 映射改为逐模型钳制:取「不小于请求的
  最近合法档」,超出最高档取最高档;请求值无法识别则丢弃字段
- OpenCode Go 预设按 models.dev 补上逐模型 reasoningLevels 表;
  表单加载侧提取纯函数 mapCodexCatalogModelForForm 并保住
  reasoningLevels 的 load→save 回环(含 snake_case 旧数据),保存侧
  trim 档位值

存量供应商不会自动获得档位表(其 settings_config 无 reasoningLevels),
行为退化为不发 effort 字段(与改动前一致的安全默认);重新添加一次
OpenCode Go 预设即可获得逐模型表。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(codex): move OpenCode Go to filled entries in reasoning-level expectations

上游 #6228 的 deliberately-unfilled 清单把 OpenCode Go 整体列为不填,
依据是「无 codexChatReasoning 声明、逐模型语义未经网关验证」——两个
前提均被本 PR 改变:预设已补 codexChatReasoning(effortValueMode:"zen"),
且逐模型档位有据(opencode 客户端 variants() 严格按 models.dev
reasoning_options 发值)。glm-5.2 / deepseek-v4-pro / deepseek-v4-flash
移入 EXPECTED(不填 none:effort 档位非思考开关);glm-5.1(toggle 型)、
kimi-k2.7-code(官方标注不支持 effort)、mimo-v2.5-pro(models.dev 未
收录)保持不填并更新注释依据。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 18:59:09 +08:00
Jason 4080a8e95c feat(presets): add Baidu Qianfan Token Plan preset across six apps
Token Plan (personal) replaced Coding Plan for new purchases on
2026-07-13; existing Coding Plan presets stay untouched since active
subscriptions remain valid until expiry.

- claude/claude-desktop: /anthropic/tokenplan/personal, all roles on
  deepseek-v4-pro per the official Claude Code integration guide
- codex: /v2/tokenplan/personal via openai_chat local routing with a
  six-model catalog; first Qianfan preset with supportsEffort enabled
  (no alias indirection anymore, and the default model is on the
  official reasoning_effort support list) using effortValueMode
  "deepseek", which matches Qianfan's own low/medium->high,
  xhigh->max compatibility mapping verbatim; deepseek models omit
  defaultReasoningLevel so the fallback (max) matches the platform's
  automatic max for agent requests
- opencode/hermes: full six-model lineup on the OpenAI-compatible
  endpoint per the official integration guides
- openclaw: model entry mirrors the official OpenClaw guide verbatim
  (context 98304 is the vendor's OpenClaw-specific figure, not the
  platform model list's 1M)

ernie-5.1 is excluded (official retirement on 8/20). New test locks
endpoints, lineups and OpenClaw figures across five apps; codex is
covered by the existing chat preset and reasoning level tests.
2026-08-16 10:51:29 +08:00
Jason af06356d53 feat(presets): enable reasoning effort for Kimi per vendor's own guide
2026-08-15 audit, Kimi group. Both Kimi presets declared
supportsEffort:false, yet Moonshot's two official Codex integration
guides - which use CC Switch as their worked example - explicitly
instruct users to enable both "支持思考模式" and "支持推理强度/思考
等级". The missing piece was the top-level reasoning_effort string
(low/high/max), the only reasoning control the K3 family supports.

Open Platform preset (api.moonshot.cn/v1):
- supportsEffort:true + effortParam reasoning_effort; effortValueMode
  stays unset (passthrough - the deepseek map would crush low to high)
- kimi-k3: low/high/max. No explicit default: the template default
  medium is outside the subset so the backend falls back to the highest
  tier, max, which is exactly the vendor default
- kimi-k2.7-code: single-tier ["high"] (always-thinking, effort
  documented as unsupported - single tier avoids the template's fake
  differentiated tiers, LongCat precedent)

Kimi For Coding preset (api.kimi.com/coding/v1):
- same declaration change; catalog extended with the full official
  model table: kimi-for-coding-highspeed (262144), k3 (1048576),
  k3-256k (262144)
- k3/k3-256k: low/high/max with explicit defaultReasoningLevel high -
  first use of an explicit default: the vendor default (high) differs
  from the fallback (max), and max would silently burn more tokens
- no none tier anywhere: k2.7/k3 cannot disable thinking, and on the
  Kimi Code gateway disabling reroutes requests to K2.6 (different
  model, different billing). Gateway effort whitelist rejects unknown
  values with 400 (minimal is not in it); the declared subsets keep the
  picker inside the whitelist

Known doc conflict noted inline: the parameter reference says K3 should
not receive the thinking param while the integration guide enables
thinking mode; production shows no failures, so we follow the guide -
first thing to check if users report Kimi 400s.

Test tuple gains an optional expected-default column.
2026-08-16 10:51:29 +08:00
Jason 9dcd3486f7 feat(presets): real thinking switches for Qianfan and BytePlus Codex
2026-08-15 vendor audit, official-switch group:

- Baidu Qianfan Coding Plan: the v2 Chat API documents top-level
  thinking:{type:enabled/disabled} (same shape as Zhipu) across the
  plan's six main models, and Baidu's own OpenCode integration guide
  sends it on the /v2/coding endpoint. Declaration added (with the
  supportsThinking:true flag that gates the whole injection path) plus
  none/high levels. Known alias caveat noted inline: if the console
  resolves qianfan-code-latest to a non-thinking model the field is
  ignored, not rejected (platform documents unsupported params as
  ignore-not-error).
- BytePlus (ModelArk intl): the "not verified for the intl site"
  comment is obsolete - BytePlus' own Codex guide configures this exact
  coding/v3 endpoint with wire_api="responses". Switched apiFormat to
  openai_responses (aligned with the domestic Volcengine Plan presets,
  one less conversion layer) and pre-filled low/medium/high per the
  official Codex doc, with the glm-5-2 tier-collapse caveat noted.

Test moves BytePlus from the Chat-route list to the native Responses
list; reasoning-level expectations extended for both presets.
2026-08-16 10:51:29 +08:00
Jason 1435223bd8 fix(presets): replace unavailable SiliconFlow/ModelScope catalog models
2026-08-15 vendor audit (official catalogs, cross-checked live):

- SiliconFlow: MiniMax-M2.7 was never listed on either site - users got
  400 "Model does not exist" out of the box. The two sites carry
  different MiniMax lineups and must not mirror each other:
  - .cn -> Pro/MiniMaxAI/MiniMax-M2.5 (catalog contextLen 196608);
    reasoning levels left unset (no official evidence M2.5 thinking can
    be disabled via enable_thinking)
  - .com -> MiniMaxAI/MiniMax-M3 (official 1M window = 1048576);
    reasoningLevels none/high (platform enable_thinking switch is real
    and M3 thinking is documented as disableable)
- ModelScope: bare ZhipuAI/GLM-5.1 id is not in the free API-Inference
  service list (only the BYOK :DashScope variant exists) - replaced
  with ZhipuAI/GLM-5.2 which is on the free community route. Levels
  left unset until field passthrough to the upstream is verified.

Applied across all seven apps carrying these presets (claude,
claude-desktop, codex, hermes, openclaw, opencode, pi), plus the
hardcoded model id in the SiliconFlow platform-inference Rust test and
the context-window test assertions. Bare MiniMax-M2.7 ids (MiniMax's
own official endpoint) are a different platform and intentionally
untouched. Pi catalog key moved to the existing zai/glm-5.2 entry.

Known follow-up: openclaw SiliconFlow cost figures still reflect the
old M2.7 pricing and need a separate re-audit.
2026-08-16 10:51:29 +08:00
Jason 5b8bf1fe4f feat(presets): split Volcengine into Agent Plan and Coding Plan presets
The former 火山Agentplan preset actually pointed at Coding Plan
endpoints (/api/coding[/v3]). Split it into two presets across all six
app preset files:

- 火山 Agent Plan: /api/plan (Anthropic) and /api/plan/v3 (OpenAI),
  with its own activity/agentplan invite link
- 火山 Coding Plan: keeps /api/coding[/v3] and the original
  activity/codingplan invite link

Both plans' OpenAI endpoints are covered by the official Codex docs
(wire_api=responses), so the Coding Plan Codex preset also uses native
Responses. Widen the Volcengine usage detection to
volces.com/api/(plan|coding) in both the frontend pattern and the
backend detect_provider mirror; the quota query already auto-probes
both plans (GetAFPUsage then GetCodingPlanUsage). Split the partner
promo copy into volcengine_agentplan / volcengine_codingplan i18n keys
in all four locales, and pin both presets in the codex native
Responses preset test.
2026-08-13 17:53:01 +08:00
Jason 58dd376dc4 feat(codex): add Tencent Hunyuan TokenHub preset with native Responses
Official TokenHub Codex docs (cloud.tencent.com/document/product/1823/133532)
confirm hy3 speaks the Responses API natively; the mandatory
disable_response_storage=true is already emitted by the config
generator. Models hy3/hy3-preview are text-only with a 256k context
window. Endpoint candidates include the official backup domain, while
the intl site is excluded because API keys are region-scoped.
2026-07-31 19:12:58 +08:00
Jason 56a66eea36 feat(codex): switch Volcengine Agentplan preset to native Responses
Official Codex docs (volcengine.com/docs/82379/2556056, updated
2026-07) confirm the Coding Plan endpoint /api/coding/v3 supports the
Responses API, so the preset no longer needs local route conversion.
BytePlus stays on Chat routing until the international-site docs are
verified. Also document the billing pitfall: the pay-as-you-go /api/v3
endpoint must never appear in plan-subscription endpoint candidates.
2026-07-31 19:12:58 +08:00
Jason 8ae1ce8558 feat(codex): add DeepSeek native Responses support with official catalog mirror
- Switch the DeepSeek preset to openai_responses and align context
  windows with the official catalog (1048576)
- Mirror DeepSeek's official models.json verbatim for native /responses
  providers on deepseek.com hosts, keeping the official GPT-5 harness
  and freeform apply_patch registration self-consistent
- Make catalog spec displayName/contextWindow explicit-only (Option) so
  local defaults no longer clobber official vendor values
2026-07-31 19:12:58 +08:00
Jason f20458229d feat(presets): add Kimi K3 to Kimi open-platform presets
Add kimi-k3 (1M context, 131K max output) to the Kimi provider preset
model lists for Codex, Hermes, OpenClaw, and OpenCode, appended after
kimi-k2.7-code so the catalog-first-row default backfill is unchanged.
The Kimi For Coding plan presets keep the kimi-for-coding endpoint
alias and are intentionally untouched.
2026-07-21 16:39:33 +08:00
Jason a078b4b207 feat(proxy): session-based prompt_cache_key routing for Codex Chat bridge
Codex always sends prompt_cache_key in its Responses requests, but the
Responses -> Chat Completions conversion dropped it, breaking session
cache affinity on upstreams that route by key (e.g. Kimi Coding).

- Re-inject prompt_cache_key after conversion in the forwarder: an
  explicit client key wins, otherwise a client-provided session ID;
  generated per-request UUIDs are never sent upstream.
- Provider-aware gating: "auto" enables only known-compatible upstreams
  (api.openai.com, api.kimi.com/coding) because strict gateways reject
  unknown fields with HTTP 400 (e.g. Fireworks); an advanced
  Auto/Enabled/Disabled override is available on the Codex form in all
  four locales.
- Kimi For Coding preset opts in explicitly.
2026-07-13 16:48:21 +08:00
7a8b956253 Update Longcat presets to LongCat-2.0 (#4838)
* Update Longcat presets to LongCat-2.0

* fix(proxy): classify LongCat-2.0 as text-only for media sanitizer

The Longcat presets now use LongCat-2.0, but the known_text_only_model
allowlist still only matched the retired longcat-flash-chat tail. Without
this, images pasted into a text-only LongCat-2.0 session are forwarded
upstream instead of being replaced with the unsupported-image marker,
causing a hard rejection. Add longcat-2.0 (keeping the retired name for
saved configs) and a regression test.

---------

Co-authored-by: chengzifeng <chengzifeng@meituan.com>
Co-authored-by: Jason <farion1231@gmail.com>
2026-07-04 16:38:35 +08:00
Jason 7f83feb222 fix(presets): use dated Doubao model id and price 6-digit dated models
Volcengine Ark rejects the bare model name doubao-seed-2-1-pro with a 404
("model does not exist or you do not have access to it") even after the
model is activated; the API requires the full dated id
doubao-seed-2-1-pro-260628. Update the Doubao preset model id across all
apps (config default, generated catalog, and OpenClaw namespaced refs).

Pricing lookup only stripped 8-digit (YYYYMMDD) and ISO date suffixes, not
the 6-digit YYMMDD format Volcengine uses (-260628, -250615), so real
Doubao usage never matched the bare-name pricing seed and showed $0 cost.
Extend strip_model_date_suffix to also strip 6-digit YYMMDD (with
month/day validation to avoid eating non-date version suffixes), keeping
the bare-name pricing seed as the canonical identity. This also fixes
pricing for every other Volcengine Doubao model. Add unit and end-to-end
regression tests.
2026-06-29 23:30:58 +08:00
Jason 26f0d221c0 fix(codex): reject web_search for Qwen3-Coder and correct LongCat context window
- Add `qwen3-coder` to the web_search reject model-prefix blacklist so the
  native qwen3-coder-plus direct-connect preset suppresses the built-in tool
  (百炼 rejects it for the coder series), while general Qwen models sharing the
  DashScope host keep web_search enabled. Matched on the model axis, not host.
- Correct LongCat-2.0-Preview context window from 128K to its real 1M
  (1048576), aligning with the MiMo/Qwen 2^20 convention.
- Tighten native Responses preset tests to assert exact model→contextWindow
  catalogs instead of only checking catalog presence.
2026-06-29 23:30:58 +08:00
Jason 15e712e779 feat(codex): support native Responses direct-connect with generated model catalog
Codex providers can now run in two modes per provider:

- Proxy-Chat (route takeover): apiFormat=openai_chat, existing Responses<->Chat conversion. Unchanged.

- Native-Responses (direct): apiFormat=openai_responses, no proxy. cc-switch generates ~/.codex/cc-switch-model-catalog.json so Codex shows the custom models and tools work without the freeform apply_patch (type=custom) tool that native gateways like MiMo reject; editing falls back to shell_command.

Catalog generation is keyed on apiFormat (CodexCatalogToolProfile), decoupled from the takeover toggle, so native providers persist a catalog without enabling local route mapping.

Codex's catalog parser requires base_instructions on every entry; the native template carries a neutral default and per-vendor official text overrides it (MiMo, MiniMax). Synthesized catalogs for Qwen/Doubao/LongCat use the neutral default.

Existing native providers must be re-saved once to regenerate a valid catalog (no DB migration).
2026-06-29 23:30:58 +08:00
Jason f8768c5885 test(codex): sync chat preset snapshot after native Responses migration
Commit 273cc48c migrated 7 CN providers from openai_chat to native
openai_responses and refreshed model ids on the remaining chat-only
providers, but the codexChatProviderPresets snapshot was not updated,
breaking the unit tests on main.

Drop the migrated providers (DouBaoSeed, Bailian, Longcat, MiniMax,
MiniMax en, Xiaomi MiMo x2) from the chat list, sync GLM/StepFun/Ling
model ids, and add a test locking the migrated presets to
openai_responses with no modelCatalog (so the local route-mapping
toggle stays unchecked).
2026-06-26 09:43:33 +08:00
Jason a4eb5f3778 feat(codex): decouple upstream format selector from model-mapping toggle
The Codex provider form tied Chat-format conversion and route takeover (model
mapping) to one toggle, so a provider serving a native Responses API could not
use model mapping without forcing Chat Completions conversion.

- Promote the upstream format (Chat Completions / Responses) to an independent,
  always-visible selector that triggers no sub-menus on its own.
- The local-routing toggle now solely gates the advanced sub-sections: model
  mapping catalog, plus reasoning capability when the format is Chat.
- Persist modelCatalog / codexChatReasoning based on the takeover toggle and
  derive its initial state from saved catalog presence (no new persisted field).
- Refresh codexConfig i18n (zh/en/ja/zh-TW): add upstreamFormat* keys and reword
  the routing/advanced hints to reflect the decoupling.
- Fix codexChatProviderPresets test expectation for the Doubao Seed 2.1 Pro rename.
2026-06-26 09:15:51 +08:00
Jason 3bb17434fb test: align preset tests with Kimi K2.7 and Fable model tiers
Update the Codex chat preset test's Kimi expectation (kimi-k2.6 -> kimi-k2.7-code) after the Kimi K2.7 upgrade, update the Claude Desktop form test for the four-tier (Sonnet/Opus/Fable/Haiku) routes, and reformat UsageDateRangePicker imports (prettier).
2026-06-13 23:16:11 +08:00
makoMakoGoandJason e891f5c876 [codex] fix Zhipu coding plan presets (#3524)
* fix(presets): update Zhipu coding plan endpoints

* fix(model-fetch): probe /models on versioned /vN base URLs

The model-list probe assumed any base URL not ending in /v1 needs /v1/models appended. For providers whose base URL already ends in a version segment like /v4 (Zhipu/Z.AI GLM Coding Plan at .../api/coding/paas/v4), this produced .../v4/v1/models which 404s, so the "Fetch models" button always failed.

Detect a trailing /v{N} version segment and probe {base}/models first, keeping /v1/models as a fallback candidate for non-/v1 versions. Fixes Codex/OpenCode/OpenClaw/Hermes GLM presets and any other vN-style endpoint, with no behavior change for /v1 or non-versioned URLs.

---------

Co-authored-by: Jason <farion1231@gmail.com>
2026-06-03 15:53:57 +08:00
Jason 3a15420770 Update default models and pricing across presets
Bump default model names project-wide: gpt-5.4 -> gpt-5.5,
gemini-3.x -> gemini-3.5-flash, glm-5 -> glm-5.1, and
grok-code-fast-1 -> grok-build-0.1 across all provider presets
(claude, codex, gemini, hermes, openclaw, opencode, universal),
Gemini config, and stream check defaults.

Pricing:
- Seed gemini-3.5-flash, gemini-3.1-flash-lite, step-3.5-flash-2603,
  doubao-seed-2.0-code, mimo-v2.5(/pro), qwen3-coder-480b, grok-build-0.1.
- Correct deepseek-v4-flash/pro, glm-5/5.1, grok pricing.
- Add repair_current_model_pricing: idempotent pass that fixes only
  rows still equal to the outdated built-in values, preserving any
  user-customized prices (seed uses INSERT OR IGNORE and cannot update
  existing rows).

Fixes from review:
- opencode: drop duplicate gemini-3.5-flash variant (unreachable via
  .find), keep the entry with the full minimal/low/medium/high set.
- Align stale display names/costs to gemini-3.5-flash (hermes, openclaw,
  opencode); openclaw cost -> {1.5, 9, 0.15} to match seed.
- i18n (zh/en/ja/zh-TW): refresh OMO category tooltips for new model
  names; fix writing tooltip to Kimi K2.5 to match its recommended.

Update tests accordingly and add a regression test asserting unique
model ids in the Google opencode preset variants.
2026-05-29 22:52:25 +08:00
Jason 279b9eabde test: align stale tests with merged Codex preset and bucket changes
CI on main was red because two tests did not follow intentional changes
that were already merged into the codebase:

- codexChatProviderPresets.test.ts still expected the "Kimi For Coding"
  preset, which was removed in 16c3ef3f. Drop the corresponding entry
  from the expected presets map.
- import_export_sync.rs still asserted the legacy per-provider
  model_provider id ("rightcode"), but 9fac15b8 unified Codex
  third-party providers into the stable "custom" history bucket. Mirror
  the assertion update already applied to provider_service.rs.

No production code changed; both fixes only update test expectations.
2026-05-25 22:20:34 +08:00
Jason f2935a3db9 feat: add Chat Completions routing for 22 Codex third-party presets
Enable openai_chat routing with explicit model catalogs across the major
Chinese/Asian providers (DeepSeek, Zhipu GLM, Kimi, MiniMax, Baidu Qianfan,
Bailian, StepFun, Volcengine Agent Plan, BytePlus, DouBaoSeed, ModelScope,
Longcat, BaiLing, Xiaomi MiMo, SiliconFlow, Novita AI, Nvidia, etc.). Each
preset declares its context window so the UI can size catalog rows when the
preset is picked.

Also lands two consistency fixes uncovered along the way:
- Include setCodexCatalogModels in resetCodexConfig's useCallback deps to
  match the new third parameter it consumes.
- Realign TheRouter Codex test to the "custom" model_provider bucket
  established by the recent third-party unification; the previous assertion
  predated that refactor and had been failing on HEAD.
2026-05-25 22:20:33 +08:00