Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Muse Code's subscription usage shows in Usage → Limits #25165

Openshawk08033(GitHub profile, opens in a new tab)wants to merge 23 commits intomain fromrefs/pull/25165/headopened View on GitHub

Problem

Muse Code subscription usage never appeared in Usage → Limits because the adapter ignored the account-wide usage/changed notification. After a server restart, waiting for a model reply also leaves limits unavailable even though Muse 1.4.13 can fetch them without a model turn. Addresses #18235.

Scope and approval

Supersedes #18274, rebased onto current main. Scope covers notification ingestion, on-demand CLI allowance reads, account attribution, and whole-state usage replacement. The usage-refresh work from closed draft https://git.cafe/pingdotgg/t3code/pulls/25760 is now included here at the contributor's request. Maintainer approval is not established; Macroscope requires human approval before merge.

Change

  • Forward and validate Muse's host-wide usage/changed reports, retaining the newest observation per provider instance and account generation. Malformed informational notifications do not end a session.
  • Use experimental account/read on the existing read-only catalog host to identify the login. Logout, API keys and account changes cannot reuse the previous account's reports. Managed snapshots recognize accountLogin labels as identity when no email is supplied.
  • On status refresh, signed-in Muse accounts on CLI 1.4.13 or newer run muse usage --json with the instance's configured binary, environment and working directory. Older or unknown versions skip the command. A four-second timeout, failed commands, malformed JSON and unknown schemas surface a provider warning while retaining the last valid same-account observation. Without retained usage, Limits shows the refresh error. Empty allowances still wait for the next reply.
  • CLI I/O runs outside the permit shared with live notifications. Account generations advance before the read; obsolete in-flight results are discarded, and newer streamed observations take precedence. CLI schema v1 omits session duration, so its session window uses an explicit five-hour assumption.
  • Provider-core supports whole-state usage replacement, clears stale failure markers, and preserves sparse-update behavior. Repeated reports advance freshness; expired windows show zero usage without retaining an old reset timestamp. Web, desktop, mobile and remote clients consume the shared server snapshots. Mobile labeling and user guidance include Muse.

Verification

  • The base implementation passed vp run check:changed, including focused tests, before the refresh extension.
  • Incremental vp run check:changed 722c2ea6af passed format, lint, both Knip checks, typechecks for 22 affected packages/dependents, and adjacent tests. Revalidated unchanged results after combining the branches.
  • Explicit tests across Muse adapter/status/catalog/usage/probe and provider-core usage/managed snapshots: 97 passed in 7 files.
  • Regression coverage includes CLI arguments/environment/cwd; empty, unsupported and malformed responses; version gating; API-key/logout handling; timestamp ordering; timeout; notifications during a stalled read; in-flight generation changes; and label/email account transitions. Three account-identity regression cases failed before their fix.
  • Live notification check in an isolated dev instance: a Muse message (hi → Hi, what can I help with?) changed the waiting banner to Session 9% left and Weekly 70% left.
  • Live CLI refresh check against signed-in Muse 1.4.13-R6996.1, starting with no retained observation: authenticated/ready, Session 1% used (reset 2026-10-27T09:01:18Z), Weekly 33% used (reset 2026-11-02T00:00:00Z), with Meta's asOfMs as the observation time. No model message was sent. A fresh MSP usage/read returned {} while the CLI supplied allowance.
  • Opus 5.5 and Grok 4.7 independently reviewed the initial CLI extension. Their notification-lock and account-label findings were fixed with regression tests, and the suggested version gate was added. They have not re-reviewed the final revision.
  • Not exercised: Windows runtime, older native Muse binaries, mobile/desktop UI, or multi-environment deduplication. Compatibility failures use fake CLI fixtures; concurrency and timeout tests use Deferred/TestClock.

Model: GPT-6.1 Sol | Harness: Codex in T3 Code. Original implementation by @ntindle (https://git.cafe/pingdotgg/t3code/pulls/18274); initial rebase and live notification verification with muse-wonder-1.0 via Muse Code in T3 Code. Additional review by Claude Opus 5.5 and Grok 4.7.

Latest branch update

Merged main at bbdc7dca320e. Usage refresh failures now surface through the shared provider warning/message and, without retained usage, the Limits error message. Last valid same-account limits remain visible. Five regression cases failed before the fix and pass afterward.

vp run check:changed upstream/main passed format, lint, both Knip checks, typechecks for 27 packages, 129 tests across 10 files, and the React Compiler check. GitHub CI is running for 72a16ae7127bd6497b308409924cad0c71e622d1.

Update by GPT-6.1 Sol via Codex in T3 Code.

Fixes pingdotgg/t3code#18235

    1. Pushed202aca3

    2. github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase

    3. This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

      See the conflict window.

Sign in to join this conversation.