Repository navigation
feat(pricing): seed Qwen3.8 Max built-in model pricing - #6053
Merged
Merged
Conversation
Add insert-if-absent row for qwen3.8-max at 2/6 USD per Mtok input/output with 0.20 cache read.
mhy1227
force-pushed
the
feat/pricing-qwen3.8-max
branch
from
August 3, 2026 04:45
73955a3 to
537638e
Compare
Align cache_write with official explicit context-cache rate (125 percent of input). cache_read stays 0.20 (10 percent hit).
farion1231
approved these changes
Aug 3, 2026
farion1231
left a comment
Owner
There was a problem hiding this comment.
Thank you for your contribution!
biociao
added a commit
to biociao/cc-switch
that referenced
this pull request
Aug 3, 2026
* chore: drop accidentally committed debug session archive * fix(hermes): use SOUL.md instead of AGENTS.md for Hermes prompt filename (farion1231#5779) * fix(hermes): use SOUL.md instead of AGENTS.md for Hermes prompt filename * test(hermes): add regression test for SOUL.md prompt filename --------- Co-authored-by: mmm-05610 <maoqh@users.noreply.github.com> Co-authored-by: Jason <farion1231@gmail.com> * fix(claude): align Kimi for Coding presets with real context windows Claude Code caps unknown non-Claude model ids at 200K, so Kimi's Anthropic-protocol presets show the wrong context unless each preset declares CLAUDE_CODE_MAX_CONTEXT_TOKENS / CLAUDE_CODE_AUTO_COMPACT_WINDOW explicitly. This commit brings every Kimi Claude Code preset in line with its actual window so the status bar and compact window match reality. Claude provider presets (src/config/claudeProviderPresets.ts): - Kimi (Moonshot, kimi-k2.7-code): pin 262144 — was missing entirely, causing Claude Code to display 200K instead of the real 256K. - Kimi K3 (Moonshot, kimi-k3): new preset, pin 1048576 (1M). - Kimi For Coding (kimi-for-coding): pin 262144 — was already there. - Kimi K3 (Kimi Code, k3): new preset, pin 1048576 (1M). k3 is the Kimi Code service alias, distinct from kimi-k3 on the Moonshot platform; both presets coexist to cover the two subscription channels. - Kimi K3 256K (Kimi Code, k3-256k): new preset, pin 262144. Half the token cost of k3 within 256K, broader tier availability. - Kimi For Coding HighSpeed (Kimi Code, kimi-for-coding-highspeed): new preset, pin 262144. ~5–6× faster output, ~3× token cost. Live settings pipeline (src-tauri/src/services/provider/live.rs): - is_kimi_for_coding_provider() now matches both api.kimi.com/coding and api.moonshot.cn/anthropic, so apply_kimi_for_coding_context_defaults fires for all six Kimi presets. - Documented accordingly: the 262144 default is the floor; presets that need 1M (k3, kimi-k3) win by providing an explicit env value in settingsConfig, which the existing 'explicit user values always win' branch already routes through. Model IDs and context windows are sourced from https://www.kimi.com/code/docs/kimi-code/models. * feat(claude-science): serve /claude-science/v1/models via proxy to bypass OAuth Claude Science reads ANTHROPIC_BASE_URL and calls /v1/models through the cc-switch proxy. The route was missing (404), so the Science model dropdown showed "Couldn't load the full model list" and Fable never appeared. Register GET /claude-science/v1/models alongside the existing messages route and answer it with model_list_response() from the current claude-science provider, so the model list is served from cc-switch config (no Anthropic OAuth involved) and Fable tier shows up when configured. * fix(proxy): repair orphan tool_use/tool_result pairing for non-official endpoints Strict Anthropic-compatible gateways (e.g. DeepSeek's official /anthropic endpoint with deepseek-v4-flash/v4-pro, MiniMax, Kimi for Coding) reject message histories where an assistant tool_use has no matching tool_result in the immediately following message: "tool_use ids were found without tool_result blocks immediately after: call_00_..." This happens when a turn is interrupted after the tool_use block is persisted, or with DeepSeek V4's parallel tool calls whose results did not all arrive. For non-official endpoints, repair both directions: - orphan tool_use -> inject a synthetic error tool_result into the following user message (creating one when the turn ends at the assistant message); - orphan tool_result -> downgrade to a text block. Matching is count-based rather than set-based so parallel/concurrent tool_uses that share an id (or whose results partially arrived) are each covered by a synthetic result. Properly paired history and official api.anthropic.com traffic pass through untouched. * fix(proxy): count-based orphan tool_use repair for DeepSeek parallel calls DeepSeek's official /anthropic endpoint validates tool_use/tool_result pairing one-for-one and rejects any leftover tool_use with "tool_use ids were found without tool_result blocks immediately after" (seen with deepseek-v4-flash in Claude Science). The kimi/orphan repair matched by HashSet membership, so parallel tool_uses sharing an id — or whose results partially arrived — were treated as answered and no synthetic result was injected. Switch pass 1 to count-based matching and inject one synthetic error tool_result per unanswered tool_use (in emission order). * fix(proxy): improve GitHub Copilot compatibility with modern Claude Code (farion1231#5832) * 修复 Copilot 与新版 Claude Code 的兼容问题 * docs(proxy): correct Copilot placeholder rationale to the real mechanism Claude Code (verified on 2.1.220) does not format-validate ANTHROPIC_API_KEY against sk-ant-*: in headless mode the placeholder is sent upstream as-is. The actual failure mode is the interactive custom-API-key approval prompt, which defaults to "No (recommended)" — following the default ignores the key and lands users in "Not logged in". Also drop the farion1231#3289 citation, which describes a missing-placeholder scenario, not key validation. --------- Co-authored-by: Jason <farion1231@gmail.com> * feat(pricing): seed Qwen3.8 Max built-in model pricing (farion1231#6053) * feat(pricing): seed Qwen3.8 Max built-in model pricing Add insert-if-absent row for qwen3.8-max at 2/6 USD per Mtok input/output with 0.20 cache read. * fix(pricing): set qwen3.8-max cache write to 2.50 Align cache_write with official explicit context-cache rate (125 percent of input). cache_read stays 0.20 (10 percent hit). * fix(pricing): correct qwen3.8-max cache read price --------- Co-authored-by: Jason <farion1231@gmail.com> * fix(claude-desktop): allow aggregate providers (no env/base_url) 聚合供应商的占位 settings_config 是空对象,meta.claudeDesktopMode 默认 Direct,过去会被 validate_direct_provider 用 settings_config.env 校验拦截,触发「缺少 env 配置」错误。 修复: - provider_mode 对聚合供应商恒返回 Proxy(聚合只能在代理模式工作) - validate_provider 对聚合早退放行,与官方供应商一致 - apply_provider_to_paths_inner 对聚合只写 deployment_mode/meta, 不要求 claudeDesktopModelRoutes - 新增 2 个单元测试覆盖上述路径 * fix(claude): gate Moonshot kimi context fallback on the configured model The Moonshot endpoint (api.moonshot.cn/anthropic) now serves both K2.7 (256K) and K3 (1M). The endpoint-only fallback in apply_kimi_for_coding_context_defaults was forcing every Moonshot provider to the 262144 K2.7 default even when ANTHROPIC_MODEL targeted kimi-k3, so existing/custom providers (and any user who edited the model on the original Kimi preset) would still compact at 256K. The new K3 preset only worked around this by explicitly storing the 1M env values. Inspect the configured model slots (ANTHROPIC_MODEL plus the per-tier defaults) on the Moonshot endpoint and pick the K3 1M default when every set slot targets kimi-k3; fall back to 262144 otherwise. The Kimi Code endpoint (api.kimi.com/coding) keeps the 256K default unconditionally — K3 is not served there. Explicit user values still win on either endpoint. Addresses codex P2 review feedback on farion1231#6038. --------- Co-authored-by: mao qinghui <2760376727@qq.com> Co-authored-by: mmm-05610 <maoqh@users.noreply.github.com> Co-authored-by: Jason <farion1231@gmail.com> Co-authored-by: Xu Lei <312251702@qq.com> Co-authored-by: mhy1227 <zsmy1227@outlook.com>
biociao
added a commit
to biociao/cc-switch
that referenced
this pull request
Aug 3, 2026
Moonshot Kimi context-window fallback now follows the configured model (kimi-k3 gets the 1M window instead of the K2.7 256K clamp), and upstream's Qwen3.8 Max built-in pricing (farion1231#6053) is merged in. See CHANGELOG [3.19.1+ciao.5]. Also corrects the version fields, which ciao.4's release-notes commit left at +ciao.3.
Qfbxz
pushed a commit
to Qfbxz/cc-switch
that referenced
this pull request
Aug 12, 2026
Integrates official v3.19.2 (upstream/main @ 413c09e) on top of local customizations. All 4 open PRs (farion1231#5763, farion1231#5764, farion1231#5765, farion1231#5772) remain unmerged upstream; their changes are preserved on this branch. Upstream v3.19.2 highlights: - Codex interleaved-counter usage fix (farion1231#5854) - Six security hardening caps (farion1231#5919) - MCP/Skills panel search & bulk toggles (farion1231#5967) - Per-account Codex OAuth usage in Auth Center (farion1231#4887) - OMO unified config + runtime models (farion1231#6011, farion1231#5522) - Backup batch dump/restore (farion1231#6122), Codex reimport ~3x faster - Copilot compat with new Claude Code (farion1231#5832) - Hermes SOUL.md filename fix (farion1231#5779) - Skill source-dir anchor (farion1231#4153), skills.sh README fix (farion1231#6119) - Qwen3.8 Max built-in pricing (farion1231#6053) No file overlap between upstream changes and local customizations; merge is conflict-free.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qwen3.8-maxonlyTest plan
qwen3.8-max