Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(usage): deduplicate CLI proxy subscription accounts #9584

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/9584/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

The Limits view can show the same subscription twice when an account is signed in through a provider instance and reported by a CLIProxyAPI hub. The proxy badge at the far right makes those rows harder to scan.

Prefer native provider limits when the provider kind and normalized email match, including matches across connected environments. Keep hub limits when the native provider has no usable windows, and retain the hub's management controls when all its accounts are represented by native providers.

Show the provider kind with a small inline instance name or CLI Proxy label on web, desktop, and mobile. Remove the right-aligned badge and repeated source-kind heading.

Verification

  • 20 focused usage-limits tests pass, covering matching identities, non-matches, unavailable native providers, cross-environment matches, and account restoration.
  • Shared, web, and mobile typechecks pass.
  • Targeted lint and formatting pass.
  • Actual web preview and iOS development-client checks pass: the matching proxy account disappears, other accounts remain, instance labels are inline, and the native reset-credit details remain available. The reset-credit and hub-removal confirmation dialogs still open and cancel correctly on web; no credits were redeemed.
  • Wire contracts and provider adapters are unchanged. Deduplication uses streamed config, so local, remote, relay, and tunnel connections use the same logic.
  • Desktop uses the verified web component. The Electron shell and Android were not separately exercised.

Before/after evidence

Actual base 2675e3c and head 56a4912, using the same synthetic accounts, fixed clock, 1280 × 800 viewport, and scroll position in an isolated environment. Captures are unaltered frames from the collaborative browser recordings. Capture-only fixtures are not included in the commit.

Before

The personal Codex subscription appears twice and proxy labels sit at the far right.

Before: duplicate personal Codex account and right-aligned proxy badges

After

The native Personal instance keeps its session, weekly limits, and reset credits. Other proxy accounts remain, with small inline labels.

After: native Codex account retained once, with inline instance and CLI Proxy labels

Readiness

All applicable CI and configured review checks passed at 56a4912. Macroscope approved that head; there are no unresolved review threads or active change requests. The final whole-PR audit found no blockers.

Expected skipped jobs: Mobile Native Static Analysis (native-change detector reports no native changes), EAS Preview (opt-in deployment label absent), PR size label-definition sync (excluded for pull_request_target), and the opt-in [code]smith autofix service. No checks were disabled or bypassed.

Ready for Julius's review; unmerged. Merging is left to Julius, with no auto-merge or merge queue enabled.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.8 KiB13.5 KiB−218 B (−1.5%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB+2 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.7 KiB6.5 KiB−220 B (−3.2%)7.8 KiB✅
      CodexLive turn WebSocket decoded58.5 KiB57.0 KiB−1.5 KiB (−2.6%)66.4 KiB✅
      CodexLive turn messages108−2 (−20.0%)21✅
      ClaudeTotal thread wire13.8 KiB13.5 KiB−215 B (−1.5%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.0 KiB+7 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.7 KiB6.5 KiB−222 B (−3.2%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded59.3 KiB57.8 KiB−1.5 KiB (−2.5%)66.4 KiB✅
      ClaudeLive turn messages108−2 (−20.0%)21✅

      Baseline: 2675e3c · PR result: 56a4912 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.8 KiB
      • Claude decoded thread snapshot: 114.5 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. Approvability

      Verdict: Approved at 56a4912

      Macroscope's review found this PR approvable — This is a contained usage-display bug fix that deduplicates CLI proxy accounts while preserving fallback rows when native limits are unavailable. The shared filtering logic is covered by focused tests, and the remaining changes are presentation, documentation, or test-only updates.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge merged thisb34ff8f

    5. juliusmarminge closed this

Sign in to join this conversation.