Repository navigation
feat(proxies): show proxy accounts in settings on web and mobile - #728
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/proxy-accounts-ui
branch
from
November 14, 2026 15:06
9cb2743 to
6bf33eb
Compare
nixuuu
force-pushed
the
feat/proxy-accounts-gateway
branch
from
November 14, 2026 15:17
0e902de to
f456d2a
Compare
nixuuu
force-pushed
the
feat/proxy-accounts-ui
branch
from
November 14, 2026 15:18
6bf33eb to
b3a975d
Compare
nixuuu
force-pushed
the
feat/proxy-accounts-gateway
branch
from
November 14, 2026 15:40
f456d2a to
dbbcb43
Compare
nixuuu
force-pushed
the
feat/proxy-accounts-ui
branch
from
November 14, 2026 15:40
b3a975d to
83b2574
Compare
nixuuu
force-pushed
the
feat/proxy-accounts-gateway
branch
from
November 14, 2026 16:09
dbbcb43 to
48b1c63
Compare
nixuuu
force-pushed
the
feat/proxy-accounts-ui
branch
from
November 14, 2026 16:09
83b2574 to
852520a
Compare
nixuuu
marked this pull request as ready for review
November 14, 2026 16:09
Settings → Proxies gets a management key field and a compact list of the proxy's upstream accounts with Refresh. A proxy-backed provider instance shows which proxy it runs through and a summary of that proxy's accounts for its agent. Mobile shows the same, read-only.
nixuuu
force-pushed
the
feat/proxy-accounts-ui
branch
from
November 14, 2026 16:22
852520a to
4c7c467
Compare
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
Stage 3 of 3 (on #728). Adds proxy accounts to the sidebar usage glance from #726, using its typed `ProxyUsageSection` slot. Also has the gateway's first account check run shortly after startup. - **Popover, web and mobile:** one row per CLIProxyAPI proxy that a profile uses and whose accounts the gateway has read. The row shows "Through <proxy>" (truncated) over "N accounts · M cooling down" and links to the proxy card. Its accessible label is the full sentence "Through <proxy>: N accounts · M cooling down". - Plan windows are never inferred from these accounts. - Proxies without a key, unused proxies, unread or rejected accounts, and non-CLIProxyAPI proxies are left out. - **Trigger:** without plan usage but with proxy sections, the slot shows a connection icon instead of bars. The aria label lists both. - **Data source:** the existing shared `ListProxies` read, patched by `OverviewUpdate.proxy_accounts`. Reading it never calls a proxy. - **Gateway:** the first periodic check now runs about 15 s after startup instead of 5 min, so the sidebar fills without opening settings. - **Also in this stack (#728):** the mobile bot-chat failure card now uses the proxy wording for proxy instances, matching web. - **Tests and docs:** `sidebar-usage.test.ts` covers the section projection and text. `docs/provider-accounts.md` replaces the old "not rendered yet" note for `ProxyUsageSection`. ## Browser review Reviewed on a separate review host with a fake CLIProxyAPI and a Codex instance using the proxy, in light and dark at 1280 px: - With only a proxy (no plan usage), the trigger showed the connection icon. - The popover row read "Through Team CLIProxyAPI" over "3 accounts · 1 cooling down" and linked to the proxy card. - The first version truncated the counts ("1 co…"). Moving them to a second line fixed it. At phone width the page has no horizontal scroll. I did not check the popover itself on a phone: it closes when the sidebar collapses, and I didn't open the drawer. Mobile native visuals were not checked on a device, but the Android and iOS exports pass. The change is JS only, so the native fingerprint is unchanged. ## Checks typecheck, lint, format:check, gen:check, web build, `expo export` (android, ios). Domain tests pass, and the proxy-accounts, proxies, provider-usage and schema integration tests pass. ## Copy audit (§8) | Before | After | Reason | | --- | --- | --- | | (slot unused) | "Through Team CLIProxyAPI" / "3 accounts · 1 cooling down" | Names the proxy; counts are the proxy's accounts, not the user's plan. Short, no repeated facts. | | Trigger label "Show provider usage. Codex: 42% used" | "Show provider usage. … Through Team: 3 accounts · 1 cooling down" | The section is spoken too; the icon is never the only cue. | | (mobile bot failure) "A usage or turn limit was reached. … check your plan …" | "The proxy reported a usage limit. Wait for it to reset or check the proxy's accounts, then retry." | Same wording as web and as thread failures. |
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
## Change CLIProxyAPI account identities in Settings → Proxies now use the same click-to-reveal privacy component as Providers. Hidden values have no plaintext title, tooltip or accessible name; keyboard activation reveals the accessible value, Escape hides it, and the existing 30-second timeout remains. Truncated identities keep their layout on reveal. Account detail messages also use privacy protection because upstream messages can repeat a login. The sidebar Provider usage popover lists each proxy account with its provider, limit windows, percentage, compact bars, reset time and non-Active status. Accounts are grouped by provider, with the most-used windows first. A bounded internal scroller keeps large lists compact. Checked timestamps, loading, empty and error states use the existing cached data. No polling or refresh request was added; the shared ListProxies cache, overview feed and gateway lease remain responsible for reads. ## Identity audit - Settings → Proxies: account labels and detail messages protected; plaintext title removed. - Settings → Providers and sign-in completion: existing AccountStatusRow already uses Sensitive for emails; shared reveal behavior retained. - Sidebar limits and provider usage: direct providers show instance labels and computer names, not account email fields; their meters remain unchanged. Proxy account identities use the same protected row as Settings. - Proxy pickers select saved connections and contain no upstream account identities. - Thread import and provider sign-in flows do not separately render upstream account emails or logins. Explicit entry fields are unchanged. ## Validation `nice` install, typecheck, lint, format:check, web build and gen:check passed. Focused gateway/domain unit checks: 8 passing tests, 47 assertions. No UI test suite added. Browser review uses a disposable isolated stack and synthetic identities: light/dark, desktop/phone, DPR 1/2, short/typical/long emails, 1/6/30 accounts, internal scrolling, reveal/Escape and accessibility attribute inspection. The measured short email stayed 55.5 px wide on reveal; no hidden identity or host appeared in title/aria attributes. Window parsing now follows the reported duration, including daily, monthly and custom periods. A weekly-only Codex plan can put its weekly window in primary; an empty secondary is not a second quota. Empty zero watermarks are dropped for Codex and Claude. Plan names cross the gateway boundary as a closed enum; Codex's sanitized `id_token.plan_type` and passive plan header are supported. Other providers show a plan only if management exposes a recognized name. Raw JWTs are never decoded or downloaded. Additive proto fields and generated code are included. See docs/proxies.md for source links and limitations. Proxy hosts are also protected: the card, all three agent mapping lines, the edit form's read-only mappings, and the selected connection in proxy pickers. Scheme, port and path remain visible. Editable URL inputs remain readable. Plain URL picker descriptions were removed to avoid leaking through option tooltips or accessible labels. ## Copy audit New privacy labels: “Account identity”, “Account details”, “Proxy host” and “Proxy URL”; these describe hidden values without disclosing them. Proxy usage reuses “Through …”, “Checked …”, limit/reset labels, account statuses and the existing empty state. Error recovery adds “Open proxy settings to check access, then refresh.” New loading state: “Checking accounts…”. Plan labels use established subscription names (Free, Plus, Pro, Team, Business, Enterprise, Max, Max 5x/20x, Ultra, Other plan). Window names use “Daily”, “Monthly”, a numeric duration, or “Primary limit”/“Secondary limit” when only a slot is known. Sentence case, active voice, short sentences, action after errors, no new jargon or glossary terms, no humor, and no color-only meaning. Reviewed short/typical/long values at desktop and phone width. Related: #728, #731, #745 ## Reset timestamp follow-up The stage 1 review fixture used `2099-01-01T00:00:00Z`, causing the 26,345-day countdown. This was fixture data, not a seconds/milliseconds conversion defect. Corrected browser fixtures use resets one day and three hours ahead. The gateway now rejects reset timestamps more than 400 days ahead, and the shared formatter also hides implausible dates already cached. Codex `reset-at` and Claude reset headers remain epoch seconds; Codex `reset-after-seconds` remains relative to the quota observation. Realistic gateway fixtures cover these three paths, accidental millisecond epochs, the 400-day boundary and cached invalid dates. Follow-up checks: install, gen:check, typecheck, lint, format:check and web build passed. Focused gateway and capacity tests passed (11 tests, 74 assertions). Corrected stage 1 browser review confirmed one-day and three-hour countdowns. Copy audit: no new UI wording; unknown reset times omit the existing reset label while retaining usage readings. The CI integration fixture also contained an obsolete 2033 reset (`2000000000` epoch seconds), which the 400-day guard correctly discarded. The management integration suite now fixes its clock to the quota observation and uses a three-hour reset, restoring the real clock during cleanup. PostgreSQL lease timing continues to use real elapsed time. No production behavior or UI wording changed in this fixture correction. Repeated local validation: `proxy-accounts.test.ts`, `proxies.test.ts` and the gateway management tests passed together three consecutive times (24 tests, 177 assertions per run); the management integration and gateway tests also passed in an initial focused run. Typecheck, lint and format:check passed after the fixture correction.
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 2 of 2, on #727. UI for CLIProxyAPI upstream accounts on web and mobile.
@canopy/domain/proxy-accounts.OverviewUpdate.proxy_accounts.docs/proxies.md(UI),docs/copy.mdglossary (proxy account,management key).Browser review
Reviewed on a separate review machine, with a fake CLIProxyAPI giving 6 accounts:
Checked in light and dark, at 1280 px and a 390 px phone width:
The review found two problems, both fixed in this stack:
Checks
gen:check, typecheck, lint, format:check, web build,
expo export(android, ios). Tests:proxy-accounts,proxies,provider-usage,provider-usage-bots,schema, domain and worker unit tests. No UI tests, per policy.Copy audit (§8)
allow-remote-management.Glossary: added
proxy account(not "auth file" or "credential") andmanagement key(not "admin key").Also