docs(release): add v3.19.0 release notes

This commit is contained in:
Jason
2026-07-30 12:01:38 +08:00
parent 6b13d01825
commit 3b9d059343
3 changed files with 1059 additions and 0 deletions
+353
View File
@@ -0,0 +1,353 @@
# CC Switch v3.19.0
> The through-line of this release is **peace of mind**: a concentrated wave of security hardening — Skill installation, `ccswitch://` import confirmations, SQL backup imports, common-config merging, and terminal launching are all tightened, and two of those items are worth a minute of your attention — the Gemini common-config credential leak is fixed and scrubbed automatically after upgrading (**you need to rotate your keys**), and the `ccswitch://` MCP import confirmation could previously fail to show the command it was about to write (**if you have ever opened an import link of unknown origin, it is worth a check**); both are covered under "Upgrade Notes". Alongside them is one major proxy correctness fix — **reading images through the proxy no longer blows up your context** (a single screenshot used to eat 100,000+ tokens, and two or three were enough to jam a Codex session on 400s). The convenience side is just as substantial: **model pricing can be handed over to models.dev to maintain automatically**, usage from Grok CLI's official login mode and the SuperGrok subscription balance finally reach the dashboard, and **in-app updates now go through the `dl.ccswitch.io` mirror** — so upgrading works even when GitHub is hard to reach.
**[中文版 →](v3.19.0-zh.md) | [日本語版 →](v3.19.0-ja.md)**
---
## Highlights: What You Can Do Now
- **Read images through the proxy without blowing up your context**: with Codex's `view_image` or any MCP tool that returns images, the image used to be serialized into tool text and token-counted as plain text (roughly 9,000× inflation); now every conversion bridge restores images to their native format before sending them upstream (files and audio are supported on the two Chat bridges as well). In a real test the same replayed turn dropped from 85k+ tokens to about 12k, with a 99% cache hit rate.
- **Hand model pricing over to models.dev**: the usage panel gains "models.dev Automatic Pricing Sync" (off by default). Once enabled, the prices of the models you selected refresh automatically at startup (at most once every 6 hours); you can pick which models to track from the full catalog, or let it automatically include each vendor's latest commonly used models. From this release on, manual price edits and deletions are recorded in `~/.cc-switch/model-pricing.json`, so they survive a database rebuild.
- **See usage and subscription balance for Grok's official mode**: when Grok CLI signs in with official OAuth it cannot go through the local proxy, so that consumption was previously entirely invisible; now per-turn usage is imported from the session logs and presented in the dashboard as "Grok Build (Session)". Grok Build provider cards in the official category also show the SuperGrok subscription's quota usage and reset time directly.
- **Open `ccswitch://` import links with more confidence**: the confirmation now shows the command, every argument, the URL, and the environment variables in full (credential-shaped values are shown masked), and highlights the values worth a second look — inline shell execution, environment variables that change loading behavior, intranet / metadata addresses; usage-query scripts show their complete code and are **imported disabled by default**.
- **Confirm that your Gemini providers no longer carry somebody else's key**: the common-config shared snippet used to copy credentials such as `GOOGLE_API_KEY` into every Gemini provider that used it; this release closes that path, and the first launch after upgrading performs a one-time scrub automatically. **Any key that ever entered the shared Gemini snippet should be treated as exposed — rotate it before re-entering it** (see "Upgrade Notes").
- **Keep updating the app when GitHub is hard to reach**: the in-app updater queries `https://dl.ccswitch.io/latest.json` (a Cloudflare R2 mirror) first, with GitHub as the fallback; minisign signature verification is unchanged, and the mirror itself is never trusted.
- **Use the latest models straight away when creating a provider**: preset default models are upgraded to Claude Opus 5, GPT-5.6 Sol, and Gemini 3.6 Flash, with matching pricing seeded into the database; already-created providers are left as they are.
- **Import fork-dense Codex usage history faster**: each parent rollout file is parsed only once and shared across all of its fork points, so rebuilding fork-dense history speeds up noticeably, and the import results are byte-identical.
---
## Usage Guides
The new capabilities in this release land mainly in the usage panel and `ccswitch://` deep-link imports. The following docs are worth reading alongside it:
- **[Usage Statistics](../user-manual/en/4-proxy/4.4-usage.md)**: the usage dashboard's data sources and how the statistics are counted. This release adds models.dev automatic pricing sync and usage import for Grok's official mode.
- **[Deep-Link Import (ccswitch://)](../user-manual/en/5-faq/5.3-deeplink.md)**: what each field in the import confirmation means, and the default values of parameters such as `usageEnabled` (from this release on, usage scripts are imported disabled by default, and the docs have been corrected to match).
- **[Security Policy (SECURITY.md)](../../SECURITY.md)**: this release fills in the threat model and reporting scope — which inputs are treated as untrusted and which issues are welcome, at a glance.
---
> [!WARNING]
>
> ## Only Official Channels (Please Read)
>
> CC Switch is a **fully free and open-source** desktop app, and we **do not charge users any fees**. Please only obtain the software through the official channels listed below:
>
> | Channel | Only Official |
> | ------------------ | ------------------------------------------------------------------------------ |
> | Website | **[ccswitch.io](https://ccswitch.io)** |
> | Source | **[github.com/farion1231/cc-switch](https://github.com/farion1231/cc-switch)** |
> | Downloads | **[GitHub Releases](https://github.com/farion1231/cc-switch/releases)** |
> | Author | **[@farion1231](https://github.com/farion1231)** |
> | Report an Imposter | **[GitHub Issues](https://github.com/farion1231/cc-switch/issues)** |
>
> **Any "CC Switch" website or client that asks you for payment, top-ups, or login credentials is fake.** If you have been tricked into paying, stop the transaction immediately and file a report through GitHub Issues.
---
## Overview
CC Switch v3.19.0 is led by a wave of security hardening and one major proxy correctness fix. On the security side ([#5811](https://github.com/farion1231/cc-switch/pull/5811) plus follow-up standalone fixes): installing Skills from a GitHub repository is hardened against zip-slip and path traversal and given archive limits; the Gemini common-config credential leak is closed, and the first launch after upgrading performs a one-time scrub that cleans out keys already leaked into other providers' configs; importing a SQL backup now executes under a SQLite authorizer, and statements that can reach outside the importing database — `ATTACH` among them — are rejected outright; common-config snippet merging no longer follows `__proto__` into the global prototype; external terminal launching switches to POSIX single-quote escaping, so a directory name can never inject a command again; and the `ccswitch://` import confirmation displays the payload in full (credential-shaped values masked) and flags risky values, with usage scripts imported disabled by default. On the proxy side, images in tool results are no longer serialized into tool text but restored as native media on each conversion bridge (files and audio are supported on the two Chat bridges as well) — ending the "one 113 KB screenshot eats 100,000+ tokens, two or three images jam the Codex session on 400s" problem ([#4465](https://github.com/farion1231/cc-switch/issues/4465), [#5663](https://github.com/farion1231/cc-switch/issues/5663)).
Usage statistics gain two new capabilities: **models.dev automatic pricing sync** (opt-in, [#5734](https://github.com/farion1231/cc-switch/pull/5734)), together with persisting manual price edits / deletions to the human-editable `~/.cc-switch/model-pricing.json`; and **usage import for Grok CLI's official OAuth mode** — traffic that cannot go through the local proxy and was previously entirely invisible — plus a SuperGrok subscription quota display on the provider card. Around distribution and experience: in-app updates prefer the Cloudflare R2 mirror at `dl.ccswitch.io` (GitHub as fallback, signature verification unchanged); Codex usage import reuses an already-parsed parent rollout timeline for forked sessions ([#5626](https://github.com/farion1231/cc-switch/pull/5626)); preset default models move up to Claude Opus 5, GPT-5.6 Sol, and Gemini 3.6 Flash; the OpenClaw Kimi For Coding preset's base URL is corrected; and the toolbar app switcher becomes icon-only. This release has **no database schema migration**, so upgrading is lightweight.
**Release date**: 2026-07-30
**Stats**: 38 commits | 132 files changed | +14,926 / -1,415 lines
---
## Added
### models.dev Automatic Pricing Sync
The pricing area of the usage panel gains a "models.dev Automatic Pricing Sync" card, **off by default and enabled manually**: turning it on shows a confirmation explaining that CC Switch will refresh the prices of the selected models from models.dev at startup (at most once every 6 hours), and that **both the built-in price and a hand-set price for a matching model will be overwritten**. The "Select Models" dialog offers the full models.dev catalog (searchable and filterable), plus an "automatically include common models" option covering the recently released models from Claude, GPT, Gemini, Grok, DeepSeek, Qwen, MiMo, LongCat, Kimi, MiniMax, and GLM (at most 6 per family, each individually excludable). The card shows the last sync time and any errors, offers "Sync Now", and can open or reload the local pricing file.
From this release on, manual price edits and deletions are also recorded in `~/.cc-switch/model-pricing.json`, a human-editable file sitting next to the database, and replayed on every startup — hand-set pricing no longer disappears after a database rebuild, and a deleted built-in price finally stays deleted (recorded as a tombstone rather than being re-seeded). Note that the file **starts empty and is deliberately not back-filled from the existing pricing table** (otherwise built-in prices would all be written in as overrides, blocking future built-in price corrections), so edits made before the upgrade still live only in the database — re-save one and it enters the file. When a sync genuinely changes a price, historical usage rows whose cost was **never computed** (zero or missing) are recalculated at the new price — rows that already have a cost keep their original values; a failed fetch or being offline never blocks startup. The models.dev list also filters out non-text and deprecated models (audio / image / video / embedding, and so on), which tidies up the manual price-selection dialog along the way. ([#5734](https://github.com/farion1231/cc-switch/pull/5734))
### Grok Official Mode Usage Finally Reaches the Dashboard
When Grok CLI signs in with official OAuth it cannot be routed through the local proxy — Grok uses an empty config as the mode switch, so there is nowhere to point it at CC Switch — and that consumption was previously entirely invisible in the usage dashboard. CC Switch now imports per-turn usage alongside the regular session-log sync, reading `turn_completed` events from `updates.jsonl` under `~/.grok/sessions` (archived sessions included): cost prefers the exact figure the CLI reports itself, falling back to local pricing when that is missing (the built-in pricing table gains `grok-4.5-build` at $2 input / $6 output / $0.30 cache read, per million tokens). Imported rows are keyed on the upstream per-turn ID, so a rolled-back session cannot cause double counting; a settling window plus a recent-proxy-activity check ensures the same traffic is not counted twice when routed and official modes are mixed. New rows appear in the dashboard under the provider name "Grok Build (Session)", the app filter gains a Grok Build option, and the data-source breakdown gains a "Grok Build Session" entry with its own icon — all four locales included.
### SuperGrok Subscription Quota on Provider Cards
Grok Build providers in the "official" category now show SuperGrok subscription usage directly on the card, alongside the official-subscription footers for Claude Code / Codex / Gemini: CC Switch reads Grok CLI's own OAuth credentials (`~/.grok/auth.json`) and queries grok.com's billing endpoint for the quota window's used percentage and reset time; when the reset interval is recognizable it is labeled "weekly" or "monthly", otherwise it falls into a new "Credits" tier (rendered as the `c` group in the tray usage summary). A transient network failure keeps the previous reading and retries rather than clearing the footer; an expired token prompts you to run `grok login` again. Managed xAI OAuth (SuperGrok) providers in Claude Code, Claude Desktop, and Codex automatically get the same quota display — the data comes from the account bound to that provider, and the usage-script entry is hidden accordingly. Note that whether a Grok Build provider counts as "official" is now decided purely by the `category` field, with no probing of config contents.
### Claude Opus 5 Built-In Pricing
`claude-opus-5` joins the built-in pricing table at $5 input / $25 output, $0.50 cache read / $6.25 cache write (per million tokens), so its usage no longer shows $0. It is seeded insert-if-absent, so edited prices are unaffected (Opus 5 fast mode bills separately and is deliberately left out of the table).
### Preset Catalog Updates
A6API (an aggregation platform that automatically picks the best of several upstreams for the same model) joins the sponsor presets across eight apps; the PackyCode preset gains three backup addresses on the five preset types that support backup endpoints (Claude Code / Claude Desktop / Codex / Gemini CLI / Grok Build), selectable in the endpoint manager and the speed test; the AICoding partner preset returns across seven apps; and sponsor ordering is realigned with the README.
---
## Changed
### Preset Default Models Upgraded: Claude Opus 5, GPT-5.6 Sol, Gemini 3.6 Flash
The built-in presets' default models are all on the current generation now: `claude-opus-5` replaces `claude-opus-4-8` (all three naming forms covered), `gpt-5.6-sol` replaces `gpt-5.5` and bare `gpt-5.6`, and `gemini-3.6-flash` replaces `gemini-3.5-flash`. Every mirrored location was updated in sync — universal / NewAPI defaults, the Codex custom `config.toml` template, recommendation lists, form placeholders, and copy in all four locales; `gemini-3.6-flash` pricing is seeded into the database at the same time ($1.50 / $7.50, $0.15 cache read, per million tokens). The Code0 and Qiniu Gemini presets, still pinned to `gemini-3.1-pro-preview`, are aligned to 3.6 Flash as well — this is a **deliberate tier change**: 3.6 has no Pro version, and 3.5 Pro is still restricted to partner testing. **Defaults only affect newly created providers**; saved providers keep the model they were created with. Claude Desktop's opus route advances to `claude-opus-5`, with `claude-opus-4-8` moving into the compatibility-alias slot, so existing configs still resolve as before.
### In-App Updates Now Go Through the ccswitch.io Mirror
The updater now queries `https://dl.ccswitch.io/latest.json` first — a Cloudflare R2 mirror of the release manifest — with GitHub Releases as the fallback, so checking for and downloading updates no longer depends on GitHub being reachable. The mirror manifest points every platform's download at the same bucket, while the minisign signatures stay exactly as they were: a signature covers file content, not the URL, and every downloaded artifact is still verified against the built-in public key, so **the mirror itself is never trusted**. Publishing is handled by a release-gated sync workflow that only rewrites the root manifest when the tag really is GitHub's `releases/latest`, so the mirror can never push users back to an older version.
### Codex Usage Import: Faster on Forked Sessions
Importing and rebuilding Codex usage statistics no longer re-reads the same parent rollout file once per fork point: each parent `~/.codex/sessions/*.jsonl` is parsed only once into an in-memory token timeline shared by every child session forked from it, and each child's cutoff becomes an in-memory filter instead. The cache is validated by a file identity stamp (modification time, size, plus device/inode on Unix or volume serial number + file ID on Windows), so a parent file that was appended to, rotated, or replaced is re-read rather than served stale. How much faster it gets depends on fork density: fork-dense history sheds a great deal of redundant parsing, while fork-sparse history is essentially unchanged — and in both cases the import results are byte-identical. ([#5626](https://github.com/farion1231/cc-switch/pull/5626))
### Toolbar App Switcher Becomes Icon-Only
The switcher buttons no longer render a text label next to the icon — with the managed apps grown to eight, the labels were already being collapsed by overflow detection almost all the time, so the ResizeObserver-based auto-compaction was removed and only the icons are shown. App names remain in the hover tooltip, and screen readers still reach them through `aria-label`.
### Sponsor Domains and Referral Links Refreshed
Several sponsors migrated domains, and preset addresses, backup endpoints, referral links, and README rows have been updated to match (PackyCode → `www.packyapi.ai`, RightCode → `www.rightapi.ai`, ClaudeAPI → `www.apito.ai`, APINebula → `apinebula.ai`, AICodeMirror → `.ai`, AICoding → `.inc`, AIGoCode → `.app`), along with the removal of two backup endpoints that had gone dead. **Already-created providers keep the old address stored in the database** — to move to the new domain, edit the address by hand or recreate the provider from the refreshed preset.
---
## Fixed
### Reading Images Through the Proxy No Longer Blows Up the Context
When a client read an image through a tool call — Codex's `view_image`, or any MCP tool that returns images — the proxy's protocol conversion serialized the entire image block into the tool message's text, and the upstream token-counted the base64 as plain text: roughly 9,000× inflation, with a 113 KB PNG working out to 100,000+ prompt tokens; Codex replays the whole history every turn, so two or three screenshots were enough to push the session out of the context window and jam it on repeated 400s ([#4465](https://github.com/farion1231/cc-switch/issues/4465), [#5663](https://github.com/farion1231/cc-switch/issues/5663)).
The proxy now lifts media payloads out of tool results and re-sends them in each bridge's native format — **images are covered on every bridge; files and audio apply wherever the target protocol supports them**: the two Chat bridges (Claude→Chat, Codex Responses→Chat) carry images / files / audio, leaving a short marker in the tool message with the media following the tool batch as a synthetic user message; Claude→Responses restores native `input_image`; Codex / GrokBuild→Anthropic rebuilds standard Anthropic image blocks; and Claude→Gemini uses multimodal `functionResponse.parts` on Gemini 3 (`inlineData` on older models), accepting inline base64 images only. Detection covers typed Responses blocks, Anthropic `source` blocks, MCP `data`+`mimeType` results, and whole image data URLs, and sees through arrays and nested `content` wrappers (including JSON-encoded tool output); once an output is judged to contain media, any data URLs and bare base64 left in it are collapsed into placeholders — **bare base64 on its own never triggers media detection**, and ordinary tool output is left exactly as it was. Tool results without media stay byte-identical to before on every bridge, so prompt-cache prefixes are unaffected; the media blocks sent upstream deliberately carry no `cache_control` marker, so strict upstreams such as GLM and Qwen do not reject them. Measured end to end against Kimi K3: the same replayed turn settles at about 12k input tokens with a 99% cache hit rate, where each replay previously had to carry 85k+ of base64 text.
### "Unsupported Image Fallback" Now Sees Images Inside Tool Results
The "unsupported image fallback" setting replaces image blocks with a placeholder marker when a provider is text-only or the upstream rejects images, but it could previously only see images that were still structured blocks — tool-result images already flattened into base64 text were invisible to it, so a text-only upstream simply failed with no way to recover. The media scrubber now symmetrically detects and strips media inside tool output on every path, so both the strip-before-sending route and the retry-after-rejection route can rescue such turns. Because that detection now also reaches into tool results, a regression test pins down that the reactive retry still fires only on genuine modality rejections — a context-length 400 is not mistaken for an image rejection and retried.
### Grok Build Cost Backfill No Longer Overestimates
The routine that backfills missing costs previously treated only Codex and Gemini as providers whose reported input tokens already include cache reads, while Grok Build follows the same convention — so backfilled Grok Build rows were priced on the full input and then charged for the cache read a second time, inflating the cost. The set of cache-inclusive providers is now defined in exactly one place, shared by the route logger, the cost calculator, and the backfill routine, so the three can no longer disagree. Note that rows already touched by the old backfill keep their values — the backfill only handles zero-cost rows and never rewrites an existing positive cost.
### Hand-Edited Config Files No Longer Crash the App or Swallow Your Edits
When `mcp_servers` exists in `~/.codex/config.toml` but is not a table (for example `mcp_servers = "x"`), MCP sync panicked mid-switch — and it happened after both the database and the live config had already been written, leaving a half-applied switch; a non-table value is now warned about and normalized to an empty table, with the same fix in the Codex and GrokBuild writers. The inline-table form (valid TOML) had mirror-image problems: MCP deletion silently did nothing while the UI reported success, and `base_url` edits were written to a level Codex never reads — both handled. An `opencode.json` whose root node or `provider` / `mcp` section is an array or scalar no longer panics; such files are rejected with an error instead of being rebuilt, so your own `model` and `theme` settings are not wiped out. ([#5811](https://github.com/farion1231/cc-switch/pull/5811))
### Proxy Conversion Survives Malformed Upstream Responses
Malformed data from an upstream gateway could previously take down the local proxy outright instead of producing an error: a non-object `message` or `content_block` in an Anthropic SSE stream, and a buffered response body that is a top-level JSON array or scalar (what a gateway that ignores `stream: true` returns), both hit a panicking indexed assignment; the stream now ends with a normal failure event. A malformed `content_block` header is additionally recovered as a text block — merely sanitizing it into an empty object stops the panic but leaves all the following content silently discarded, making the model look like it said nothing — and since the deltas after a bad header are usually intact, the common case now passes through, with a warning logged whenever the substitution happens. ([#5811](https://github.com/farion1231/cc-switch/pull/5811))
### OpenClaw's Kimi For Coding Address Corrected
The OpenClaw preset previously pointed at the general platform endpoint `https://api.kimi.com/v1`, which is not what the Kimi For Coding subscription uses, so coding-plan keys did not work. The address is corrected to `https://api.kimi.com/coding/v1`, with the form placeholder and default value updated to match. **Providers created from the old preset need to be pointed at the new address manually.**
---
## Security Hardening
Of the nine items in this section, **two need action from you**: rotating any key that entered the Gemini common config, and checking the MCP entries you once imported through `ccswitch://` — "Upgrade Notes" spells out how. The rest take effect on upgrade with nothing for you to do.
If you never open `ccswitch://` links sent to you by other people and have never used a shared Gemini common config, these nine items mostly mean "less can go wrong from here on"; if either of those two applies to you, **this release is worth upgrading to first**.
### The Gemini Common Config No Longer Leaks Keys, and Scrubs Automatically After Upgrading
The Gemini common-config extractor previously stripped only `GEMINI_API_KEY` and `GOOGLE_GEMINI_BASE_URL` from the shared snippet and copied every other `env` entry verbatim — but `GOOGLE_API_KEY` is a first-class Gemini credential, so one account's key (along with any other credential-looking entries) was deep-merged into every Gemini provider that used the common config and sent to that provider's base URL, which may well be a third-party relay. The extractor now skips every key that matches a credential pattern (the same matcher set as the Claude extractor), the frontend snippet validator is aligned with it, and a hand edit cannot push one back in either. Because a Gemini snippet is never re-extracted once it exists, the first launch after upgrading also performs a **one-time scrub**: leaked credentials are cleared from the snippet, from every provider they were merged into, and from `~/.gemini/.env` — matched on the key name **plus** an exact value match, so a provider's own same-named key with a different value is not caught up in it — while the env file's formatting and comments are preserved. See "Upgrade Notes" for the scrub's details and caveats. ([#5811](https://github.com/farion1231/cc-switch/pull/5811))
### Skill Repository Installation Hardened: Path Traversal and Archive Limits
Installing or browsing Skills from a GitHub repository could previously write outside the target directory: archive entries were joined onto the destination path without normalization, so a ZIP containing `..` could escape the extraction directory (zip-slip); and repository coordinates were never validated, so a branch name like `../../../releases/download/v1/evil` could redirect the download to an arbitrary release asset — while Skill repositories can be added through an untrusted `ccswitch://` deep link and are enabled by default, so merely opening the Skills panel is enough to trigger a download. Skill `directory` values coming from backup restores, sync snapshots, and "import from app" were likewise joined into paths without validation, so an uninstall could `remove_dir_all` outside the managed directory. Every landing point now validates the directory name, repository owner / name / branch are allowlisted at the single download choke point, extraction has hard limits (10,000 entries, 512 MB written, 128 MB downloaded, 4 KB symlink targets, with self-referential links rejected), and the new error messages ship in all four locales. ([#5811](https://github.com/farion1231/cc-switch/pull/5811))
### Deep-Link Import Confirmation: See Everything, Flag the Risks
The `ccswitch://` MCP import confirmation previously rendered only a single truncated `Command:` line and showed nothing of `args`, `url`, or `env` — a link carrying `command: "sh"` plus `args: ["-c", "curl …|sh"]` and an `LD_PRELOAD` environment variable displayed as nothing more than an innocuous `sh`, yet on confirmation it was written into each app's live MCP file. The confirmation now renders the command, every argument, the URL, and the environment variables line by line, wrapping instead of truncating, so nothing gets clipped out of sight (env values whose key name contains TOKEN / KEY / SECRET / PASSWORD are shown masked, as a prefix plus asterisks). Values worth a second look are highlighted and collected into a warning block: shell interpreters carrying an inline-execution flag (including combined forms such as `bash -lc`, `cmd /C`, and PowerShell's `-Command` abbreviations), environment variables that change process loading behavior (`LD_*`, `DYLD_*`, `NODE_OPTIONS`, `PYTHONPATH`, `PATH`, proxy variables, and so on), and endpoints pointing at loopback / intranet / cloud metadata addresses. Flagging is purely advisory and never blocks an import — a local Ollama endpoint is a perfectly ordinary thing to have. The provider confirmation gets the same treatment, and the "will be written to all specified apps immediately" warning is now shown unconditionally instead of being gated on link-controlled fields.
### Deep-Link Usage Scripts: Disabled by Default, Code Shown Before Use
A usage-query script imported through a deep link is JavaScript that runs every time usage is queried, and it could previously be enabled without you ever having seen the code: the backend treated "code was supplied" as "consent to execute", and the confirmation showed only an enabled / disabled badge, never the script body. Scripts are now **disabled by default** — a link must explicitly carry `usageEnabled=true` to request enabling — and the confirmation shows the entire decoded script in a scrollable, fully wrapped code block, warning that it will be executed once enabled. If decoding fails it falls back to showing the raw payload, so a malformed script cannot masquerade as "no script". The script code is still stored on the provider, and you can enable it manually inside the app after reviewing it.
### URL-Safe Base64 Could Blank the Whole Confirmation Dialog
The two items above fix "the confirmation doesn't show enough"; this one fixes "the confirmation can show nothing at all". The backend accepts four Base64 variants (including RFC 4648 §5's URL-safe alphabet), while the frontend's `atob` only knows the standard alphabet and, when it cannot decode, **returns the input unchanged instead of raising an error** — so for one and the same payload, the backend decodes successfully and imports, while the frontend is left holding a blob of undecodable characters. Usage scripts and system prompts therefore displayed as opaque Base64; **MCP configs were the worst: the `JSON.parse` failure was swallowed by the component, the confirmation rendered "0 servers" with an empty list, and the backend went right on writing the real entries into the live MCP file**. Changing a single `/` to `_` in the payload was enough — the confirmation goes blank, the import still works, and the full display the two items above had just added is defeated along with it.
The frontend decoder now normalizes the URL-safe alphabet before decoding, so what the confirmation shows is always what will be imported; the shared decoder gains unit tests for the first time, containing a precondition self-assertion that the sample really does land on the URL-safe branch rather than happening to be identical in both encodings.
> This defect affects every version since v3.8.0. If you have ever imported MCP servers through a `ccswitch://` link, it is worth a check — see "Upgrade Notes".
### SQL Imports Reject Statements That Reach Outside the Importing Database
Importing a database backup previously validated only the file's header comment and then handed the whole text straight to `execute_batch` — a carefully crafted backup could `ATTACH DATABASE` to create a SQLite file anywhere the user can write, and that side effect happened before the import's own state validation, so the file landed even when the import failed as a whole; WebDAV / S3 sync snapshots go through the same code path. A SQLite authorizer is now installed for the duration of an external batch (and removed the moment it ends, so the app's own schema maintenance is unaffected): `ATTACH` / `DETACH`, `VACUUM`, virtual-table creation (file-backed modules such as csvfile can read and write arbitrary paths), and every action SQLite reports as unknown are all rejected — future new statements fail by default; of the PRAGMAs, only the two the exporter actually writes, `foreign_keys` and `user_version`, are allowed through.
### Prototype Pollution in Common-Config Snippets
The three walkers that apply, remove, and compare common-config snippets all used to follow `__proto__` into the global `Object.prototype`: `JSON.parse('{"__proto__":{…}}')` yields an own enumerable property, so merging wrote attacker-chosen values onto the global prototype — and the `settings` table is overwritten wholesale from the remote during sync, so once a malicious WebDAV / S3 snapshot has landed, opening a provider form once is enough to trigger the merge. All three walkers now skip `__proto__`, `constructor`, and `prototype`; the "common config applied" comparison additionally requires own properties, which incidentally fixes a visible oddity — `{"__proto__":{}}` used to be judged a subset of any config.
### Command Injection Through Directory Names When Launching a Terminal
When resuming a session in an external terminal, the `cd` line previously wrapped the working directory in double quotes and escaped only backslashes and double quotes — but inside double quotes a shell still expands `$(…)`, backticks, and `$VAR`, and this value is the real project path recorded in the CLI's session history, where on macOS a directory name may legitimately contain those characters. Name a folder that way, and clicking "Resume" executes the embedded command in your terminal, with no compromised component involved anywhere. The three launchers that assemble a shell line — Terminal.app, iTerm, and kitty — switch to POSIX single-quote escaping, under which nothing expands at all (the AppleScript quoting layer needed to get through Terminal / iTerm is handled safely too); Ghostty, WezTerm / Kaku, and Alacritty already passed the directory as a separate argument and were safe to begin with.
### GrokBuild Credential Resolution No Longer Substitutes or Inlines Environment Keys
GrokBuild credential extraction previously fell back to the process-level `XAI_API_KEY` when the `env_key` variable named in the config was unset — silently substituting another account's key and sending it to whatever base URL the config pointed at; credentials now come only from an explicit inline `api_key` or from the environment variable that `env_key` names exactly. Deep-link imports no longer resolve environment variables into a plaintext `api_key`; a link carrying only an `env_key` name is rejected with a prompt to add it manually — accepting it as-is would mean the victim's environment key still gets resolved at request time and sent to the address the link declares. Fixed along the way: base URL resolution is decoupled from credential resolution, where previously a missing credential cleared the base URL along with it, so on macOS (where GUI processes do not inherit the shell environment) the address shown in the UI differed from the one actually used, and the usage script's `{{baseUrl}}` expanded to empty. ([#5811](https://github.com/farion1231/cc-switch/pull/5811))
---
## Documentation
### "Using GPT Models in Claude Code" Guide Completed in English and Japanese
The local routing guide that previously existed only in Chinese has now been fully ported to English and Japanese, covering both connection paths end to end: a third-party OpenAI Responses gateway (API key), and a ChatGPT Plus/Pro subscription through Codex device-code OAuth sign-in. Both routing guides were also retitled around "which model" rather than "which client pairs with which" — [Using GPT Models in Claude Code](../guides/claude-codex-routing-guide-en.md) and [Using Claude Models in Codex](../guides/codex-claude-routing-guide-en.md) — and every cross-link (including the v3.18.0 release notes in all three languages) now points at the version in the reader's own language.
### User Manual: Deep-Link `usageEnabled` Default Corrected
The deep-link reference in the three-language user manual previously claimed `usageEnabled` defaults to `true`, when the actual default is `false`, matching the importer. The manual now states the correct default and adds two consequences: the confirmation shows the script's full code before import, and without an explicit `usageEnabled=true` the script is imported disabled and can be enabled inside the app later.
### SECURITY.md: Threat Model and Reporting Scope
`SECURITY.md` gains a bilingual threat model and an explicit in-scope / out-of-scope list, triaging reports by "who controls this input" rather than "which API the value eventually reached": the built-in WebView renderer is declared a trusted component (with four independently verifiable facts and the conditions that would invalidate them); deep-link payloads, WebDAV / S3 restore data, imported files, upstream API responses, and inbound requests to the local proxy are all listed as untrusted inputs, and reports about them are welcome.
---
## Upgrade Notes
### No Database Migration in This Release
v3.19.0 contains no schema migration (the version stays at v16), so it is ready to use straight after upgrading, with no wait for a data rebuild.
### One-Time Gemini Key Scrub (Please Read)
The first launch after upgrading performs a one-time Gemini common-config scrub before the regular config extraction. **Some Gemini providers may afterwards report a missing API key**: entries are deleted by matching a credential-style key name plus an exact value match, and what usually gets removed is another provider's credential that leaked in through the shared snippet (that provider's own original value was already overwritten when the leak happened and cannot be recovered) — but **a same-value key you intentionally reused across several Gemini providers is removed too**. Either way, rotate before re-entering: **any key that ever entered the shared Gemini snippet should be treated as exposed**. The deleted key names and the affected provider ids (never the values) are recorded in the `settings` table under `gemini_common_config_scrub_audit_v1`, which you can use to locate each provider whose key needs filling in again.
### Ever Imported MCP Through a Deep Link? Worth a Check (Please Read)
Before this release, the `ccswitch://` MCP import confirmation could **fail to show what was about to be written**: arguments and environment variables were not rendered at all (`command: "sh"` plus `args: ["-c", …]` displayed as a harmless `sh`), and if the payload was URL-safe Base64 encoded the whole list displayed as "0 servers" — while in both cases the backend went right on writing the entries into each app's live MCP file. Both defects affect **every version since v3.8.0** and are fixed together in this release.
Exploiting this requires you to personally open an attacker-supplied link and click "Import", so the vast majority of users are unaffected. **If you have in fact opened a `ccswitch://` MCP import link from a source you did not fully trust**, it is worth going through the MCP panel entry by entry, or checking `mcpServers` in `~/.claude.json` directly (for Codex, `mcp_servers` in `~/.codex/config.toml`), to confirm there is nothing there you do not recognize — MCP servers are executed as child processes the next time the CLI starts.
### Deep-Link Usage Scripts Are Disabled by Default
A deep link carrying a usage-query script is now imported with the script disabled, unless the link explicitly carries `usageEnabled=true`. Links that relied on automatic enabling (some partners' one-click setup links, for example) will import the script without turning usage queries on — review the code and enable it manually in the provider editor. Usage scripts configured by hand inside the app are unaffected.
### New Default Models Only Affect Newly Created Providers
Saved providers keep the model ID they were created with; using the new models requires editing them by hand. Claude Desktop's opus route advances to `claude-opus-5` and `claude-opus-4-8` moves into the compatibility-alias slot, so existing configs still resolve as before.
### Pricing Seeding and the Local Pricing File
The new pricing rows (`claude-opus-5`, `gemini-3.6-flash`, `grok-4.5-build`) are appended on next launch via insert-if-absent — **seeding never overwrites a price you have edited**. `~/.cc-switch/model-pricing.json` starts empty and records only the manual price edits and deletions made from this release on — earlier edits are not migrated into it; to make them survive a database rebuild, just re-save them once. The models.dev automatic sync stays off until you turn it on; once it is on, it is the one path that overwrites matching prices, built-in and hand-edited alike.
### GrokBuild Implicit Environment-Variable Fallback Removed
GrokBuild providers that relied on the implicit `XAI_API_KEY` environment fallback now need an explicit `api_key` or a correctly named `env_key`.
### Grok Official Mode Usage Is Intentionally Delayed
Grok usage from official mode appears after a delay of roughly ten minutes plus one sync cycle — events settle first and are then checked against proxy-recorded rows to prevent double counting; if routed traffic and official traffic alternate within the window, some official turns are skipped rather than risking a duplicate count. Grok Build rows that the old cost backfill overestimated keep their values — the backfill only handles zero-cost rows and never revises an existing positive cost.
### The Update Mirror Takes Effect from the Next Release
The updater's endpoint list is baked into the app binary, so existing installations still query only GitHub until they upgrade to a version containing this change; from then on the `dl.ccswitch.io` mirror comes first, with GitHub as fallback.
### Sponsor Domain Migrations Do Not Change Existing Providers
Already-created providers keep the old address stored in the database and still point at the old domain. To move to the new domain, edit the provider's address by hand, or recreate it from the refreshed preset.
---
## Risk Notice
### SuperGrok Quota Queries (New in This Release)
The SuperGrok quota display on provider cards reads Grok CLI's own OAuth credentials (`~/.grok/auth.json`) and queries grok.com's billing endpoint — an endpoint that is not publicly documented, and whose response parsing is based on observation of the current format, so this feature may stop working once xAI changes the interface (at which point the card degrades to showing no quota, with nothing else affected). CC Switch neither stores nor modifies these credentials.
### Carried-Over Notices
**xAI Grok OAuth sign-in**: reuses the public OAuth client identity of the official Grok CLI; using it could lead to account restriction or suspension — see the [v3.18.0 release notes](v3.18.0-en.md#risk-notice) for details.
**Codex OAuth reverse proxy**: using a ChatGPT subscription's Codex OAuth through a reverse proxy may violate OpenAI's terms of service. See the [v3.13.0 release notes](v3.13.0-en.md#-risk-notice) for details.
**Third-party provider routing**: when CC Switch's local proxy converts and forwards Codex, Claude Desktop, or Grok Build requests to third-party providers, each provider may have different requirements for billing, compliance, and data retention. Read the target provider's terms before use.
By enabling these features, users accept the related risks. CC Switch is not responsible for account restrictions, warnings, or service suspensions caused by using these features.
---
## Thanks
This release's security hardening came almost entirely from outside — one PR, plus the security reports we received.
### Code Contributions
- [#5811](https://github.com/farion1231/cc-switch/pull/5811): zip-slip and repository-coordinate traversal in Skill installation, the Gemini common-config credential leak and its one-time scrub, GrokBuild credential resolution, and fixes across several panic paths, thanks @zayokami. This is the broadest single body of work in the release.
- [#5734](https://github.com/farion1231/cc-switch/pull/5734): models.dev automatic pricing sync, thanks @YUZHEthefool.
- [#5626](https://github.com/farion1231/cc-switch/pull/5626): faster Codex usage import for forked sessions, thanks @ayanamislover (co-credited with @SaladDay).
### Security Reports
Four of the fixes in this release's "Security Hardening" section came from security reports sent privately. Thanks to **23pds** (SlowMist) and **zues devil** — attributed item by item below:
- **The deep-link import confirmation showed only a single truncated `Command:` line** — `args`, `url`, and `env` were not rendered at all, so an `sh -c` payload with `LD_PRELOAD` looked like nothing but an `sh` in the UI. This is the highest-impact item in the release. (23pds, SlowMist)
- **SQL backup imports were unconstrained** — `ATTACH DATABASE` could create a file anywhere the user can write, and the side effect happened before the import's own validation. (zues devil)
- **Command injection through directory names when launching an external terminal** — the `cd` line was double-quoted, so `$(…)` still expanded, and this value is the real project path recorded in the session history. (Reported independently by zues devil and 23pds, against the built-in launchers and the custom template paths respectively.)
- **Prototype pollution in common-config snippet merging** — all three walkers followed `__proto__` into the global `Object.prototype`. (23pds, SlowMist)
These reports also prompted us to fill in the threat model and reporting scope in [SECURITY.md](../../SECURITY.md) — until then, this project documented only how to report, never what counts as a vulnerability.
The other two deep-link fixes (usage scripts disabled by default, and the URL-safe Base64 bypass) were found while reviewing those fixes themselves, and were not part of the original reports.
### Issue Reports
Thanks to the users who reported proxy image reads blowing up the context in [#4465](https://github.com/farion1231/cc-switch/issues/4465) and [#5663](https://github.com/farion1231/cc-switch/issues/5663) — this release's most important proxy fix came from the reproduction clues in those real-world scenarios.
---
## Download & Install
Visit [Releases](https://github.com/farion1231/cc-switch/releases/latest) and download the build for your system, or get it from the official site [ccswitch.io](https://ccswitch.io) (from this release on, downloads are distributed through Cloudflare edge nodes and no longer depend on GitHub being reachable).
### System Requirements
| System | Minimum Version | Architecture |
| ------- | -------------------- | ----------------------------------- |
| Windows | Windows 10 and later | x64 / ARM64 |
| macOS | macOS 12 (Monterey)+ | Intel (x64) / Apple Silicon (arm64) |
| Linux | See table below | x64 / ARM64 |
### Windows
| File | Description |
| ---------------------------------------- | ------------------------------------------------ |
| `CC-Switch-v3.19.0-Windows.msi` | **Recommended** - MSI installer with auto-update |
| `CC-Switch-v3.19.0-Windows-Portable.zip` | Portable build, unzip and run |
Windows ARM64 devices should pick the artifact whose file name carries the `arm64` tag.
### macOS
| File | Description |
| -------------------------------- | ----------------------------------------------------- |
| `CC-Switch-v3.19.0-macOS.dmg` | **Recommended** - DMG installer, drag to Applications |
| `CC-Switch-v3.19.0-macOS.zip` | Unzip and drag to Applications, Universal Binary |
| `CC-Switch-v3.19.0-macOS.tar.gz` | For Homebrew install and auto-update |
Homebrew install:
```bash
brew install --cask cc-switch
```
Upgrade:
```bash
brew upgrade --cask cc-switch
```
### Linux
Linux assets are available for both **x86_64** and **ARM64** (`aarch64`). Choose the file whose architecture tag matches your machine's `uname -m` output:
- `CC-Switch-v3.19.0-Linux-x86_64.AppImage` / `.deb` / `.rpm`
- `CC-Switch-v3.19.0-Linux-arm64.AppImage` / `.deb` / `.rpm`
| Distribution | Recommended Format | Install Command |
| --------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` or `sudo apt install ./CC-Switch-*.deb` |
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` or `sudo dnf install ./CC-Switch-*.rpm` |
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
| Arch Linux / Manjaro | `.AppImage` | Make executable and run directly, or use AUR |
| Other distributions / unsure | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
+353
View File
@@ -0,0 +1,353 @@
# CC Switch v3.19.0
> 本リリースの主軸は**より安心して使えること**です。集中的なセキュリティ強化——Skill のインストール、`ccswitch://` インポート確認、SQL バックアップのインポート、共通設定のマージ、ターミナル起動をすべて引き締めました。うち 2 点は 1 分ほど確認をお願いします——Gemini 共通設定の API キー漏えいを修正し、アップグレード後に自動でクリーンアップします(**キーのローテーションが必要です**)。そして `ccswitch://` の MCP インポート確認ダイアログは、これまで書き込まれるコマンドを表示できないことがありました(**出所の不明なインポートリンクを開いたことがある場合は、一度確認することをおすすめします**)。どちらも「アップグレード時の注意」を参照してください。プロキシの正確性についても大きな修正があります——**プロキシ経由の画像読み取りでコンテキストが溢れなくなりました**(スクリーンショット 1 枚が 10 万 token 超を消費し、2〜3 枚で Codex のセッションが 400 で固まっていました)。手間を減らす部分も実質的です——**モデル価格を models.dev に自動メンテナンスさせられる**ようになり、Grok CLI 公式ログインモードの使用量と SuperGrok サブスクリプション残量がついにダッシュボードに入り、**アプリ内更新は `dl.ccswitch.io` ミラー経由**になりました——GitHub につながりにくい環境でも問題なくアップグレードできます。
**[English →](v3.19.0-en.md) | [中文版 →](v3.19.0-zh.md)**
---
## ハイライト:本リリースでできること
- **プロキシ下でも画像を普通に読める、コンテキストは溢れない**:Codex の `view_image` や画像を返す MCP ツールでは、これまで画像がツールテキストへシリアライズされ、プレーンテキストとして token 計算されていました(約 9,000 倍の膨張)。現在はすべての変換ブリッジが画像をネイティブ形式へ復元してから送信します(ファイルと音声は 2 本の Chat ブリッジで併せて対応)。実測では同一のリプレイターンが 85k+ token から約 12k へ下がり、キャッシュヒット率は 99% でした。
- **モデル価格を models.dev に自動メンテナンスさせる**:使用量パネルに「models.dev 自動価格同期」を追加しました(既定は無効)。有効にすると、起動時に選択したモデルの価格を自動更新します(6 時間に最大 1 回)。完全なカタログから追跡するモデルを選ぶことも、各社の最新のよく使うモデルを自動的に含めることもできます。手動での価格変更と削除は、本リリースから `~/.cc-switch/model-pricing.json` に記録され、データベースを再構築しても失われません。
- **Grok 公式モードの使用量とサブスクリプション残量が見える**:Grok CLI が公式 OAuth でログインしている場合はローカルプロキシを経由できないため、この分の消費はこれまでまったく見えませんでした。現在はセッションログからターンごとの使用量をインポートし、ダッシュボードに「Grok Build (Session)」として表示します。公式カテゴリの Grok Build プロバイダーのカードには、SuperGrok サブスクリプションのクォータ使用量とリセット時刻も直接表示されます。
- **`ccswitch://` インポートリンクをより安心して開ける**:確認ダイアログはコマンド、各引数、URL、環境変数を余さず表示し(認証情報らしき値はマスク表示)、よく見るべき値をハイライトします——シェルのインライン実行、ロード挙動を変える環境変数、内部ネットワーク / メタデータのアドレスです。使用量照会スクリプトはコード全文を表示し、**既定では無効の状態でインポート**されます。
- **Gemini プロバイダーに他人のキーが混入していないことを確認**:共通設定の共有スニペットは、これまで `GOOGLE_API_KEY` などの認証情報を、それを使うすべての Gemini プロバイダーにコピーしていました。本リリースでこの経路を閉じ、アップグレード後の初回起動で一回限りのクリーンアップを自動実行します。**共有 Gemini スニペットを通過したキーはすべて漏えい済みとみなし、ローテーションしてから入力し直してください**(「アップグレード時の注意」参照)。
- **GitHub につながりにくくてもアプリを更新できる**:アプリ内アップデーターは `https://dl.ccswitch.io/latest.json`Cloudflare R2 ミラー)を優先して照会し、GitHub をフォールバックにします。minisign の署名検証は変わらず、ミラー自体は信頼されません。
- **新規プロバイダーで最新モデルをすぐ使える**:プリセットの既定モデルを Claude Opus 5、GPT-5.6 Sol、Gemini 3.6 Flash にアップグレードし、対応する価格も登録しました。作成済みのプロバイダーはそのままです。
- **fork の多い Codex 使用量履歴をより速くインポート**:親 rollout ファイルは一度だけ解析してすべての fork 地点で共有するようになり、fork の多い履歴の再構築が明らかに高速化します。インポート結果はバイト単位で変わりません。
---
## 利用ガイド
本リリースの新機能は主に使用量パネルと `ccswitch://` ディープリンクインポートにあります。以下のドキュメントもあわせてご覧ください:
- **[使用量統計](../user-manual/ja/4-proxy/4.4-usage.md)**:使用量ダッシュボードのデータソースと集計方法を確認できます。本リリースでは models.dev 自動価格同期と Grok 公式モードの使用量インポートを追加しました。
- **[ディープリンクインポート(ccswitch://](../user-manual/ja/5-faq/5.3-deeplink.md)**:インポート確認ダイアログの各フィールドと、`usageEnabled` などのパラメーターの既定値を説明します(本リリースから使用量スクリプトは既定で無効の状態でインポートされます。ドキュメントも修正済みです)。
- **[セキュリティポリシー(SECURITY.md](../../SECURITY.md)**:本リリースで脅威モデルと報告範囲を整備しました——どの入力を信頼しないか、どのような問題の報告を歓迎するかが一目で分かります。
---
> [!WARNING]
>
> ## 唯一の公式チャネル(必ずお読みください)
>
> CC Switch は**完全に無料・オープンソース**のデスクトップアプリで、**ユーザーから料金を徴収することはありません**。本ソフトウェアは下記の公式チャネルからのみ入手してください:
>
> | チャネル | 唯一の公式 |
> | ------------ | ------------------------------------------------------------------------------ |
> | 公式サイト | **[ccswitch.io](https://ccswitch.io)** |
> | ソースコード | **[github.com/farion1231/cc-switch](https://github.com/farion1231/cc-switch)** |
> | ダウンロード | **[GitHub Releases](https://github.com/farion1231/cc-switch/releases)** |
> | 作者 | **[@farion1231](https://github.com/farion1231)** |
> | 偽サイト通報 | **[GitHub Issues](https://github.com/farion1231/cc-switch/issues)** |
>
> **料金請求・チャージ・認証情報の提供を求める「CC Switch」サイトやクライアントはすべて偽物です。** 支払いを誘導された場合は直ちに操作を中止し、GitHub Issues からご報告ください。
---
## 概要
CC Switch v3.19.0 は、集中的なセキュリティ強化と、プロキシの正確性に関する大きな修正が主役です。セキュリティ側([#5811](https://github.com/farion1231/cc-switch/pull/5811) および後続の個別修正):GitHub リポジトリからの Skill インストールは zip-slip とパストラバーサルを塞ぎ、アーカイブに上限を設けました。Gemini 共通設定のキー漏えい経路を閉じ、アップグレード後の初回起動で一回限りのクリーンアップを自動実行して、既に他プロバイダーの設定へ漏れ出したキーを取り除きます。SQL バックアップのインポートは SQLite authorizer の下で実行するようになり、`ATTACH` などインポート対象データベースの外に触れられる文はすべて拒否します。共通設定スニペットのマージは `__proto__` をたどってグローバルなプロトタイプを汚染しなくなりました。外部ターミナルの起動は POSIX のシングルクォートエスケープに変え、ディレクトリ名からコマンドを注入することはもうできません。`ccswitch://` のインポート確認ダイアログはペイロードを余さず表示し(認証情報らしき値はマスク表示)、リスクのある値をマークします。使用量スクリプトは既定で無効の状態でインポートされます。プロキシ側では、ツール結果に含まれる画像がツールテキストへシリアライズされなくなり、各変換ブリッジでネイティブなメディアとして復元して送信されるようになりました(ファイルと音声は 2 本の Chat ブリッジで併せて対応)——「113 KB のスクリーンショット 1 枚が 10 万 token 超を食い、2〜3 枚で Codex のセッションが 400 で固まる」問題に終止符を打っています([#4465](https://github.com/farion1231/cc-switch/issues/4465)、[#5663](https://github.com/farion1231/cc-switch/issues/5663))。
使用量統計には 2 つの新機能が入りました。**models.dev 自動価格同期**(オプトイン、[#5734](https://github.com/farion1231/cc-switch/pull/5734))と、それに伴う手動の価格変更 / 削除の、人間が編集可能な `~/.cc-switch/model-pricing.json` への永続化。そして **Grok CLI 公式 OAuth モードの使用量インポート**——このトラフィックはローカルプロキシを通せず、これまでまったく見えませんでした——加えてプロバイダーカードでの SuperGrok サブスクリプションクォータの表示です。配信と使い勝手まわりでは、アプリ内更新が `dl.ccswitch.io` の Cloudflare R2 ミラーを優先するようになり(GitHub にフォールバック、署名検証は不変)、Codex 使用量インポートは fork セッションで解析済みの親 rollout タイムラインを再利用し([#5626](https://github.com/farion1231/cc-switch/pull/5626))、プリセットの既定モデルは Claude Opus 5、GPT-5.6 Sol、Gemini 3.6 Flash にアップグレード、OpenClaw の Kimi For Coding プリセットは base URL を修正、ツールバーのアプリ切り替えはアイコンのみになりました。本リリースに**データベースの schema 移行はありません**。アップグレードは軽量です。
**リリース日**: 2026-07-30
**Stats**: 38 commits | 132 files changed | +14,926 / -1,415 lines
---
## 追加機能
### models.dev 自動価格同期
使用量パネルの価格セクションに「models.dev 自動価格同期」カードが加わりました。**既定は無効で、手動での有効化が必要です**。有効にする際には確認の説明が表示されます——CC Switch は起動時に(6 時間に最大 1 回)models.dev から選択したモデルの価格を更新し、**同名モデルの内蔵価格も手動で設定した価格も上書きされます**。「モデルを選択」ダイアログでは models.dev の完全なカタログを検索・絞り込みでき、さらに「よく使うモデルを自動的に含める」オプションもあります。これは Claude、GPT、Gemini、Grok、DeepSeek、Qwen、MiMo、LongCat、Kimi、MiniMax、GLM 各社の最近リリースされたモデル(ファミリーごとに最大 6 個、個別に除外可能)をカバーします。カードには前回の同期時刻とエラーが表示され、「今すぐ同期」を実行でき、ローカルの価格ファイルを開いたり再読み込みしたりもできます。
本リリースから、手動での価格変更と価格削除は、データベースの隣に置かれる人間が編集可能なファイル `~/.cc-switch/model-pricing.json` にも記録され、起動のたびに再適用されます——データベースを再構築しても手動価格が失われなくなり、削除した内蔵価格もようやく削除したままにできます(tombstone として記録され、再シードされません)。なおこのファイルは作成時点では空で、**既存の価格テーブルから遡って書き出すことは意図的にしていません**(そうすると内蔵価格までオーバーライド項目として書き込まれ、将来の内蔵価格の修正を塞いでしまうためです)。アップグレード前に行った価格変更は引き続きデータベースにのみ存在するので、一度保存し直せばファイルに入ります。同期によって実際に価格が変わった場合は、**これまでコストが算出されたことのない**(ゼロまたは欠落の)過去の使用量行を新しい価格で計算し直します——既にコストがある行は元の値のままです。取得に失敗した場合やオフラインの場合でも、起動をブロックすることは決してありません。models.dev のリストからはテキスト以外のモデルと非推奨のモデル(音声 / 画像 / 動画 / embedding など)も除外し、手動で価格を選ぶダイアログもすっきりしました。([#5734](https://github.com/farion1231/cc-switch/pull/5734)
### Grok 公式モードの使用量が、ついにダッシュボードへ
Grok CLI が公式 OAuth でログインしているときはローカルプロキシへルーティングできません——Grok は空の設定をモードスイッチとして使うため、CC Switch を指し示す場所がないのです——そのためこの分の消費は、これまで使用量ダッシュボードでまったく見えませんでした。現在は通常のセッションログ同期に合わせて、`~/.grok/sessions`(アーカイブ済みセッションを含む)の `updates.jsonl` から `turn_completed` イベント単位でターンごとの使用量をインポートします。コストは CLI 自身が報告する正確な数値を優先し、欠落時はローカル価格にフォールバックします(内蔵価格テーブルに `grok-4.5-build` を追加。100 万 token あたり入力 $2 / 出力 $6 / キャッシュ読み取り $0.30)。インポート行は上流のターンごとの ID をキーにするため、巻き戻したセッションで重複計上されることはありません。確定待ちウィンドウには直近のプロキシ活動チェックを加え、「ルーティング + 公式」を併用しても同じトラフィックが二重に計上されないようにしています。ダッシュボードでは新しい行がプロバイダー名「Grok Build (Session)」として表示され、アプリフィルターに Grok Build の選択肢が加わり、データソース内訳に専用アイコン付きの「Grok Build Session」項目が追加されました。4 言語対応です。
### プロバイダーカード上の SuperGrok サブスクリプションクォータ
カテゴリが「公式」の Grok Build プロバイダーでは、カード上に SuperGrok サブスクリプションの使用量が直接表示されるようになりました——Claude Code / Codex / Gemini の公式サブスクリプションのフッターと並ぶ形です。CC Switch は Grok CLI 自身の OAuth 認証情報(`~/.grok/auth.json`)を読み取り、grok.com の課金 endpoint に問い合わせて、クォータウィンドウの使用率とリセット時刻を取得します。リセット間隔が判別できる場合は「週」または「月」と表示し、そうでない場合は新設の「Credits」区分に入ります(トレイの使用量サマリーでは `c` グループとして表示)。ネットワークの一時的な切断時は前回の値を保持して再試行し、フッターを空にしません。トークンが期限切れの場合は `grok login` のやり直しを促します。Claude Code、Claude Desktop、Codex の管理下 xAI OAuthSuperGrok)プロバイダーにも同じクォータ表示が自動的に付きます——データはそのプロバイダーに紐づくアカウントから取得され、使用量スクリプトの入口はそれに伴って非表示になります。なお Grok Build プロバイダーの「公式」判定は、現在は `category` フィールドのみで行い、設定内容の推定は行いません。
### Claude Opus 5 の内蔵価格
`claude-opus-5` を内蔵価格テーブルに追加しました。100 万 token あたり入力 $5 / 出力 $25、キャッシュ読み取り $0.50 / キャッシュ書き込み $6.25 で、使用量が $0 と表示されなくなります。「存在しなければ挿入」でシードするため、編集済みの価格は影響を受けません(Opus 5 の fast モードは別建ての課金のため、意図的にテーブルへ入れていません)。
### プリセットカタログの更新
A6API(同一モデルに複数の上流を持ち自動で最適な経路を選ぶアグリゲーションプラットフォーム)を 8 つのアプリのスポンサープリセットに追加しました。PackyCode のプリセットは、バックアップ endpoint に対応する 5 種類のプリセット(Claude Code / Claude Desktop / Codex / Gemini CLI / Grok Build)で 3 つのバックアップアドレスを追加し、アドレスマネージャーと速度計測から選択できます。AICoding パートナープリセットが 7 アプリで復帰し、スポンサーの並び順を README と再度揃えました。
---
## 変更
### プリセット既定モデルのアップグレード:Claude Opus 5、GPT-5.6 Sol、Gemini 3.6 Flash
内蔵プリセットの既定モデルが全面的に現行世代になりました。`claude-opus-5``claude-opus-4-8` を置き換え(3 種類の命名形態すべてをカバー)、`gpt-5.6-sol``gpt-5.5` と裸の `gpt-5.6` を置き換え、`gemini-3.6-flash``gemini-3.5-flash` を置き換えます。ミラーされているすべての箇所も同期更新しました——汎用 / NewAPI の既定値、Codex カスタム `config.toml` テンプレート、推奨リスト、フォームのプレースホルダー、4 言語の文言です。`gemini-3.6-flash` の価格も登録しました(100 万 token あたり $1.50 / $7.50、キャッシュ読み取り $0.15)。`gemini-3.1-pro-preview` に固定されたままだった Code0 と Qiniu の Gemini プリセットも 3.6 Flash に揃えています——これは**意図的な tier の調整**です。3.6 に Pro 版はなく、3.5 Pro は引き続きパートナーテストに限定されています。**既定値は新規作成するプロバイダーにのみ影響します**。保存済みのプロバイダーは作成時のモデルを維持します。Claude Desktop の opus ルートの現在値は `claude-opus-5` に前進し、`claude-opus-4-8` は互換エイリアスのスロットへ移りました。既存の設定は従来どおり解決されます。
### アプリ内更新は ccswitch.io ミラー経由へ
アップデーターは `https://dl.ccswitch.io/latest.json`——リリースマニフェストの Cloudflare R2 ミラー——を優先して照会し、GitHub Releases をフォールバックにするようになりました。更新の確認とダウンロードが GitHub への到達性に依存しなくなります。ミラーのマニフェストは各プラットフォームのダウンロードを同一のバケットへ向けますが、minisign の署名はそのままです。署名が保証するのは URL ではなくファイルの内容であり、ダウンロードした成果物はいずれも内蔵の公開鍵に対して検証されます——**ミラー自体は常に信頼されません**。配信は release でゲートされた同期ワークフローが担当し、tag が確かに GitHub の `releases/latest` である場合にのみルートのマニフェストを書き換えるため、ミラーがユーザーを古いバージョンへ引き戻すことはありません。
### Codex 使用量インポート:fork セッションの高速化
Codex 使用量統計のインポートと再構築で、同じ親 rollout ファイルを fork 地点ごとに読み直すことはなくなりました。親の `~/.codex/sessions/*.jsonl` は 1 回だけ解析してメモリ上の token タイムラインを生成し、そこから fork したすべての子セッションで共有します。各子セッションの切り詰め位置はメモリ上のフィルタリングで処理されます。キャッシュはファイル同一性のスタンプ(更新時刻、サイズ、加えて Unix では device/inode、Windows ではボリュームシリアル番号 + ファイル ID)で検証されるため、追記・ローテーション・置換された親ファイルは古いデータを返さず読み直されます。高速化の度合いは fork の密度に応じて変わります——fork の多い履歴では冗長な解析が大幅に減り、fork の少ない履歴はほぼ変わりません。いずれの場合もインポート結果はバイト単位で同一です。([#5626](https://github.com/farion1231/cc-switch/pull/5626)
### ツールバーのアプリ切り替えをアイコンのみに
切り替えボタンはアイコンの横にテキストラベルを描画しなくなりました——管理対象アプリが 8 つに増えてからは、ラベルはほぼ常にオーバーフロー検出で畳まれていたためです。そこで ResizeObserver ベースの自動コンパクト機構を取り除き、常にアイコンのみを表示します。アプリ名はホバー時のツールチップに残り、スクリーンリーダーからは `aria-label` 経由で従来どおりアクセスできます。
### スポンサーのドメインと紹介リンクの更新
複数のスポンサーがドメインを移転したため、プリセットのアドレス、バックアップ endpoint、紹介リンク、README の行を同期しました(PackyCode → `www.packyapi.ai`、RightCode → `www.rightapi.ai`、ClaudeAPI → `www.apito.ai`、APINebula → `apinebula.ai`、AICodeMirror → `.ai`、AICoding → `.inc`、AIGoCode → `.app`)。あわせて、既に無効になっていたバックアップ endpoint を 2 つ削除しています。**作成済みのプロバイダーはデータベースに保存された旧アドレスを保持します**——新しいドメインへ移したい場合は、アドレスを手動で変更するか、更新後のプリセットから作り直してください。
---
## 修正
### プロキシ経由の画像読み取りでコンテキストが溢れない
クライアントがツール呼び出しで画像を読み取るとき——Codex の `view_image` や、画像を返す任意の MCP ツール——プロキシのプロトコル変換は画像ブロック全体をツールメッセージのテキストへシリアライズしており、上流は base64 をプレーンテキストとして token 計算していました。約 9,000 倍の膨張で、113 KB の PNG 1 枚が 10 万 prompt token 超に換算されていました。Codex は毎ターン履歴全体をリプレイするため、スクリーンショットが 2〜3 枚あればセッションをコンテキストウィンドウの外へ押し出し、400 の繰り返しで固まらせるのに十分でした([#4465](https://github.com/farion1231/cc-switch/issues/4465)、[#5663](https://github.com/farion1231/cc-switch/issues/5663))。
プロキシはメディアのペイロードをツール結果から取り出し、各ブリッジのネイティブ形式で送り直すようになりました——**画像は全ブリッジでカバーされ、ファイルと音声は対象プロトコルが対応している箇所で有効になります**。2 本の Chat ブリッジ(Claude→Chat、Codex Responses→Chat)は画像 / ファイル / 音声を運び、ツールメッセージには短いマーカーを残して、メディアは合成したユーザーメッセージとしてツールバッチの直後に続きます。Claude→Responses はネイティブな `input_image` に復元し、Codex / GrokBuild→Anthropic は標準の Anthropic 画像ブロックを再構築し、Claude→Gemini は Gemini 3 ではマルチモーダルな `functionResponse.parts` を使い(旧モデルでは `inlineData`)、インライン base64 画像のみを受け付けます。検出は型付きの Responses ブロック、Anthropic の `source` ブロック、MCP の `data`+`mimeType` 結果、画像 data URL 全体をカバーし、配列やネストされた `content` ラッパー(JSON エンコードされたツール出力を含む)も貫通します。出力がメディアを含むと判定された場合に限り、そこに残る data URL と裸の base64 はプレースホルダーへ畳まれます——**裸の base64 それ自体がメディア判定を引き起こすことは決してありません**。通常のツール出力はそのままです。メディアを含まないツール結果はすべてのブリッジで従来どおりバイト単位に同一で、prompt キャッシュのプレフィックスには影響しません。送信するメディアブロックには意図的に `cache_control` マーカーを付けないため、GLM や Qwen のような厳格な上流に拒否されることもありません。Kimi K3 でのエンドツーエンド実測では、同一のリプレイターンが安定して入力約 12k token・キャッシュヒット率 99% となりました。以前は毎回のリプレイで 85k+ の base64 テキストを背負っていました。
### 「非対応画像フォールバック」がツール結果の中の画像も見えるように
「非対応画像フォールバック」設定は、プロバイダーがテキストのみの場合や上流が画像を拒否した場合に、画像ブロックをプレースホルダーマーカーへ置き換えます。しかしこれまでは、構造化ブロックのままの画像しか見えていませんでした——base64 テキストへ平坦化されたツール結果の画像は見えず、テキストのみの上流ではそのまま失敗して復旧しようがありませんでした。メディアクリーナーは、各経路で対称的にツール出力内のメディアを検出して剥がすようになり、送信前の剥がしと拒否後の再試行のどちらの経路でもこの種のターンを救えます。この検出がツール結果の内部まで及ぶようになったため、リアクティブな再試行が引き続き本物のモダリティ拒否に対してのみ発火することを回帰テストで固定しました——コンテキスト長超過の 400 が画像拒否と誤認されて再試行されることはありません。
### Grok Build のコスト補填が過大にならない
欠落したコストを埋めるルーチンは、これまで Codex と Gemini だけを「報告される入力 token にキャッシュ読み取りが含まれる」プロバイダーとして扱っていましたが、Grok Build も同じ扱いに属します——補填された Grok Build の行は入力を全量として計算し、キャッシュ読み取りをもう一度計上していたため、コストが過大でした。キャッシュ込みのプロバイダー集合は現在 1 箇所でのみ定義され、ルーティングのレコーダー、コスト計算機、補填ルーチンが共有します。三者の言うことが食い違う可能性はなくなりました。なお旧来の補填で既に修正済みの行は元の値のままです——補填はコストがゼロの行のみを処理し、既にある正のコストを書き換えることは決してありません。
### 手動編集した設定ファイルでアプリがクラッシュしたり編集が飲み込まれたりしない
`~/.codex/config.toml``mcp_servers` が存在するもののテーブルではない場合(たとえば `mcp_servers = "x"`)、MCP 同期が切り替えの途中で panic していました——しかもデータベースと live 設定の両方が書き込まれた後に起きるため、中途半端に適用された切り替えが残ります。テーブル以外の値は警告を出したうえで空のテーブルへ正規化するようになり、Codex と GrokBuild の書き込み側も同様に修正しました。インラインテーブル形式(合法な TOML)には、これと鏡写しの問題がありました——MCP の削除が黙って無効なのに UI は成功と表示する、`base_url` の編集が Codex がまったく読まない階層へ書き込まれる——いずれも対処済みです。ルートノード、`provider` セクション、`mcp` セクションが配列 / スカラーになっている `opencode.json` でも panic しなくなり、この種のファイルは再構築ではなくエラーとして拒否されるため、ユーザーの `model``theme` の設定が消されることはありません。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### プロキシ変換が不正な上流レスポンスに耐える
上流ゲートウェイからの不正なデータが、これまではエラーを生む代わりにローカルプロキシを落としかねませんでした。Anthropic SSE ストリーム内のオブジェクトでない `message``content_block`、バッファされたレスポンスボディがトップレベルの JSON 配列やスカラーである場合(`stream: true` を無視するゲートウェイはこれを返します)は、panic するインデックス代入に当たっていました。現在はストリームが正常な失敗イベントで終わります。不正な `content_block` ヘッダーはテキストブロックとして復元されるようにもなりました——単に空のオブジェクトへ浄化するだけでは panic は止まっても、後続の内容がすべて黙って捨てられ、モデルが何も言っていないように見えてしまいます——壊れたヘッダーの後に来る差分は通常は無傷なので、よくあるケースでは中身が通るようになり、置き換えが起きた際には警告を 1 件記録します。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### OpenClaw の Kimi For Coding アドレス修正
OpenClaw のプリセットは、これまで汎用プラットフォームの endpoint `https://api.kimi.com/v1` を指していましたが、Kimi For Coding サブスクリプションが使うのはそこではないため、coding プランの key が使えませんでした。アドレスを `https://api.kimi.com/coding/v1` に修正し、フォームのプレースホルダーと既定値も同期更新しました。**旧プリセットから作成したプロバイダーは、手動で新しいアドレスに変更する必要があります。**
---
## セキュリティ強化
本節の 9 項目のうち、**2 つはあなたの操作が必要です**。Gemini 共通設定を通過したキーのローテーションと、過去に `ccswitch://` でインポートした MCP 項目の確認です——やり方は「アップグレード時の注意」に書いてあります。残りはアップグレードするだけで有効になり、操作は不要です。
他人から送られてきた `ccswitch://` リンクを開いたことがなく、共有された Gemini 共通設定も使っていないなら、この 9 項目の意味は主に「今後トラブルが起きにくくなる」ことです。2 つのうちどちらかに心当たりがあるなら、**このバージョンは優先してアップグレードする価値があります**。
### Gemini 共通設定がキーを漏らさなくなり、アップグレード後に自動クリーンアップ
Gemini の共通設定エクストラクターは、これまで共有スニペットから `GEMINI_API_KEY``GOOGLE_GEMINI_BASE_URL` だけを剥がし、他の `env` 項目はそのままコピーしていました——しかし `GOOGLE_API_KEY` はまさに Gemini の一級の認証情報であり、あるアカウントの key が(他の認証情報らしき項目とともに)共通設定を使うすべての Gemini プロバイダーへディープマージされ、相手の base URL——それはサードパーティの中継かもしれません——へ送られていました。エクストラクターは、認証情報パターンに合致するキーをすべてスキップするようになり(Claude のエクストラクターと同じマッチャー群を使用)、フロントエンドのスニペット検証も同様に揃えたため、手動編集で押し戻すこともできません。Gemini のスニペットは一度存在すると再抽出されないため、アップグレード後の初回起動で**一回限りのクリーンアップ**も実行します。既に漏れた認証情報を、スニペットから、マージされた各プロバイダーから、そして `~/.gemini/.env` から取り除きます——キー名**と値**の完全一致で照合するため、プロバイダー自身の同名で値の異なる key は巻き込まれません——env ファイルの書式とコメントは保持されます。クリーンアップの詳細と注意点は「アップグレード時の注意」を参照してください。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### Skill リポジトリインストールの強化:パストラバーサルとアーカイブ上限
GitHub リポジトリから Skill をインストール / 閲覧すると、これまで対象ディレクトリの外へ書き込まれる可能性がありました。アーカイブのエントリを正規化せずに対象パスへ連結していたため、`..` を含む ZIP は展開ディレクトリから脱出できました(zip-slip)。リポジトリ座標は一度も検証されておらず、`../../../releases/download/v1/evil` のようなブランチ名でダウンロードを任意の release アセットへリダイレクトできました——しかも Skill リポジトリは信頼できない `ccswitch://` ディープリンクから追加でき既定で有効なため、Skills パネルを開くだけでダウンロードが走ります。バックアップからの復元、同期スナップショット、「アプリからインポート」由来の Skill `directory` 値も検証されずにパスへ連結されており、アンインストールが管理対象ディレクトリの外へ `remove_dir_all` を行う可能性がありました。現在はすべての書き込み先でディレクトリ名を検証し、リポジトリの owner / 名前 / ブランチは唯一のダウンロード集約点でホワイトリスト化し、展開にはハード上限を設けました(10,000 エントリ、書き込み 512 MB、ダウンロード 128 MB、シンボリックリンクのターゲット 4 KB、自己参照リンクは拒否)。新しいエラーメッセージは 4 言語対応です。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### ディープリンクインポート確認ダイアログ:内容を余さず表示し、リスクをマーク
`ccswitch://` の MCP インポート確認ダイアログは、これまで切り詰められる 1 行の `Command:` しか描画せず、`args``url``env` は一切表示していませんでした——リンクに `command: "sh"``args: ["-c", "curl …|sh"]`、そして `LD_PRELOAD` 環境変数を付けても、表示上は無害な `sh` に見えるだけで、確認すると各アプリの live MCP ファイルへ書き込まれます。確認ダイアログは現在、コマンド、各引数、URL、環境変数を 1 行ずつ描画し、切り詰めではなく折り返して表示するため、見えないまま切り落とされる内容はありません(キー名に TOKEN / KEY / SECRET / PASSWORD を含む env の値は、接頭辞 + アスタリスクでマスク表示されます)。よく見るべき値はハイライトされ、警告ブロックにまとめられます——インライン実行フラグ付きのシェルインタープリター(`bash -lc``cmd /C`、PowerShell の `-Command` の短縮形などの組み合わせを含む)、プロセスのロード挙動を変える環境変数(`LD_*``DYLD_*``NODE_OPTIONS``PYTHONPATH``PATH`、プロキシ変数など)、ループバック / 内部ネットワーク / クラウドメタデータのアドレスを指す endpoint です。マークはあくまで注意喚起であり、インポートを遮断することはありません——ローカルの Ollama endpoint はごく普通の使い方です。プロバイダーの確認ダイアログにも同じ処理を入れました。「指定されたすべてのアプリへ直ちに書き込まれます」の警告は無条件表示に変更し、リンク側で制御できるフィールドによるゲートをやめました。
### ディープリンクの使用量スクリプト:既定で無効、コードを見てから使う
ディープリンク経由でインポートされる使用量照会スクリプトは、使用量を照会するたびに実行される JavaScript ですが、これまでコードを一度も見ないまま有効化される可能性がありました。バックエンドが「コードが付いている」ことを「実行に同意した」とみなし、確認ダイアログは有効 / 無効のバッジしか表示せず、スクリプト本体は決して表示しなかったためです。スクリプトは**既定で無効**になりました——リンクが明示的に `usageEnabled=true` を持つ場合にのみ有効化を要求します——確認ダイアログはデコード済みのスクリプト全文を、スクロール可能で完全に折り返されたコードブロックとして表示し、有効化すると実行される旨を警告します。デコードに失敗した場合は元のペイロードを表示するフォールバックとなるため、不正なスクリプトが「スクリプトなし」を装うことはできません。スクリプトコードは従来どおりプロバイダーに保存され、確認したうえでアプリ内から手動で有効化できます。
### URL-safe Base64 で確認ダイアログが丸ごと空になっていた
上の 2 項目が直すのは「確認ダイアログの表示が足りない」ことですが、この項目が直すのは「確認ダイアログが何も表示しないことがある」ことです。バックエンドは 4 種類の Base64 バリアント(RFC 4648 §5 の URL-safe アルファベットを含む)を受け付けますが、フロントエンドの `atob` は標準アルファベットしか認識せず、解けないときは**エラーを出さずに入力をそのまま返して**いました——その結果、同じペイロードでもバックエンドはデコードに成功してインポートし、フロントエンドが手にするのは解けない文字の塊になります。使用量スクリプトとシステムプロンプトは不透明な Base64 として表示されました。**最悪なのは MCP 設定です。`JSON.parse` の失敗がコンポーネントに飲み込まれ、確認ダイアログは「0 個のサーバー」と空のリストを描画する一方、バックエンドは従来どおり実際の項目を live MCP ファイルへ書き込みます**。ペイロードの `/` を 1 つ `_` に替えるだけで十分でした——確認ダイアログは空になり、インポート機能は完全に動き、上の 2 項目で補ったばかりの完全表示も同時に効かなくなります。
フロントエンドのデコーダーは、URL-safe アルファベットを正規化してからデコードするようになり、確認ダイアログの表示は常にインポートされる内容と一致します。共有デコーダーには初めてユニットテストが付き、テストケースには前提条件の自己検証が含まれていて、サンプルが確かに URL-safe の分岐に落ちること(たまたま両方のエンコードが同一なのではないこと)を保証します。
> この不具合は v3.8.0 以降のすべてのバージョンに影響します。`ccswitch://` リンクで MCP サーバーをインポートしたことがある場合は、一度確認することをおすすめします——「アップグレード時の注意」を参照してください。
### SQL インポートはインポート対象データベースの外に触れる文を拒否
データベースバックアップのインポートは、これまでファイル先頭のコメントを検証するだけで、その後はテキスト全体をそのまま `execute_batch` に渡していました——巧妙に作られたバックアップは `ATTACH DATABASE` でユーザーが書き込める任意の場所に SQLite ファイルを作成でき、しかもその副作用はインポート自身の状態検証より前に発生するため、インポート全体が失敗してもファイルは既に作られています。WebDAV / S3 の同期スナップショットも同じコードパスを通ります。現在は外部バッチの実行中に SQLite authorizer をインストールします(終了時に直ちに取り外すため、アプリ自身の schema メンテナンスは影響を受けません)。`ATTACH` / `DETACH``VACUUM`、仮想テーブルの作成(csvfile のようなファイルバックエンドのモジュールは任意のパスを読み書きできます)、および SQLite が未知と報告するすべてのアクションは一律に拒否されます——将来の新しい文も既定で失敗します。PRAGMA はエクスポーターが実際に書き込む `foreign_keys``user_version` の 2 つだけを許可します。
### 共通設定スニペットのプロトタイプ汚染
共通設定スニペットの適用・削除・比較を行う 3 つのトラバーサルは、これまでいずれも `__proto__` をたどってグローバルな `Object.prototype` に入り込んでいました。`JSON.parse('{"__proto__":{…}}')` が生成するのは自身の列挙可能プロパティであり、マージすると攻撃者が指定した値がグローバルなプロトタイプに書き込まれます——そして `settings` テーブルは同期時にリモート側でテーブルごと上書きされるため、悪意ある WebDAV / S3 のスナップショットが着地した後にプロバイダーフォームを一度開くだけでマージが発火します。3 つのトラバーサルは `__proto__``constructor``prototype` を一律にスキップするようになりました。「共通設定が適用済みか」の比較では自身のプロパティであることも同時に要求するようにし、ついでに目に見える奇妙な挙動——`{"__proto__":{}}` がこれまで任意の設定の部分集合と判定されていたこと——も修正しました。
### ターミナル起動におけるディレクトリ名のコマンドインジェクション
外部ターミナルでセッションを復元する際、`cd` 行はこれまで作業ディレクトリをダブルクォートで囲み、バックスラッシュとダブルクォートだけをエスケープしていました——ダブルクォートの中でもシェルは `$(…)`、バッククォート、`$VAR` を展開しますし、この値は CLI のセッション履歴に記録された実際のプロジェクトパスで、macOS ではディレクトリ名にこれらの文字を合法的に含められます。フォルダーにそのような名前が付いていれば、「復元」をクリックしただけであなたのターミナルで埋め込まれたコマンドが実行されます。侵害されたコンポーネントは一切必要ありません。シェル行を組み立てる 3 つのランチャー——Terminal.app、iTerm、kitty——は POSIX のシングルクォートエスケープに変更し、いかなる内容も展開されなくなりました(Terminal / iTerm を通すために必要な AppleScript の引用層も同様に安全です)。Ghostty、WezTerm / Kaku、Alacritty はもともとディレクトリを独立した引数として渡しており、初めから安全でした。
### GrokBuild の認証情報解決が環境のキーを差し替えたりインライン化したりしない
GrokBuild の認証情報の取り出しは、これまで設定が指定する `env_key` 変数が未設定の場合にプロセスレベルの `XAI_API_KEY` へフォールバックしていました——別アカウントの key に黙って差し替えられ、設定が指す任意の base URL へ送られます。認証情報は現在、明示的なインラインの `api_key` か、`env_key` が正確に名指しする環境変数からのみ取得されます。ディープリンクインポートは環境変数を平文の `api_key` に解決しなくなりました。`env_key` の名前だけを持つリンクは拒否され、手動での追加を促します——そのまま受け入れると、リクエスト時に被害者の環境のキーが解決され、リンクが宣言したアドレスへ送られてしまうためです。あわせて修正:base URL の解決を認証情報の解決から切り離しました。これまでは認証情報が欠けると base URL まで空になり、macOS(GUI プロセスはシェル環境を継承しません)で UI に表示されるアドレスと実際に使われるアドレスが食い違い、使用量スクリプトの `{{baseUrl}}` が空に展開されていました。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
---
## ドキュメント
### 「Claude Code で GPT モデルを使う」ガイドに英語版・日本語版を追加
これまで中国語版しかなかったローカルルーティングガイドを、英語と日本語へ完全に移植しました。2 つの接続経路をエンドツーエンドでカバーします——サードパーティの OpenAI Responses ゲートウェイ(API Key)と、ChatGPT Plus/Pro サブスクリプションを Codex のデバイスコード OAuth ログインで使う経路です。2 つのルーティングガイドは同時に、「どのクライアントが正しいか」ではなく「どのモデルを使うか」を示すタイトルへ変更しました——《[Claude Code で GPT モデルを使う](../guides/claude-codex-routing-guide-ja.md)》《[Codex で Claude モデルを使う](../guides/codex-claude-routing-guide-ja.md)》——そしてすべての相互リンク(3 言語の v3.18.0 リリースノートを含む)を読者の言語のバージョンへ向けました。
### ユーザーマニュアル:ディープリンク `usageEnabled` の既定値を修正
3 言語のユーザーマニュアルのディープリンクリファレンスは、これまで `usageEnabled` の既定値が `true` だと記載していましたが、実際の既定値は `false` で、インポーターと一致します。マニュアルには正しい既定値を明記し、2 つの帰結も補いました。インポート前の確認ダイアログはスクリプトのコードを完全に表示すること、そして明示的な `usageEnabled=true` がない場合はスクリプトが無効の状態でインポートされ、後からアプリ内で有効化できることです。
### SECURITY.md:脅威モデルと報告範囲
`SECURITY.md` に 2 言語の脅威モデルと、明確な範囲内 / 範囲外のリストを整備しました。報告は「値が最終的にどの API へ届いたか」ではなく「この入力を誰が制御しているか」で分類します。内蔵の WebView レンダラーは信頼されたコンポーネントとして宣言し(独立に検証できる 4 つの事実と、その前提が崩れる条件を添えています)、ディープリンクのペイロード、WebDAV / S3 の復元データ、インポートファイル、上流 API のレスポンス、ローカルプロキシへの受信リクエストはすべて信頼できない入力として列挙し、報告を歓迎します。
---
## アップグレード時の注意
### 本リリースにデータベース移行はありません
v3.19.0 に schema 移行は含まれません(バージョンは v16 のまま)。アップグレードすればすぐ使え、データの再構築を待つ必要はありません。
### Gemini キーの一回限りのクリーンアップ(必ずお読みください)
アップグレード後の初回起動時、通常の設定抽出より前に、一回限りの Gemini 共通設定クリーンアップが実行されます。**その後、一部の Gemini プロバイダーで API Key が不足していると表示される場合があります**。項目は認証情報型のキー名と値の完全一致で削除され、通常削除されるのは共有スニペット経由で漏れ込んだ他プロバイダーの認証情報です(そのプロバイダー自身の元の値は、漏えいが発生した時点で上書きされており復元できません)——ただし、**複数の Gemini プロバイダー間で意図的に使い回していた同じ値の key も一緒に削除されます**。いずれの場合も、ローテーションしてから入力し直してください。**共有 Gemini スニペットを通過したキーはすべて漏えい済みとみなすべきです**。削除されたキー名と影響を受けたプロバイダー id(値は決して含みません)は `settings` テーブルの `gemini_common_config_scrub_audit_v1` に記録されており、これをもとにキーの再入力が必要なプロバイダーを 1 つずつ特定できます。
### ディープリンクで MCP をインポートしたことがありますか?一度確認をおすすめします(必ずお読みください)
本リリース以前、`ccswitch://` の MCP インポート確認ダイアログは**書き込まれる内容を表示できないことがありました**。引数と環境変数は一切描画されず(`command: "sh"``args: ["-c", …]` を付けても無害な `sh` としか表示されません)、ペイロードが URL-safe Base64 でエンコードされている場合はリスト全体が「0 個のサーバー」と表示されました——それでいてバックエンドはどちらの場合も従来どおり項目を各アプリの live MCP ファイルへ書き込みます。この 2 つの不具合は **v3.8.0 以降のすべてのバージョン**に影響し、本リリースでまとめて修正されました。
悪用には、攻撃者が提供したリンクをあなた自身が開いて「インポート」をクリックする必要があるため、大多数のユーザーは影響を受けません。**完全には信頼できない出所から `ccswitch://` の MCP インポートリンクを開いたことが実際にある場合**は、MCP パネルで 1 件ずつ確認するか、`~/.claude.json``mcpServers`Codex は `~/.codex/config.toml``mcp_servers`)を直接確認し、見覚えのない項目がないことを確かめてください——MCP サーバーは CLI の次回起動時に子プロセスとして実行されます。
### ディープリンクの使用量スクリプトは既定で無効
使用量照会スクリプトを含むディープリンクは、リンクが明示的に `usageEnabled=true` を持たない限り、既定で無効の状態でインポートされるようになりました。自動有効化に依存していたリンク(一部パートナーのワンクリック設定リンクなど)はスクリプトをインポートしますが、使用量照会は有効になりません——コードを確認したうえで、プロバイダーエディターから手動で有効化してください。アプリ内で手動設定した使用量スクリプトは影響を受けません。
### 新しい既定モデルは新規プロバイダーにのみ影響します
保存済みのプロバイダーは作成時のモデル ID を維持するため、新しいモデルを使うには手動での編集が必要です。Claude Desktop の opus ルートの現在値は `claude-opus-5` に前進し、`claude-opus-4-8` は互換エイリアスのスロットへ移りました。既存の設定は従来どおり解決されます。
### 価格のシードとローカル価格ファイル
新しい価格行(`claude-opus-5``gemini-3.6-flash``grok-4.5-build`)は次回起動時に「存在しなければ挿入」で追加されます——**シードがあなたの編集した価格を上書きすることは決してありません**。`~/.cc-switch/model-pricing.json` は作成時点では空で、本リリース以降の手動の価格変更と削除のみを記録します——それより前の価格変更は移行されないので、データベースの再構築に耐えさせたい場合は一度保存し直してください。models.dev の自動同期は、あなたが手動で有効にするまで無効のままです。いったん有効にすると、これは同名の価格を上書きする(内蔵・手動を問わず)唯一の経路になります。
### GrokBuild の暗黙的な環境変数フォールバックを削除
暗黙的な `XAI_API_KEY` 環境変数フォールバックに依存していた GrokBuild プロバイダーは、明示的な `api_key` か、正しく名前を指定した `env_key` が必要になりました。
### Grok 公式モードの使用量は意図的に遅れます
公式モードの Grok 使用量は、約 10 分 + 同期周期 1 回分だけ遅れて現れます——イベントをまず寝かせて確定を待ち、その後プロキシが記録した行と照合して二重計上を防ぐためです。ルーティング経由のトラフィックと公式のトラフィックがウィンドウ内で交互に発生する場合、一部の公式ターンは重複計上の危険を冒す代わりにスキップされます。旧来のコスト補填で過大評価されていた Grok Build の行は元の値のままです——補填はコストがゼロの行のみを処理し、既にある正のコストを修正することは決してありません。
### 更新ミラーは次のバージョンから有効になります
アップデーターの endpoint リストはアプリのバイナリに内蔵されているため、既存のインストールは本変更を含むバージョンへアップグレードするまで GitHub のみを照会し続けます。それ以降は `dl.ccswitch.io` ミラーを優先し、GitHub にフォールバックします。
### スポンサーのドメイン移転は既存プロバイダーを変更しません
作成済みのプロバイダーはデータベースに保存された旧アドレスを保持し、引き続き旧ドメインを指します。新しいドメインへ移したい場合は、プロバイダーのアドレスを手動で変更するか、更新後のプリセットから作り直してください。
---
## リスク通知
### SuperGrok クォータ照会(本リリース新規)
プロバイダーカードの SuperGrok クォータ表示は、Grok CLI 自身の OAuth 認証情報(`~/.grok/auth.json`)を読み取り、grok.com の課金 endpoint に問い合わせます——この endpoint は公開ドキュメント化されたインターフェースではなく、レスポンスの解析は現行フォーマットの観察に基づいています。xAI がインターフェースを変更するとこの機能は動かなくなる可能性があります(その場合カードはクォータを表示しない状態に縮退し、他の機能は影響を受けません)。CC Switch がこれらの認証情報を保存したり変更したりすることはありません。
### 引き続き適用される注意
**xAI Grok OAuth サインイン**:公式 Grok CLI の公開 OAuth クライアント識別情報を再利用しており、利用によってアカウントの制限や停止につながる恐れがあります——詳細は [v3.18.0 release notes](v3.18.0-ja.md#リスク通知) を参照してください。
**Codex OAuth リバースプロキシ**:ChatGPT サブスクリプションの Codex OAuth をリバースプロキシ経由で使用すると、OpenAI の利用規約に違反する可能性があります。詳細は [v3.13.0 release notes](v3.13.0-ja.md#-リスクに関する注意事項) を参照してください。
**サードパーティプロバイダーのルーティング**:CC Switch ローカルプロキシで Codex、Claude Desktop、Grok Build のリクエストを変換してサードパーティプロバイダーへ転送する場合、課金・コンプライアンス・データ保持に関する制約はプロバイダーごとに異なります。利用前に対象プロバイダーの利用規約を確認してください。
上記機能を有効化したユーザーは、関連するリスクを自ら負うものとします。CC Switch は、これらの機能の利用によって発生したアカウント制限、警告、サービス停止について責任を負いません。
---
## 謝辞
本リリースのセキュリティ強化は、そのほとんどが外部からもたらされたものです——1 本の PR と、寄せられたセキュリティ報告です。
### コード貢献
- [#5811](https://github.com/farion1231/cc-switch/pull/5811)Skill インストールの zip-slip とリポジトリ座標のトラバーサル、Gemini 共通設定のキー漏えいと一回限りのクリーンアップ、GrokBuild の認証情報解決、複数の panic 経路の修正、@zayokami に感謝。本リリースにおいて単一の出所として最も広い範囲をカバーした仕事です。
- [#5734](https://github.com/farion1231/cc-switch/pull/5734)models.dev 自動価格同期、@YUZHEthefool に感謝。
- [#5626](https://github.com/farion1231/cc-switch/pull/5626)Codex fork セッションの使用量インポート高速化、@ayanamislover に感謝(@SaladDay との共同署名)。
### セキュリティ報告
本リリースの「セキュリティ強化」のうち 4 項目の修正は、非公開で寄せられたセキュリティ報告に基づくものです。**23pds**SlowMist 慢雾)と **zues devil** に感謝します——項目ごとの帰属は以下のとおりです:
- **ディープリンクインポート確認ダイアログが切り詰められた 1 行の `Command:` しか表示しない**——`args``url``env` は一切描画されず、`sh -c``LD_PRELOAD` を組み合わせたペイロードが画面上ではただの `sh` に見えていました。本リリースで最も影響範囲の大きい 1 件です。(23pds、SlowMist
- **SQL バックアップのインポートが制約されていない**——`ATTACH DATABASE` でユーザーが書き込める任意の場所にファイルを作成でき、しかもその副作用はインポート自身の検証より前に発生します。(zues devil)
- **外部ターミナル起動におけるディレクトリ名のコマンドインジェクション**——`cd` 行がダブルクォートで囲まれており `$(…)` が通常どおり展開され、しかもこの値はセッション履歴に記録された実際のプロジェクトパスです。(zues devil と 23pds がそれぞれ独立に報告。内蔵ランチャーとカスタムテンプレートの 2 つの経路をそれぞれ指摘)
- **共通設定スニペットのマージにおけるプロトタイプ汚染**——3 つのトラバーサルがいずれも `__proto__` をたどってグローバルな `Object.prototype` に入り込んでいました。(23pds、SlowMist
これらの報告はまた、[SECURITY.md](../../SECURITY.md) の脅威モデルと報告範囲を整備するきっかけにもなりました——それ以前、このプロジェクトには報告の方法しか書かれておらず、何が脆弱性にあたるかは書かれていませんでした。
残る 2 つのディープリンク修正(使用量スクリプトの既定無効化、URL-safe Base64 のバイパス)は、上記の修正そのものをレビューする過程で発見されたもので、元の報告には含まれていません。
### 問題報告
[#4465](https://github.com/farion1231/cc-switch/issues/4465) と [#5663](https://github.com/farion1231/cc-switch/issues/5663) で、プロキシ経由の画像読み取りによるコンテキスト溢れを報告してくださったユーザーに感謝します——本リリースで最も重要なプロキシの修正は、こうした実際の場面からの再現情報をもとにしています。
---
## ダウンロードとインストール
[Releases](https://github.com/farion1231/cc-switch/releases/latest) から、お使いのシステムに対応するビルドをダウンロードするか、公式サイト [ccswitch.io](https://ccswitch.io) から入手してください(本リリースからダウンロードは Cloudflare のエッジノード経由で配信され、GitHub への到達性に依存しなくなりました)。
### システム要件
| システム | 最低バージョン | アーキテクチャ |
| -------- | ------------------------ | ----------------------------------- |
| Windows | Windows 10 以降 | x64 / ARM64 |
| macOS | macOS 12 (Monterey) 以降 | Intel (x64) / Apple Silicon (arm64) |
| Linux | 下表を参照 | x64 / ARM64 |
### Windows
| ファイル | 説明 |
| ---------------------------------------- | -------------------------------------------- |
| `CC-Switch-v3.19.0-Windows.msi` | **推奨** - 自動更新対応の MSI インストーラー |
| `CC-Switch-v3.19.0-Windows-Portable.zip` | ポータブル版、展開してそのまま実行できます |
Windows ARM64 デバイスでは、ファイル名に `arm64` が含まれる対応する成果物を選択してください。
### macOS
| ファイル | 説明 |
| -------------------------------- | ------------------------------------------------------ |
| `CC-Switch-v3.19.0-macOS.dmg` | **推奨** - DMG インストーラー、Applications へドラッグ |
| `CC-Switch-v3.19.0-macOS.zip` | 展開して Applications へドラッグ、Universal Binary |
| `CC-Switch-v3.19.0-macOS.tar.gz` | Homebrew インストールと自動更新用 |
Homebrew インストール:
```bash
brew install --cask cc-switch
```
更新:
```bash
brew upgrade --cask cc-switch
```
### Linux
Linux アセットは **x86_64****ARM64**`aarch64`)の両方を提供します。ファイル名のアーキテクチャ識別子を、マシンの `uname -m` 出力に合わせて選択してください:
- `CC-Switch-v3.19.0-Linux-x86_64.AppImage` / `.deb` / `.rpm`
- `CC-Switch-v3.19.0-Linux-arm64.AppImage` / `.deb` / `.rpm`
| ディストリビューション | 推奨形式 | インストール方法 |
| --------------------------------------- | ----------- | -------------------------------------------------------------------------- |
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` または `sudo apt install ./CC-Switch-*.deb` |
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` または `sudo dnf install ./CC-Switch-*.rpm` |
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
| Arch Linux / Manjaro | `.AppImage` | 実行権限を付与して直接実行、または AUR を利用 |
| その他 / 不明な場合 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
+353
View File
@@ -0,0 +1,353 @@
# CC Switch v3.19.0
> 这一版的主线是**让你更放心**:一波集中式安全加固——Skill 安装、`ccswitch://` 导入确认、SQL 备份导入、通用配置合并、终端启动全部收紧,其中两条需要你花一分钟确认——Gemini 通用配置的密钥泄漏已修复并在升级后自动清洗(**需要你轮换密钥**),`ccswitch://` 的 MCP 导入确认框此前可能显示不出即将写入的命令(**若你曾打开过来源不明的导入链接,建议核对一次**),两条都见「升级提醒」;一个代理正确性大修——**通过代理读图不再撑爆上下文**(一张截图曾经吃掉 10 万+ token,两三张就能把 Codex 会话卡死在 400 上)。省心的部分同样实在:**模型定价可以交给 models.dev 自动维护**、Grok CLI 官方登录模式的用量与 SuperGrok 订阅余量终于进看板、**应用内更新改走 `dl.ccswitch.io` 镜像**——GitHub 访问不畅也能顺利升级。
**[English →](v3.19.0-en.md) | [日本語版 →](v3.19.0-ja.md)**
---
## 重点内容:你现在可以
- **在代理下正常读图,不再撑爆上下文**:Codex 的 `view_image`、返回图片的 MCP 工具,图片此前被序列化成工具文本、按纯文本计 token(约 9,000 倍膨胀);现在所有转换桥都把图片还原为原生格式再上送(文件与音频在两条 Chat 桥上一并支持)。真实测试里同一回放轮从 85k+ token 降到约 12k、缓存命中 99%。
- **把模型定价交给 models.dev 自动维护**:用量面板新增「models.dev 自动定价同步」(默认关闭)。开启后启动时自动刷新所选模型的价格(每 6 小时至多一次),可在完整目录里挑选要跟踪的模型,或让它自动包含各家最新的常用模型。手工改价与删价从本版起会记入 `~/.cc-switch/model-pricing.json`,数据库重建也不丢。
- **看到 Grok 官方模式的用量与订阅余量**Grok CLI 用官方 OAuth 登录时无法走本地代理,此前这部分消耗完全不可见;现在会从会话日志导入逐轮用量,看板里以「Grok Build (Session)」呈现。官方类 Grok Build 供应商卡片还会直接显示 SuperGrok 订阅的额度用量与重置时间。
- **更放心地点开 `ccswitch://` 导入链接**:确认框现在完整展示命令、每个参数、URL 与环境变量(凭据类值脱敏显示),高亮标记值得多看一眼的值——shell 内联执行、改变加载行为的环境变量、内网 / 元数据地址;用量查询脚本会显示完整代码,且**默认以禁用状态导入**。
- **确认 Gemini 供应商里不再夹带别人的密钥**:通用配置共享片段此前会把 `GOOGLE_API_KEY` 等凭据复制进每个使用它的 Gemini 供应商;本版关闭该路径,升级后首次启动自动执行一次性清洗。**凡是进过共享 Gemini 片段的密钥都应视为已暴露,请先轮换再重填**(见「升级提醒」)。
- **在 GitHub 访问不畅时照常更新应用**:应用内更新器优先查询 `https://dl.ccswitch.io/latest.json`Cloudflare R2 镜像),GitHub 作为回落;minisign 签名校验不变,镜像本身不被信任。
- **新建供应商时直接用上最新模型**:预设默认模型升级为 Claude Opus 5、GPT-5.6 Sol 与 Gemini 3.6 Flash,配套定价同步入库;已创建的供应商保持原样。
- **更快导入 fork 密集的 Codex 用量历史**:父 rollout 文件只解析一次、跨全部 fork 点共享,fork 密集的历史重建明显提速,导入结果逐字节不变。
---
## 使用攻略
本版新能力主要落在用量面板与 `ccswitch://` 深链导入上,建议结合以下文档了解:
- **[用量统计](../user-manual/zh/4-proxy/4.4-usage.md)**:用量看板的数据来源与统计口径。本版新增 models.dev 自动定价同步与 Grok 官方模式用量导入。
- **[深链导入(ccswitch://](../user-manual/zh/5-faq/5.3-deeplink.md)**:导入确认框的字段说明与 `usageEnabled` 等参数的默认值(本版起用量脚本默认禁用导入,文档已同步修正)。
- **[安全策略(SECURITY.md](../../SECURITY.md)**:本版补齐了威胁模型与报告范围——哪些输入被视为不可信、哪些问题欢迎报告,一目了然。
---
> [!WARNING]
>
> ## 唯一官方渠道声明(请务必阅读)
>
> CC Switch 是**完全免费、开源**的桌面应用,**不会向用户收取任何费用**。请仅通过下列官方渠道获取本软件:
>
> | 类别 | 唯一官方 |
> | -------- | ------------------------------------------------------------------------------ |
> | 官网 | **[ccswitch.io](https://ccswitch.io)** |
> | 源码 | **[github.com/farion1231/cc-switch](https://github.com/farion1231/cc-switch)** |
> | 下载 | **[GitHub Releases](https://github.com/farion1231/cc-switch/releases)** |
> | 作者 | **[@farion1231](https://github.com/farion1231)** |
> | 举报山寨 | **[GitHub Issues](https://github.com/farion1231/cc-switch/issues)** |
>
> **任何向你收费、要求充值、或索取登录凭据的"CC Switch"网站或客户端均为假冒**。如果你被诱导支付了费用,请立即停止操作并通过 GitHub Issues 反馈。
---
## 概览
CC Switch v3.19.0 由一波安全加固与一个代理正确性大修领衔。安全侧([#5811](https://github.com/farion1231/cc-switch/pull/5811) 及后续独立修复):从 GitHub 仓库安装 Skill 加固了 zip-slip 与路径穿越并设归档上限;Gemini 通用配置的密钥泄漏被关闭,升级后首次启动自动执行一次性清洗,把已经泄漏进其它供应商配置的密钥清理干净;导入 SQL 备份改在 SQLite authorizer 下执行,`ATTACH` 等能触及导入库之外的语句一律拒绝;通用配置片段合并不再跟随 `__proto__` 污染全局原型;外部终端启动改用 POSIX 单引号转义,目录名再也注入不了命令;`ccswitch://` 导入确认框完整展示载荷(凭据类值脱敏显示)并标记风险值,用量脚本默认禁用导入。代理侧,工具结果里的图片不再被序列化成工具文本,而是在各转换桥还原为原生媒体上送(文件与音频在两条 Chat 桥上一并支持)——终结了「一张 113 KB 截图吃掉 10 万+ token、两三张图把 Codex 会话卡死在 400 上」的问题([#4465](https://github.com/farion1231/cc-switch/issues/4465)、[#5663](https://github.com/farion1231/cc-switch/issues/5663))。
用量统计获得两块新能力:**models.dev 自动定价同步**(可选开启,[#5734](https://github.com/farion1231/cc-switch/pull/5734)),配套把手工改价 / 删价持久化到人类可编辑的 `~/.cc-switch/model-pricing.json`;以及 **Grok CLI 官方 OAuth 模式的用量导入**——这条流量无法走本地代理,此前完全不可见——外加供应商卡片上的 SuperGrok 订阅配额展示。围绕分发与体验:应用内更新优先走 `dl.ccswitch.io` 的 Cloudflare R2 镜像(GitHub 回落,签名校验不变);Codex 用量导入对 fork 会话重用已解析的父 rollout 时间线([#5626](https://github.com/farion1231/cc-switch/pull/5626));预设默认模型升级为 Claude Opus 5、GPT-5.6 Sol 与 Gemini 3.6 FlashOpenClaw 的 Kimi For Coding 预设修正了 base URL;工具栏应用切换器改为纯图标。本版**没有数据库 schema 迁移**,升级轻量。
**发布日期**2026-07-30
**更新规模**38 commits | 132 files changed | +14,926 / -1,415 lines
---
## 新功能
### models.dev 自动定价同步
用量面板的定价区新增「models.dev 自动定价同步」卡片,**默认关闭、需手动开启**:开启时会有确认说明——CC Switch 将在启动时(每 6 小时至多一次)从 models.dev 刷新所选模型的价格,**同名模型的内置价与手工价都会被覆盖**。「选择模型」对话框提供完整的 models.dev 目录(可搜索筛选),另有「自动包含常用模型」选项,覆盖 Claude、GPT、Gemini、Grok、DeepSeek、Qwen、MiMo、LongCat、Kimi、MiniMax、GLM 各家最近发布的模型(每族至多 6 个,可单独排除)。卡片显示上次同步时间与错误,提供「立即同步」,还能打开或重载本地定价文件。
从本版起,手工改价与删价会同时记入数据库旁边的人类可编辑文件 `~/.cc-switch/model-pricing.json`,每次启动重放——数据库重建后手工定价不再丢失,删掉的内置价也终于能删得掉(以墓碑记录,不再被重新播种)。注意该文件创建时为空、**刻意不从既有定价表回填**(否则内置价会被一并写成覆盖项、挡掉将来的内置价修正),升级前的改价仍只存在数据库里,重存一次即可入文件。同步真的改了价格时,会把**从未算出成本**(零或缺失)的历史用量行按新价补算——已有成本的行保持原值;拉取失败或离线绝不阻塞启动。models.dev 列表还过滤掉了非文本与已弃用的模型(音频 / 图像 / 视频 / embedding 等),手动选价对话框一并清爽了。([#5734](https://github.com/farion1231/cc-switch/pull/5734)
### Grok 官方模式的用量,终于进看板
Grok CLI 用官方 OAuth 登录时无法经本地代理路由——Grok 以空配置作为模式开关,没有地方能把它指向 CC Switch——这部分消耗此前在用量看板里完全不可见。现在 CC Switch 会随常规会话日志同步,从 `~/.grok/sessions`(含归档会话)的 `updates.jsonl` 里按 `turn_completed` 事件导入逐轮用量:成本优先采用 CLI 自己上报的精确数字,缺失时回落本地定价(内置定价表新增 `grok-4.5-build`$2 输入 / $6 输出 / $0.30 缓存读,每百万 token)。导入行以上游逐轮 ID 为键,回卷会话不会造成重复计数;沉淀窗口加近期代理活动检查,确保同一流量在「路由 + 官方」混用时也不会算两次。看板里新行以「Grok Build (Session)」供应商名呈现,应用筛选器新增 Grok Build 选项,数据来源分栏新增「Grok Build Session」条目与专属图标,四语齐全。
### 供应商卡片上的 SuperGrok 订阅配额
类别为「官方」的 Grok Build 供应商,卡片上现在直接显示 SuperGrok 订阅用量——与 Claude Code / Codex / Gemini 的官方订阅页脚并列:CC Switch 读取 Grok CLI 自己的 OAuth 凭据(`~/.grok/auth.json`),查询 grok.com 计费端点获取额度窗口的已用百分比与重置时间;重置间隔可识别时标注为「周」或「月」,否则归入新的「Credits」档(托盘用量摘要中以 `c` 组呈现)。网络瞬断时保留上一次读数并重试,不清空页脚;令牌过期会提示重新 `grok login`。Claude Code、Claude Desktop 与 Codex 里的受管 xAI OAuthSuperGrok)供应商也自动获得同款配额展示——数据来自绑定到该供应商的账号,用量脚本入口随之隐藏。注意 Grok Build 供应商的「官方」判定现在只看 `category` 字段,不再探测配置内容。
### Claude Opus 5 内置定价
`claude-opus-5` 加入内置定价表:$5 输入 / $25 输出、$0.50 缓存读 / $6.25 缓存写(每百万 token),用量不再显示 $0。按「不存在才插入」播种,改过的价格不受影响(Opus 5 fast 模式走独立计费,刻意未入表)。
### 预设目录更新
A6API(同模型多上游自动择优的聚合平台)加入八个应用的赞助商预设;PackyCode 预设在支持备用端点的五类预设(Claude Code / Claude Desktop / Codex / Gemini CLI / Grok Build)上新增三个备用地址,可在地址管理器与测速里选择;AICoding 合作伙伴预设回归七个应用;赞助商排序与 README 重新对齐。
---
## 变更
### 预设默认模型升级:Claude Opus 5、GPT-5.6 Sol、Gemini 3.6 Flash
内置预设的默认模型全面来到当前一代:`claude-opus-5` 替换 `claude-opus-4-8`(三种命名形态全覆盖),`gpt-5.6-sol` 替换 `gpt-5.5` 与裸 `gpt-5.6``gemini-3.6-flash` 替换 `gemini-3.5-flash`。同步更新了所有镜像位置——通用 / NewAPI 默认值、Codex 自定义 `config.toml` 模板、推荐列表、表单占位符与四语文案;`gemini-3.6-flash` 定价同步入库($1.50 / $7.50、缓存读 $0.15,每百万 token)。仍钉在 `gemini-3.1-pro-preview` 的 Code0 与七牛 Gemini 预设一并对齐到 3.6 Flash——这是**有意的档位调整**3.6 没有 Pro 版,3.5 Pro 仍限合作测试。**默认值只影响新建供应商**,已保存的供应商维持创建时的模型;Claude Desktop 的 opus 路由现值前进到 `claude-opus-5``claude-opus-4-8` 转入兼容别名槽,存量配置照常解析。
### 应用内更新改走 ccswitch.io 镜像
更新器现在优先查询 `https://dl.ccswitch.io/latest.json`——发布清单的 Cloudflare R2 镜像——GitHub Releases 作为回落,检查与下载更新不再依赖 GitHub 可达。镜像清单把各平台下载指向同一存储桶,而 minisign 签名保持不动:签名覆盖的是文件内容而非 URL,每个下载产物仍会对着内置公钥校验,**镜像本身始终不被信任**。发布由 release 门控的同步工作流负责,只有当 tag 确为 GitHub 的 `releases/latest` 时才改写根清单,镜像永远不会把用户往回推到旧版本。
### Codex 用量导入:fork 会话提速
导入与重建 Codex 用量统计不再对同一个父 rollout 文件按 fork 点逐次重读:每个父 `~/.codex/sessions/*.jsonl` 只解析一次,生成内存中的 token 时间线,由所有从它 fork 出的子会话共享,各子会话的截断点改为内存过滤。缓存以文件身份戳校验(修改时间、大小,加 Unix 的 device/inode 或 Windows 的卷序列号 + 文件 ID),被追加、轮转或替换的父文件会重读而不是拿到陈旧数据。提速幅度取决于 fork 密度:fork 密集的历史冗余解析大幅减少,fork 稀少的历史基本不变——两种情况下导入结果都逐字节一致。([#5626](https://github.com/farion1231/cc-switch/pull/5626)
### 工具栏应用切换器改为纯图标
切换器按钮不再在图标旁渲染文字标签——受管应用增至八个后,标签本来就几乎总是被溢出检测收起,于是移除了基于 ResizeObserver 的自动紧凑机制,始终只显示图标。应用名保留在悬停提示里,读屏器经 `aria-label` 照常可及。
### 赞助商域名与推荐链接刷新
多家赞助商迁移了域名,预设地址、备用端点、推荐链接与 README 行已同步(PackyCode → `www.packyapi.ai`、RightCode → `www.rightapi.ai`、ClaudeAPI → `www.apito.ai`、APINebula → `apinebula.ai`、AICodeMirror → `.ai`、AICoding → `.inc`、AIGoCode → `.app`),顺带移除了两个已失效的备用端点。**已创建的供应商保留数据库里存的旧地址**——想迁到新域名,手动改地址或从刷新后的预设重建即可。
---
## 修复
### 通过代理读图不再撑爆上下文
客户端经工具调用读取图片时——Codex 的 `view_image`,或任何返回图片的 MCP 工具——代理的协议转换会把整个图片块序列化进工具消息的文本里,上游按纯文本给 base64 计 token:约 9,000 倍的膨胀,一张 113 KB 的 PNG 折算 10 万+ prompt tokenCodex 每轮重放全部历史,两三张截图就足以把会话顶出上下文窗口、卡死在反复的 400 上([#4465](https://github.com/farion1231/cc-switch/issues/4465)、[#5663](https://github.com/farion1231/cc-switch/issues/5663))。
代理现在把媒体载荷从工具结果里提出来、按各桥的原生格式重新上送——**图片全桥覆盖,文件与音频在目标协议支持处生效**:两条 Chat 桥(Claude→Chat、Codex Responses→Chat)承载图片 / 文件 / 音频,工具消息里留下简短标记、媒体作为合成用户消息紧随工具批次之后;Claude→Responses 还原原生 `input_image`Codex / GrokBuild→Anthropic 重建标准 Anthropic 图片块,Claude→Gemini 在 Gemini 3 上用多模态 `functionResponse.parts`(旧型号用 `inlineData`),只接受内联 base64 图片。检测覆盖有类型的 Responses 块、Anthropic `source` 块、MCP `data`+`mimeType` 结果与整串图片 data URL,可穿透数组与嵌套 `content` 包装(含 JSON 编码的工具输出);一旦判定输出含媒体,其中残留的 data URL 与裸 base64 会被折叠成占位——**裸 base64 本身从不触发媒体判定**,普通工具输出原样不动。不含媒体的工具结果在所有桥上保持与之前逐字节一致,prompt 缓存前缀不受影响;上送的媒体块刻意不带 `cache_control` 标记,GLM、Qwen 这类严格上游不会拒收。对 Kimi K3 的端到端实测:同一回放轮稳定在约 12k 输入 token、缓存命中 99%,此前每次重放要背 85k+ 的 base64 文本。
### 「不支持图片回退」现在能看到工具结果里的图
「不支持图片回退」设置会在供应商仅文本或上游拒图时用占位标记替换图片块,但它此前只能看到仍是结构化块的图片——已被打平成 base64 文本的工具结果图片对它不可见,仅文本上游直接失败、无从恢复。媒体清洗器现在在每条路径上对称地检测并剥离工具输出内的媒体,发送前剥离与被拒后重试两条路都能救回这类轮次;由于该检测现在也深入工具结果,一条回归测试钉住了反应式重试仍只对真正的模态拒绝触发——上下文超限的 400 不会被误当拒图去重试。
### Grok Build 成本回填不再高估
补算缺失成本的例程此前只把 Codex 与 Gemini 视为「上报输入 token 已含缓存读」的供应商,而 Grok Build 同属该口径——被回填的 Grok Build 行按全量输入计价、缓存读又计一次,成本虚高。缓存含入式供应商集合现在只定义一处,由路由记录器、成本计算器与回填例程共享,三者不再可能各说各话。注意此前已被旧回填修过的行保持原值——回填只处理零成本行,从不改写已有正成本。
### 手工编辑的配置文件不再让应用崩溃或吞掉编辑
`~/.codex/config.toml``mcp_servers` 存在但不是表(比如 `mcp_servers = "x"`)时,MCP 同步会在切换中途 panic——且发生在数据库与 live 配置都已写入之后,留下半套用的切换;非表值现在先告警再归一为空表,Codex 与 GrokBuild 写入器同步修复。内联表形态(合法 TOML)有镜像问题:MCP 删除静默无效而界面报成功、`base_url` 编辑写到 Codex 根本不读的层级——均已处理。根节点、`provider``mcp` 段是数组 / 标量的 `opencode.json` 不再 panic,这类文件会被报错拒绝而不是重建,你自己的 `model``theme` 设置不会被抹掉。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### 代理转换扛得住畸形上游响应
上游网关的畸形数据此前可能直接干掉本地代理而不是产生错误:Anthropic SSE 流里非对象的 `message``content_block`、缓冲响应体是顶层 JSON 数组或标量(无视 `stream: true` 的网关就返回这种)都会命中 panic 的索引赋值;流现在以正常的失败事件收尾。畸形的 `content_block` 头还会被恢复为文本块——只把它净化成空对象虽止住 panic,却让后续内容全部被静默丢弃、模型看起来什么都没说——由于坏头之后的增量通常是完好的,常见情况现在能通传,替换发生时记一条警告。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### OpenClaw 的 Kimi For Coding 地址修正
OpenClaw 预设此前指向通用平台端点 `https://api.kimi.com/v1`,而 Kimi For Coding 订阅走的不是它,coding 套餐的 key 用不了。地址修正为 `https://api.kimi.com/coding/v1`,表单占位符与默认值同步更新。**从旧预设创建的供应商需手动改到新地址。**
---
## 安全加固
本节九条里,**有两件事需要你动手**:轮换进过 Gemini 通用配置的密钥,以及核对曾经通过 `ccswitch://` 导入的 MCP 条目——「升级提醒」里写明了怎么做。其余的升级即生效,不需要你操作。
如果你从不点开别人发来的 `ccswitch://` 链接,也没用过共享的 Gemini 通用配置,那这九条对你的意义主要是「以后更不容易出事」;如果两条里有一条对得上,**这一版值得优先升级**。
### Gemini 通用配置不再泄漏密钥,升级后自动清洗
Gemini 通用配置提取器此前只从共享片段里剥掉 `GEMINI_API_KEY``GOOGLE_GEMINI_BASE_URL`,其余 `env` 条目原样复制——而 `GOOGLE_API_KEY` 正是 Gemini 的一等凭据,某个账号的 key(连同其它长得像凭据的条目)会被深合并进每一个使用通用配置的 Gemini 供应商,并发往对方的 base URL——那可能是第三方中转。提取器现在跳过一切命中凭据模式的键(与 Claude 提取器同一套匹配器),前端片段校验器同步对齐,手工编辑也塞不回去。由于 Gemini 片段一旦存在就不再重提取,升级后首次启动还会执行**一次性清洗**:把已经泄漏的凭据从片段、从每个被合并到的供应商、从 `~/.gemini/.env` 里清掉——按键名**加值**全等匹配,供应商自己的同名不同值 key 不受牵连——并保留 env 文件的排版与注释。清洗细节与注意事项见「升级提醒」。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### Skill 仓库安装加固:路径穿越与归档上限
从 GitHub 仓库安装或浏览 Skill 此前可能写到目标目录之外:归档条目未经归一就拼上目标路径,带 `..` 的 ZIP 能逃出解压目录(zip-slip);仓库坐标从未校验,`../../../releases/download/v1/evil` 这样的分支名能把下载重定向到任意 release 资产——而 Skill 仓库可经不可信的 `ccswitch://` 深链添加且默认启用,打开 Skills 面板就足以触发下载。来自备份恢复、同步快照与「从应用导入」的 Skill `directory` 值同样未经校验就拼路径,卸载可能 `remove_dir_all` 到受管目录之外。所有落点现在都校验目录名,仓库 owner / 名称 / 分支在唯一下载汇聚点白名单化,解压设硬上限(10,000 条目、写入 512 MB、下载 128 MB、符号链接目标 4 KB,自指链接拒绝),新错误信息四语齐全。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
### 深链导入确认框:看全内容,标记风险
`ccswitch://` 的 MCP 导入确认框此前只渲染一行会被截断的 `Command:``args``url``env` 一概不显示——链接带上 `command: "sh"``args: ["-c", "curl …|sh"]` 和一个 `LD_PRELOAD` 环境变量,显示出来只是一个人畜无害的 `sh`,确认后却被写进各应用的 live MCP 文件。确认框现在把命令、每个参数、URL 与环境变量逐行渲染,换行而非截断,不会有内容被裁掉看不见(键名含 TOKEN / KEY / SECRET / PASSWORD 的 env 值以前缀加星号脱敏显示);值得多看一眼的值会被高亮并汇总进警告块:带内联执行标志的 shell 解释器(含 `bash -lc``cmd /C`、PowerShell `-Command` 缩写等组合形态)、改变进程加载行为的环境变量(`LD_*``DYLD_*``NODE_OPTIONS``PYTHONPATH``PATH`、代理变量等)、指向回环 / 内网 / 云元数据地址的端点。标记纯属提示、从不拦截导入——本地 Ollama 端点是再正常不过的用法。供应商确认框获得同款处理;「将立即写入所有指定应用」的警告改为无条件显示,不再受链接可控字段的门控。
### 深链用量脚本:默认禁用导入,代码先看后用
经深链导入的用量查询脚本是每次查用量都会执行的 JavaScript,此前可能全程没见过代码就被启用:后端把「带了代码」当作「同意执行」,确认框只显示启用 / 禁用徽标、从不显示脚本体。脚本现在**默认禁用**——链接必须显式携带 `usageEnabled=true` 才请求启用——确认框以可滚动、完整换行的代码块显示解码后的全部脚本,并警告启用后将会执行。解码失败时回落显示原始载荷,畸形脚本不可能伪装成「没有脚本」。脚本代码照常存到供应商上,审阅后可在应用内手动开启。
### URL-safe Base64 曾让确认框整块变空
上面两条修的是「确认框显示得不够」,这一条修的是「确认框可以什么都不显示」。后端接受四种 Base64 变体(含 RFC 4648 §5 的 URL-safe 字母表),而前端的 `atob` 只认标准字母表、解不开时**原样返回输入而不报错**——于是同一段载荷,后端解码成功并导入,前端拿到的是一坨解不开的字符。用量脚本与系统提示词因此显示成不透明的 Base64;**MCP 配置最糟:`JSON.parse` 失败被组件吞掉,确认框渲染成「0 个服务器」加一张空列表,而后端照常把真实条目写进 live MCP 文件**。把载荷里一个 `/` 换成 `_` 就够了——确认框变空,导入功能完好,上面两条刚补上的完整展示随之一并失效。
前端解码器现在先归一 URL-safe 字母表再解码,确认框显示的永远与将要导入的一致;共享解码器首次有了单元测试,用例内含前置自检,确保样本真的落在 URL-safe 分支上而不是碰巧两种编码相同。
> 这条缺陷影响 v3.8.0 起的所有版本。若你曾通过 `ccswitch://` 链接导入过 MCP 服务器,建议检查一次——见「升级提醒」。
### SQL 导入拒绝触及导入库之外的语句
导入数据库备份此前只校验文件头注释,之后整段文本直接交给 `execute_batch`——精心构造的备份可以 `ATTACH DATABASE` 在用户可写的任意位置创建 SQLite 文件,且该副作用发生在导入自身的状态校验之前,导入整体失败文件也已落地;WebDAV / S3 同步快照走的是同一条代码路径。现在外部批次执行期间安装 SQLite authorizer(结束立即卸下,应用自身的 schema 维护不受影响):`ATTACH` / `DETACH``VACUUM`、虚表创建(csvfile 这类文件后端模块能读写任意路径)以及一切 SQLite 报告为未知的动作一律拒绝——未来的新语句默认失败;PRAGMA 只放行导出器实际会写的 `foreign_keys``user_version` 两个。
### 通用配置片段的原型污染
应用、移除、比对通用配置片段的三个遍历器此前都会跟着 `__proto__` 走进全局 `Object.prototype``JSON.parse('{"__proto__":{…}}')` 产出的是自有可枚举属性,合并会把攻击者指定的值写上全局原型——而 `settings` 表在同步时会被远端整表覆盖,恶意 WebDAV / S3 快照落地后,打开一次供应商表单就触发合并。三个遍历器现在一律跳过 `__proto__``constructor``prototype`;「已应用通用配置」的比对同时要求自有属性,顺带修掉一个可见怪象——`{"__proto__":{}}` 此前被判定为任何配置的子集。
### 终端启动的目录名命令注入
在外部终端恢复会话时,`cd` 行此前用双引号包裹工作目录、只转义反斜杠和双引号——双引号里 shell 照样展开 `$(…)`、反引号与 `$VAR`,而这个值是 CLI 会话历史里记录的真实项目路径,macOS 上目录名合法地可以包含这些字符。文件夹起了那样的名字,点「恢复」就会在你的终端里执行内嵌命令,全程无需任何被攻破的组件。三个拼 shell 行的启动器——Terminal.app、iTerm、kitty——改用 POSIX 单引号转义,任何内容都不展开(穿过 Terminal / iTerm 所需的 AppleScript 引号层同样安全);Ghostty、WezTerm / Kaku、Alacritty 本就把目录作为独立参数传递,原本安全。
### GrokBuild 凭据解析不再替换或内联环境密钥
GrokBuild 凭据提取此前在配置指定的 `env_key` 变量未设置时回落到进程级 `XAI_API_KEY`——静默替换成另一个账号的 key、发往配置指向的任意 base URL;凭据现在只来自显式的内联 `api_key``env_key` 精确命名的环境变量。深链导入不再把环境变量解析成明文 `api_key`;只带 `env_key` 名字的链接会被拒绝并提示手动添加——照单全收意味着请求时仍会解析受害者的环境密钥、送往链接声明的地址。顺带修复:base URL 解析与凭据解析解耦,此前凭据缺失连 base URL 一起清空,macOSGUI 进程不继承 shell 环境)上界面显示的地址与实际使用的不一致、用量脚本的 `{{baseUrl}}` 展开为空。([#5811](https://github.com/farion1231/cc-switch/pull/5811)
---
## 文档
### 「在 Claude Code 中使用 GPT 模型」攻略补齐英日双语
此前仅有中文的本地路由攻略现已完整移植为英文与日文,端到端覆盖两条接入路径:第三方 OpenAI Responses 网关(API Key),以及 ChatGPT Plus/Pro 订阅经 Codex 设备码 OAuth 登录。两篇路由攻略同时改题为「用什么模型」而非「什么客户端对」——《[在 Claude Code 中使用 GPT 模型](../guides/claude-codex-routing-guide-zh.md)》《[在 Codex 中使用 Claude 模型](../guides/codex-claude-routing-guide-zh.md)》——所有交叉链接(含三语 v3.18.0 release notes)改为指向读者语言的版本。
### 用户手册:深链 `usageEnabled` 默认值修正
三语用户手册的深链参考此前声称 `usageEnabled` 默认为 `true`,实际默认 `false`、与导入器一致。手册现在写明正确默认值,并补充两个推论:导入前确认框会完整显示脚本代码;未显式 `usageEnabled=true` 时脚本以禁用状态导入,可稍后在应用内开启。
### SECURITY.md:威胁模型与报告范围
`SECURITY.md` 补齐双语威胁模型与明确的范围内 / 范围外清单,报告按「谁控制这个输入」而非「值最终到了哪个 API」分诊:内置 WebView 渲染器声明为受信组件(附四条可独立验证的事实与失效触发条件);深链载荷、WebDAV / S3 恢复数据、导入文件、上游 API 响应、本地代理的入站请求全部列为不可信输入、欢迎报告。
---
## 升级提醒
### 本版没有数据库迁移
v3.19.0 不含 schema 迁移(版本号保持 v16),升级即用,无需等待数据重建。
### Gemini 密钥一次性清洗(请读)
升级后首次启动会在常规配置提取前执行一次性的 Gemini 通用配置清洗。**部分 Gemini 供应商随后可能提示缺少 API Key**:条目按凭据型键名加值全等匹配删除,通常删掉的是经共享片段泄漏进来的其它供应商凭据(该供应商自己的原值在泄漏发生时已被覆盖、无法找回)——但**你有意在多个 Gemini 供应商间复用的同值 key 也会被一并移除**。无论哪种情况,请先轮换再重填:**凡是进过共享 Gemini 片段的密钥都应视为已暴露**。删除的键名与受影响的供应商 id(绝不含值)记录在 `settings` 表的 `gemini_common_config_scrub_audit_v1` 下,可据此逐一定位需要重新填写密钥的供应商。
### 曾用深链导入过 MCP?建议检查一次(请读)
本版之前,`ccswitch://` 的 MCP 导入确认框可能**显示不出即将写入的内容**:参数与环境变量一概不渲染(`command: "sh"``args: ["-c", …]` 显示成一个无害的 `sh`),若载荷用 URL-safe Base64 编码,则整个列表显示成「0 个服务器」——而后端两种情况都照常把条目写进各应用的 live MCP 文件。这两条缺陷影响 **v3.8.0 起的所有版本**,本版一并修复。
利用需要你亲自打开攻击者提供的链接并点「导入」,因此绝大多数用户不受影响。**如果你确实从不完全信任的来源打开过 `ccswitch://` MCP 导入链接**,建议在 MCP 面板逐条核对,或直接检查 `~/.claude.json``mcpServers`Codex 见 `~/.codex/config.toml``mcp_servers`),确认没有你不认识的条目——MCP 服务器会在 CLI 下次启动时作为子进程执行。
### 深链用量脚本默认禁用
携带用量查询脚本的深链现在默认以禁用状态导入,除非链接显式携带 `usageEnabled=true`。依赖自动启用的链接(例如部分合作伙伴的一键配置链接)会导入脚本但不开启用量查询——审阅代码后在供应商编辑器里手动开启即可。应用内手工配置的用量脚本不受影响。
### 新默认模型只影响新建供应商
已保存的供应商维持创建时的模型 ID,想用新模型需手动编辑。Claude Desktop 的 opus 路由现值前进到 `claude-opus-5``claude-opus-4-8` 移入兼容别名槽,存量配置照常解析。
### 定价播种与本地定价文件
新定价行(`claude-opus-5``gemini-3.6-flash``grok-4.5-build`)在下次启动按「不存在才插入」追加——**播种绝不覆盖你改过的价格**。`~/.cc-switch/model-pricing.json` 创建时为空,只记录本版之后的手工改价与删价——更早的改价不会迁入,想让它们扛住数据库重建,重存一次即可。models.dev 自动同步保持关闭直到你手动开启;一旦开启,它是唯一会覆盖同名价格(内置与手工皆然)的路径。
### GrokBuild 隐式环境变量回落已移除
依赖隐式 `XAI_API_KEY` 环境回落的 GrokBuild 供应商,现在需要显式的 `api_key` 或正确命名的 `env_key`
### Grok 官方模式用量有意延迟
官方模式的 Grok 用量会延迟约十分钟加一个同步周期出现——事件先沉淀、再与代理记录的行核对防止双计;若路由流量与官方流量在窗口内交替,部分官方轮会被跳过而不是冒险重复计数。被旧成本回填高估过的 Grok Build 行保持原值——回填只处理零成本行,从不修订已有正成本。
### 更新镜像自下个版本起生效
更新器端点列表内置在应用二进制里,现有安装在升级到含本改动的版本之前仍然只查 GitHub;此后优先 `dl.ccswitch.io` 镜像、GitHub 回落。
### 赞助商域名迁移不改存量供应商
已创建的供应商保留数据库中存储的旧地址,仍指向旧域名。想迁到新域名,手动修改供应商地址,或从刷新后的预设重新创建。
---
## 风险提示
### SuperGrok 配额查询(本版新增)
供应商卡片的 SuperGrok 配额展示会读取 Grok CLI 自己的 OAuth 凭据(`~/.grok/auth.json`)并查询 grok.com 的计费端点——该端点并非公开文档化接口,其响应解析基于对现有格式的观察,xAI 调整接口后此功能可能失效(届时卡片降级为不显示配额,其余功能不受影响)。CC Switch 不会存储或修改这些凭据。
### 沿用的提示
**xAI Grok OAuth 登录**:复用官方 Grok CLI 的公开 OAuth 客户端身份,使用可能导致账号被限制或封禁——详见 [v3.18.0 release notes](v3.18.0-zh.md#风险提示)。
**Codex OAuth 反向代理**:使用 ChatGPT 订阅的 Codex OAuth 反代可能违反 OpenAI 服务条款,详情见 [v3.13.0 release notes](v3.13.0-zh.md#-风险提示)。
**第三方供应商路由**:通过 CC Switch 本地代理把 Codex、Claude Desktop 或 Grok Build 的请求转换并转发到第三方供应商时,各供应商对计费、合规与数据留存的约束不同,请在使用前阅读目标供应商的服务条款。
用户启用上述功能即表示自行承担相关风险。CC Switch 不对因使用这些功能而导致的任何账号限制、警告或服务暂停承担责任。
---
## 致谢
这一版的安全加固几乎全部来自外部——一个 PR,加上收到的安全报告。
### 代码贡献
- [#5811](https://github.com/farion1231/cc-switch/pull/5811)Skill 安装的 zip-slip 与仓库坐标穿越、Gemini 通用配置密钥泄漏与一次性清洗、GrokBuild 凭据解析、多处 panic 路径修复,感谢 @zayokami。这是本版单个来源里覆盖面最广的一份工作。
- [#5734](https://github.com/farion1231/cc-switch/pull/5734)models.dev 自动定价同步,感谢 @YUZHEthefool
- [#5626](https://github.com/farion1231/cc-switch/pull/5626)Codex fork 会话用量导入提速,感谢 @ayanamislover(与 @SaladDay 共同署名)。
### 安全报告
本版「安全加固」里的四条修复来自私下发来的安全报告。感谢 **23pds**SlowMist 慢雾)与 **zues devil**——逐条归属如下:
- **深链导入确认框只显示一行会被截断的 `Command:`**——`args``url``env` 一概不渲染,`sh -c``LD_PRELOAD` 的载荷在界面上看起来只是一个 `sh`。这是本版影响面最大的一条。(23pds,SlowMist
- **导入 SQL 备份未受约束**——`ATTACH DATABASE` 能在用户可写的任意位置创建文件,且副作用发生在导入自身的校验之前。(zues devil)
- **外部终端启动的目录名命令注入**——`cd` 行用双引号包裹,`$(…)` 照常展开,而这个值是会话历史里记录的真实项目路径。(zues devil 与 23pds 各自独立报告,分别指向内置启动器与自定义模板两条路径)
- **通用配置片段合并的原型污染**——三个遍历器都会跟着 `__proto__` 走进全局 `Object.prototype`。(23pdsSlowMist
报告同时促使我们补齐了 [SECURITY.md](../../SECURITY.md) 的威胁模型与报告范围——在此之前,这个项目只写了怎么报告,没写什么算漏洞。
其余两条深链修复(用量脚本默认禁用、URL-safe Base64 绕过)是在审查上述修复本身时发现的,不在原始报告内。
### 问题反馈
感谢在 [#4465](https://github.com/farion1231/cc-switch/issues/4465) 与 [#5663](https://github.com/farion1231/cc-switch/issues/5663) 中反馈代理读图撑爆上下文的用户——本版最重要的代理修复来自这些真实场景的复现线索。
---
## 下载与安装
访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本,或从官网 [ccswitch.io](https://ccswitch.io) 获取(本版起下载经 Cloudflare 边缘节点分发,不再依赖 GitHub 可达)。
### 系统要求
| 系统 | 最低版本 | 架构 |
| ------- | -------------------------- | ----------------------------------- |
| Windows | Windows 10 及以上 | x64 / ARM64 |
| macOS | macOS 12 (Monterey) 及以上 | Intel (x64) / Apple Silicon (arm64) |
| Linux | 见下表 | x64 / ARM64 |
### Windows
| 文件 | 说明 |
| ---------------------------------------- | ----------------------------------- |
| `CC-Switch-v3.19.0-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 |
| `CC-Switch-v3.19.0-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 |
Windows ARM64 设备请选择文件名中带 `arm64` 标识的对应制品。
### macOS
| 文件 | 说明 |
| -------------------------------- | --------------------------------------------- |
| `CC-Switch-v3.19.0-macOS.dmg` | **推荐** - DMG 安装包,拖入 Applications 即可 |
| `CC-Switch-v3.19.0-macOS.zip` | 解压后拖入 ApplicationsUniversal Binary |
| `CC-Switch-v3.19.0-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 |
Homebrew 安装:
```bash
brew install --cask cc-switch
```
更新:
```bash
brew upgrade --cask cc-switch
```
### Linux
Linux 资产同时提供 **x86_64****ARM64**`aarch64`)两种架构。资产文件名中包含架构标识,请按你机器的 `uname -m` 输出选择对应版本:
- `CC-Switch-v3.19.0-Linux-x86_64.AppImage` / `.deb` / `.rpm`
- `CC-Switch-v3.19.0-Linux-arm64.AppImage` / `.deb` / `.rpm`
| 发行版 | 推荐格式 | 安装方式 |
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb``sudo apt install ./CC-Switch-*.deb` |
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm``sudo dnf install ./CC-Switch-*.rpm` |
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
| Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR |
| 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |