Skip to content

feat: say a session was served by a subscription instead of calling it unpriced - #65

Merged
fylorn merged 1 commit into
devfrom
feat/subscription-sessions
Sep 20, 2026
Merged

fylorn merged 1 commit into
devfrom
feat/subscription-sessions

Conversation

@fylorn

@fylorn fylorn commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

A session whose turns all went to a subscription upstream — Codex on a ChatGPT account, say — showed 无法计价 in the sessions list, with the tooltip "此会话中没有可计价的轮次". Every turn in its detail said the same. The overview, meanwhile, reported those very requests as 订阅额度 N 次. The page read as a pricing failure where there was nothing to price.

The protocol was the reason: session aggregation counted subscription turns as neither priced, unpriced nor no-usage, and SessionView had no fourth number, so "all subscription" and "nothing priceable" arrived in the same shape. TurnView had the same gap — a subscription turn's cost_micros is null, and nothing else said why. ThinkWatch-Core#49 added subscription_turns and TurnView.billing; this pins core v0.9.1 and renders them.

What the page says now

  • The cost cell: 订阅额度 N 轮, the overview's own wording with this page's unit. Next to an amount it is set off with a middle dot rather than a plus — "+N 轮无法计价" means money missing from the total, and subscription turns have none: $0.412 · 订阅额度 12 轮.
  • Each turn in the detail reads 订阅额度 where it used to read 无法计价.
  • Measured, estimated, unpriced and no-usage stay exactly as they were, including a session with no priceable turns at all, which still reads 无法计价.

The fallbacks for cores that did not send priced_turns, no_usage_turns, cost_micros_estimated, cancelled or cost_estimated are gone; the pinned core sends all of them.

Checked

pnpm typecheck, pnpm test (118), pnpm build, scripts/version.sh, cargo fmt --check, cargo clippy --all-targets -D warnings and cargo test all pass against core v0.9.1.

Verified visually in an isolated preview with mocked sessions: all-subscription, subscription mixed with priced turns, a session with all four states plus subscription, unpriced-only, unpriced with subscription, and all-failed — in light and dark, with the tooltip and the detail dialog driven by real clicks.

🤖 Generated with Claude Code

…t unpriced

A session whose turns all went to a subscription upstream (Codex on a
ChatGPT account) showed "cannot be priced" in the sessions list, and every
turn in its detail said the same, while the overview reported the same
requests as subscription usage. Core now reports subscription_turns per
session and billing per turn, so the page no longer has to guess from a
missing amount.

- The cost cell reads 订阅额度 N 轮, the overview's wording with the page's
  unit. After an amount it is set off with a middle dot rather than a plus:
  "+N 轮无法计价" means money missing from the total, and subscription
  turns have none.
- Each subscription turn in the detail reads 订阅额度 instead of 无法计价.
- Measured, estimated, unpriced and no-usage turns render as before; the
  fallbacks for cores that did not send priced_turns and the other
  optional session fields are gone.

Pins core v0.9.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 6e4e80e into dev Sep 20, 2026
2 checks passed
@fylorn
fylorn deleted the feat/subscription-sessions branch September 20, 2026 02:11
fylorn added a commit that referenced this pull request Sep 20, 2026
The last file on the pending list. It waited for the subscription-session
change (#65), which added the turns served by a subscription and the
wording that goes with them; translating before that landed would have
meant translating text that was about to be rewritten.

The cost cell says the same things as the overview — estimated, unpriced,
no usage, subscription — so it uses the same wording, differing only in
the unit: the overview counts requests, this page counts turns.

The pending list is now empty. It stays as a guard: a new file with
Chinese in it fails the test.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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