From 3326398424b7c4f2572bcc1bc9154ff6544469c5 Mon Sep 17 00:00:00 2001 From: fylorn <249551762+fylorn@users.noreply.github.com> Date: Sun, 27 Sep 2026 22:40:10 +0800 Subject: [PATCH] chore: v0.53.0 Minor release for #217 and #218. - Bump the workspace version to 0.53.0 - release-notes/0.53.0.md Control-plane protocol 26 (was 25): ProviderView and ProviderInput carry forward_client_identity. The request store schema is unchanged (21). Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 34 +++++++++++++++++----------------- Cargo.toml | 2 +- release-notes/0.53.0.md | 27 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 release-notes/0.53.0.md diff --git a/Cargo.lock b/Cargo.lock index 0a65b590..5535df50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2492,7 +2492,7 @@ dependencies = [ [[package]] name = "tw-api" -version = "0.52.1" +version = "0.53.0" dependencies = [ "serde", "serde_json", @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "tw-breaker" -version = "0.52.1" +version = "0.53.0" dependencies = [ "serde", "serde_json", @@ -2510,7 +2510,7 @@ dependencies = [ [[package]] name = "tw-config" -version = "0.52.1" +version = "0.53.0" dependencies = [ "blake3", "libc", @@ -2534,7 +2534,7 @@ dependencies = [ [[package]] name = "tw-control" -version = "0.52.1" +version = "0.53.0" dependencies = [ "axum", "base64", @@ -2573,7 +2573,7 @@ dependencies = [ [[package]] name = "tw-dialect" -version = "0.52.1" +version = "0.53.0" dependencies = [ "serde", "serde_json", @@ -2581,7 +2581,7 @@ dependencies = [ [[package]] name = "tw-engine" -version = "0.52.1" +version = "0.53.0" dependencies = [ "serde", "serde_json", @@ -2594,7 +2594,7 @@ dependencies = [ [[package]] name = "tw-gateway" -version = "0.52.1" +version = "0.53.0" dependencies = [ "arc-swap", "async-stream", @@ -2639,7 +2639,7 @@ dependencies = [ [[package]] name = "tw-guard" -version = "0.52.1" +version = "0.53.0" dependencies = [ "base64", "regex", @@ -2652,7 +2652,7 @@ dependencies = [ [[package]] name = "tw-link" -version = "0.52.1" +version = "0.53.0" dependencies = [ "serde", "serde_json", @@ -2666,7 +2666,7 @@ dependencies = [ [[package]] name = "tw-observe" -version = "0.52.1" +version = "0.53.0" dependencies = [ "tokio", "tracing", @@ -2675,7 +2675,7 @@ dependencies = [ [[package]] name = "tw-pricing" -version = "0.52.1" +version = "0.53.0" dependencies = [ "arc-swap", "flate2", @@ -2688,14 +2688,14 @@ dependencies = [ [[package]] name = "tw-secret" -version = "0.52.1" +version = "0.53.0" dependencies = [ "thiserror", ] [[package]] name = "tw-store" -version = "0.52.1" +version = "0.53.0" dependencies = [ "bytes", "rusqlite", @@ -2712,7 +2712,7 @@ dependencies = [ [[package]] name = "tw-types" -version = "0.52.1" +version = "0.53.0" dependencies = [ "serde", "serde_json", @@ -2721,7 +2721,7 @@ dependencies = [ [[package]] name = "tw-watch" -version = "0.52.1" +version = "0.53.0" dependencies = [ "notify", "tempfile", @@ -2731,7 +2731,7 @@ dependencies = [ [[package]] name = "tw-yaml" -version = "0.52.1" +version = "0.53.0" dependencies = [ "saphyr-parser", "serde_yaml_ng", @@ -2741,7 +2741,7 @@ dependencies = [ [[package]] name = "twcore" -version = "0.52.1" +version = "0.53.0" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index e9e0d6ea..616d931b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ categories = ["network-programming", "web-programming::http-server"] # 二进制走 CalVer,crate 走 SemVer —— 两者是两回事,卖给不同的人。 # 这里是 crate 的版本。 -version = "0.52.1" +version = "0.53.0" [workspace.dependencies] # ── 内部 crate ─────────────────────────────────────────── diff --git a/release-notes/0.53.0.md b/release-notes/0.53.0.md new file mode 100644 index 00000000..8f785bf3 --- /dev/null +++ b/release-notes/0.53.0.md @@ -0,0 +1,27 @@ +This release changes what ThinkWatch sends to upstreams. Each upstream now receives the request and only the headers it needs; the client's own identity stays with ThinkWatch unless an upstream asks for it. It also fixes two problems with ChatGPT account upstreams. + +**Upgrade notes** + +- The control-plane protocol version is now 26 (it was 25). The request store's schema is unchanged (21). ThinkWatch Lite 2026.9.20 includes 0.52.1 (protocol 25) and does not connect to 0.53.0, so a server used with it stays on 0.52.x until the app is updated to a release that includes 0.53.0. +- Upstreams now see ThinkWatch's `User-Agent` instead of the client's. An upstream that admits only certain clients, such as Kimi For Coding, Bailian Coding Plan or a relay restricted to official clients, needs the new provider field `forward_client_identity: true`. +- New message code: `config.credential.chatgpt_client_identity`. + +**Each upstream gets only what it needs.** Client request headers used to reach the upstream almost unchanged. Only credentials, a few transport headers and, when a request was translated, the client format's own protocol headers were removed. Claude Code's `User-Agent`, `x-app`, `x-stainless-*` and session ID, Gemini CLI's installation ID and a browser client's `Cookie` and `Origin` all went through. Outbound headers now come from three sources only: +- **Set by ThinkWatch**: its own `User-Agent`, and `content-type` when the body was translated. +- **The upstream's configuration**: the credential and the headers written there. `OpenAI-Organization` and `OpenAI-Project` belong here, because they belong to the upstream's key. +- **The client's request**, only for the headers the upstream's protocol uses: + - Anthropic: `anthropic-*`, except `anthropic-dangerous-direct-browser-access`. + - OpenAI: `Idempotency-Key` and `X-Client-Request-Id`. + - Gemini: none. + - Every protocol: `content-type` and `accept` when the body passes through unchanged. + +An Anthropic request without `anthropic-version` now gets the default one. When the body passes through unchanged, identity fields that clients fill in themselves are removed from it: Claude Code's `metadata.user_id`, and the Codex installation ID and turn metadata in `client_metadata`. + +**`forward_client_identity`.** With this field on, an upstream also receives the client's own `User-Agent`, `x-app`, `originator`, `version`, `session_id` and `x-codex-*` headers, and the body's identity fields are kept. These are the client's own values; nothing is made up. The field is off by default. A ChatGPT account upstream refuses it: that upstream always names ThinkWatch as the sender. + +**ChatGPT account upstreams.** +- **New models were missing from the list.** The Codex backend leaves a model out of the list when its minimum client version is above the `client_version` that the caller reports. ThinkWatch reported `0.0.0`, so a model such as gpt-6-luna, which needs Codex 0.155.0, was not listed, and requests for it were refused with "No upstream serves model …" even though the account can use it. ThinkWatch now reports `99999.0.0`, so the list shows every model the account can use. Requests still name ThinkWatch as their origin. +- **The ChatGPT app's identity is no longer forwarded.** The Codex inside the ChatGPT desktop app adds an attestation generated by the app (`x-oai-attestation`), its installation ID and turn metadata. ThinkWatch forwarded them together with the token it had obtained itself, and on one account OpenAI revoked that token within seconds of the first such request. + - From the client, the Codex backend now receives only `x-codex-turn-state`, `x-openai-internal-codex-responses-lite` and `x-codex-beta-features`. + - The attestation, installation ID and turn metadata cannot be set in an upstream's configured headers. +- **Request bodies are compressed.** Requests to the Codex backend are compressed with zstd, which is what Codex does when it talks to that backend itself.