Skip to content

ThinkWatch Core 0.79.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 11:51
· 39 commits to main since this release

This release turns an upstream's 429 into a short wait instead of an error, and adds usage limits to upstreams.

Upgrade notes

  • The control-plane protocol version is now 51. Use the ThinkWatch Lite release that ships with 0.79.0; earlier Lite releases cannot connect.
  • The request store's schema is unchanged; nothing is cleared.
  • failover.slot_wait_secs is replaced by failover.wait_secs (default 120 seconds, up to 600). A configuration that still sets slot_wait_secs starts in safe mode; the repair removes the key, and its value is not carried over.
  • An upstream's 429 no longer counts as a failure: it does not open the breaker and does not lower the upstream's success rate.

Rate limits become a wait.

  • When an upstream answers 429, the whole upstream pauses until its retry-after-ms, Retry-After or the delay in the error body; without one, it backs off 5, 10, 20, 40 and then 60 seconds, and a success resets the count.
  • Requests for it wait in the gateway, one queue per upstream, and are sent again once it recovers. When the pause ends, only the first request goes out; the rest follow once it gets a real answer. A request that has another upstream it can use right away goes there instead.
  • A conversation that is held on an upstream for its prompt cache waits for that upstream when it can recover in time.
  • A lone upstream is waited for as well.
  • Every wait of a request (gateway key limits, concurrency slots, rate-limit pauses, upstream usage limits) shares one deadline, failover.wait_secs. Streaming clients get their response head and keep-alives while they wait, so they only see a slower first token.
  • When the deadline passes, the client gets a 429 with Retry-After for the earliest recovery. When every upstream has used up its daily, weekly or monthly limit, x-should-retry is false.

Upstream usage limits.

  • An upstream can carry limits in the same form as gateway key limits: requests, tokens or cost per minute, hour, day, week or month.
  • every sets the window to several minutes or hours, for example { per: minute, every: 5, tokens: 10000000 }. Gateway key limits accept every too.
  • A full minute or hour window makes requests switch to another upstream or wait. A used-up day, week or month is skipped until it resets.
  • Each request sent to the upstream counts, except one it answered with 429. Tokens and cost come from the answer. Calendar periods are rebuilt from the request records after a restart.

New in the control-plane API.

  • Upstreams carry throttle (paused, window full or period used up, until when) and limits with their live usage.
  • New events: ThrottleChanged, RequestQueued and RequestDequeued.
  • Attempts can be skipped as throttled, window_full or period_used_up, and carry pause_ms when the upstream answered 429.

Plugins on Windows. The plugin CPU limit on Windows used wall time, so time the thread spent waiting for the processor counted against the plugin. It now charges the smaller of the wall time and the thread's CPU time plus one clock tick.

Security. The plugin sandbox's Wasmtime is updated to 49.0.4 for RUSTSEC-2026-0378 and RUSTSEC-2026-0379 (a Cranelift fault on aarch64 that could jump to the wrong target on a large br_table).

Downloads

Platform Binary Archive for server installation
Linux, x86_64 twcore-x86_64-unknown-linux-gnu twcore-x86_64-unknown-linux-gnu.tar.gz
Linux, aarch64 twcore-aarch64-unknown-linux-gnu twcore-aarch64-unknown-linux-gnu.tar.gz
macOS, Apple silicon twcore-aarch64-apple-darwin —
Windows, x64 twcore-x86_64-pc-windows-msvc.exe —
Windows, ARM64 twcore-aarch64-pc-windows-msvc.exe —

Each file is published with a .sha256 file beside it. A Linux archive contains twcore, the systemd unit twcore.service and LICENSE. ThinkWatch Lite includes its own copy of twcore; the files here are for running core separately, such as on a server.

Server installation

On Linux (x86_64 or aarch64), the install script sets up twcore as a systemd service. This installs 0.79.0:

curl -fsSL https://raw.githubusercontent.com/ThinkWatchProject/ThinkWatch-Core/main/scripts/install.sh | sudo sh -s -- --version 0.79.0

An installation made with the script switches to 0.79.0 with:

sudo twcore upgrade --version 0.79.0 --restart

Configuration, the remote control port and connecting ThinkWatch Lite are described in docs/server.md.

Verifying a download

A .sha256 file holds the SHA-256 of the file followed by its name. With both files in the current directory, on Linux:

sha256sum -c twcore-x86_64-unknown-linux-gnu.tar.gz.sha256

On macOS:

shasum -a 256 -c twcore-aarch64-apple-darwin.sha256

On Windows, in PowerShell, the following prints True when the binary matches:

(Get-FileHash .\twcore-x86_64-pc-windows-msvc.exe).Hash -eq (Get-Content .\twcore-x86_64-pc-windows-msvc.exe.sha256).Split()[0]

The install script and twcore upgrade check the SHA-256 themselves.

What's Changed

  • Queue requests on upstream 429; upstream usage limits by @fylorn in #362
  • CI: run tests with nextest; fix two tests waiting out the 429 backoff by @fylorn in #363
  • Plugins: time the CPU budget with the thread's CPU time on Windows too by @fylorn in #364
  • v0.79.0 by @fylorn in #365

Full Changelog: v0.78.0...v0.79.0