Skip to content

Use core v0.57.0: search the whole history, upstream check-up, ID and card redaction - #264

Merged
fylorn merged 3 commits into
devfrom
core-v0.57.0
Oct 1, 2026
Merged

fylorn merged 3 commits into
devfrom
core-v0.57.0

Conversation

@fylorn

@fylorn fylorn commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Moves ThinkWatch Lite to core v0.57.0 (protocol 31) and builds the UI for its three additions.

Traffic: search the whole history

  • The page still loads the latest 2,000 requests and filters them on the spot. When that list is full, the same filter goes to POST /history/search, starting from the oldest loaded row, and older matches join the table.
  • A text-search toggle inside the search box ("Search content") also searches the content of requests and answers. Core reads payloads in budgeted pages, so this search starts from the newest request.
  • Each content match shows its excerpt in a row under the request, with the match highlighted.
  • The footer says how far back the search got and offers "Search further". With content search it also says from which day payloads are kept: earlier requests are matched by record only.
  • Error messages are matched as they are displayed. In the Chinese UI, the codes whose translation may contain the query are sent along (error_codes). Rows matched only by record are filtered again against the text on screen.
  • Rows matched at the start of a search stay in the table if new traffic later pushes them out of the 2,000-row list.
  • Changing the filter discards results still on their way. A failed page offers Retry.
  • The toggle is an icon, as in editor search boxes. As text, "Content" pushed the English placeholder out on Windows. As a separate button, the count and Clear wrapped to a second line at the default window width.

Upstreams: Check-up tab

GET /upstreams/health over 24 hours, 7 days, 30 days or a custom range. One row per upstream:

  • requests and failure rate (cancellations in the tooltip);
  • whether the model named in answers matches the one sent, with the differing pairs;
  • reported input relative to other upstreams serving the same model;
  • share of input read from the prompt cache, compared with other upstreams;
  • median TTFT and generation speed.

Everything comes with sample sizes, and no column draws conclusions. Amber marks a deviation only when both sides have enough samples (20 requests / 10 turns):

  • Input: the gap must be at least 25% in either direction, and only the upstream further from the local estimate is marked. With two upstreams on one model, the comparison is symmetric, so the honest side would otherwise be flagged too.
  • Cache: marked when other upstreams read at least 30% from cache and this one reads less than half of that.

The rules live in src/upstreams/checkup.ts, with tests.

Security

  • The new built-in rules cn-resident-id and bank-card get names, matcher descriptions (birth-year floor, card networks) and the "Personal information" group.

Plumbing

  • HistorySearch and UpstreamHealth are added to the webview whitelist (call.rs, control.ts).
  • Regenerated tw-api.ts.
  • rowFromHistory is shared between history loading and search. matches is factored out of filterRows.
  • The screenshot pipeline's mock core answers the two new endpoints.

README

  • Redaction now lists resident ID and bank card numbers.
  • New "Upstream check-up" highlight.
  • "Every request traceable" mentions searching the whole history, including request and answer text (en and zh).

Upgrade notes for the next release

  • Core 0.57.0 rebuilds the request store (schema 23): the request history is cleared on first start.
  • A remote core must be 0.57.0 (protocol 31).
  • Two redaction rules are on by default (resident ID numbers, bank card numbers).
  • Routing rules on input_tokens now see core's token-count estimate.

Checks

  • pnpm typecheck, pnpm build
  • vitest: 611 tests
  • cargo fmt --check, clippy --all-targets -D warnings, cargo test against the published twcore v0.57.0
  • Checked in the preview harness in zh/en, light/dark and macOS/Windows widths: placeholder fit, toolbar on one line except English on Windows, which already wrapped before.

🤖 Generated with Claude Code

fylorn and others added 3 commits October 1, 2026 22:47
… card redaction

Traffic search reaches the whole request history. The page loads the latest
2,000 requests and filters them on the spot as before; when the list is full,
the same filter goes to `POST /history/search` for the older records, and the
results join the table. A text-search toggle inside the search box also searches
the content of requests and answers (core reads the payloads in budgeted pages):
each match shows its excerpt under the row, and the footer says how far back the
search got, offers to search further, and from which day payloads are kept.
Error messages are matched as displayed: in the Chinese UI the codes whose
translation may contain the query go along, and rows matched only by record are
filtered again against the text on screen.

Upstreams get a Check-up tab (`GET /upstreams/health`) over 24 hours, 7 days,
30 days or a custom range: requests and failure rate, whether the model named in
the answers matches the one sent, reported input against other upstreams serving
the same model, the share of input read from the prompt cache, and median time to
first token and speed. Figures come with sample sizes; a deviation is shown in
amber only with enough samples on both sides, and for input only on the upstream
further from the local estimate, so the honest side of a two-upstream comparison
is not flagged.

The two new redaction rules (Chinese resident ID number, bank card number) get
their names, matcher descriptions and the "Personal information" group on the
Security page. Both endpoints are added to the webview whitelist, and the
screenshot pipeline's mock core answers them.

Upgrading to core 0.57.0 clears the request history (store schema 23) and needs
protocol 31 on a remote core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit a830bd8 into dev Oct 1, 2026
4 checks passed
@fylorn
fylorn deleted the core-v0.57.0 branch October 1, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant