diff --git a/Cargo.lock b/Cargo.lock index aa2b43b3..3f760c20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2492,7 +2492,7 @@ dependencies = [ [[package]] name = "tw-api" -version = "0.50.0" +version = "0.51.0" dependencies = [ "serde", "serde_json", @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "tw-breaker" -version = "0.50.0" +version = "0.51.0" dependencies = [ "serde", "serde_json", @@ -2510,7 +2510,7 @@ dependencies = [ [[package]] name = "tw-config" -version = "0.50.0" +version = "0.51.0" dependencies = [ "blake3", "libc", @@ -2534,7 +2534,7 @@ dependencies = [ [[package]] name = "tw-control" -version = "0.50.0" +version = "0.51.0" dependencies = [ "axum", "base64", @@ -2573,7 +2573,7 @@ dependencies = [ [[package]] name = "tw-dialect" -version = "0.50.0" +version = "0.51.0" dependencies = [ "serde", "serde_json", @@ -2581,7 +2581,7 @@ dependencies = [ [[package]] name = "tw-engine" -version = "0.50.0" +version = "0.51.0" dependencies = [ "serde", "serde_json", @@ -2594,7 +2594,7 @@ dependencies = [ [[package]] name = "tw-gateway" -version = "0.50.0" +version = "0.51.0" dependencies = [ "arc-swap", "async-stream", @@ -2638,7 +2638,7 @@ dependencies = [ [[package]] name = "tw-guard" -version = "0.50.0" +version = "0.51.0" dependencies = [ "base64", "regex", @@ -2651,7 +2651,7 @@ dependencies = [ [[package]] name = "tw-link" -version = "0.50.0" +version = "0.51.0" dependencies = [ "serde", "serde_json", @@ -2665,7 +2665,7 @@ dependencies = [ [[package]] name = "tw-observe" -version = "0.50.0" +version = "0.51.0" dependencies = [ "tokio", "tracing", @@ -2674,7 +2674,7 @@ dependencies = [ [[package]] name = "tw-pricing" -version = "0.50.0" +version = "0.51.0" dependencies = [ "arc-swap", "flate2", @@ -2687,14 +2687,14 @@ dependencies = [ [[package]] name = "tw-secret" -version = "0.50.0" +version = "0.51.0" dependencies = [ "thiserror", ] [[package]] name = "tw-store" -version = "0.50.0" +version = "0.51.0" dependencies = [ "bytes", "rusqlite", @@ -2711,7 +2711,7 @@ dependencies = [ [[package]] name = "tw-types" -version = "0.50.0" +version = "0.51.0" dependencies = [ "serde", "serde_json", @@ -2720,7 +2720,7 @@ dependencies = [ [[package]] name = "tw-watch" -version = "0.50.0" +version = "0.51.0" dependencies = [ "notify", "tempfile", @@ -2730,7 +2730,7 @@ dependencies = [ [[package]] name = "tw-yaml" -version = "0.50.0" +version = "0.51.0" dependencies = [ "saphyr-parser", "serde_yaml_ng", @@ -2740,7 +2740,7 @@ dependencies = [ [[package]] name = "twcore" -version = "0.50.0" +version = "0.51.0" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index 7a96c177..860d9c06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ categories = ["network-programming", "web-programming::http-server"] # 二进制走 CalVer,crate 走 SemVer —— 两者是两回事,卖给不同的人。 # 这里是 crate 的版本。 -version = "0.50.0" +version = "0.51.0" [workspace.dependencies] # ── 内部 crate ─────────────────────────────────────────── diff --git a/release-notes/0.51.0.md b/release-notes/0.51.0.md new file mode 100644 index 00000000..473e03ed --- /dev/null +++ b/release-notes/0.51.0.md @@ -0,0 +1,13 @@ +This release stops counting the MCP tool calls of the older GLM Coding Plans as a quota, marks only the weekly window when a model request gets business code 1310, and tells the app at once when a GLM key turns out to have no plan. + +**Upgrade notes** + +- The control-plane protocol version (`CONTROL_API_VERSION`) is now 24. ThinkWatch Lite connects only to a core with the same protocol version, and has to regenerate its protocol types from this release to use it. ThinkWatch Lite 2026.9.17 includes 0.49.0 (protocol 22) and no released version of the app includes 0.50.0, so a server used with the app stays on 0.49.x until the app is updated to a release that includes 0.51.0. `sudo twcore upgrade --version 0.49.1 --restart` switches a server back to 0.49.1. +- The request store's schema is unchanged (21). Upgrading from 0.50.0 keeps the request history. Upgrading from 0.49.x or earlier replaces the request history and the stored bodies with an empty store on the first start, as 0.50.0 does; the configuration is kept. Switching back to 0.49.x empties it again. +- Changed in the protocol: the quota window `monthly` is gone, and a `QuotaSeen` with empty `windows` means the upstream's quota was taken down. No endpoint, type or message code changed. + +**MCP calls are not a quota.** The quota endpoint of the older GLM Coding Plans also reports a count (`TIME_LIMIT`) of calls to Z.ai's own MCP tools: search-prime, web-reader and zread. Those calls do not go through the gateway, so the count says nothing about the requests it forwards. Core no longer reads it: there is no `monthly` window, and a used-up count no longer marks the upstream used up or emits `QuotaExhausted`. `credits` are reported only for the windows of credit-based plans (`CREDIT_LIMIT`). + +**1310 is the weekly quota.** A 429 with business code 1310 on a model request marks the `weekly` window used up, whatever its message says. 1308 still marks the 5-hour window. For 1316 to 1321 the window still comes from the message when it names the 5-hour or weekly window; otherwise it is the fuller of the two known windows, or the weekly one when neither is known. + +**A key without a plan.** When a GLM key is found to have no plan, core clears the quota it had stored for that upstream and emits a `QuotaSeen` with empty `windows`, so the app removes the quota at once instead of on its next read of `/quota`.