Repository navigation
Upstreams: one account label everywhere, read from the token; no live call for a broken sign-in - #205
Merged
Merged
Conversation
… call for a broken sign-in - The edit dialog's sign-in box keeps saying which account it is (email and plan, from ProviderView.oauth.account) when the sign-in has expired, with the invalid state as a status label next to it, like the table row. The dialog header names the account where other upstreams show their address. - The ChatGPT sign-in dialog's "done" state names the account (email and plan) from the same place the row and the edit dialog read. It reads the upstream view once after core reports the sign-in done (core writes the config first), instead of ChatgptLoginStatus.plan, which only arrived when the 2 s poll beat the login_finished event, so the plan was usually missing. - The Z.ai sign-in dialog had the same race for its account name: the event now triggers one status read. Both dialogs settle a sign-in once. - No live ChatgptUsage / ChatgptResets call for an account whose sign-in has expired: not on page open (quotaAccounts) and not in the account section, which then shows only the sign-in box. - Command palette: account upstreams show and match their email, and say "Sign in again" like the row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 25, 2026
Merged
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.
What this changes
Account upstreams now carry the same label everywhere, all read from
ProviderView.oauth.account(core v0.48.0 reads the email and plan from the credential's own token, with no network call):dev@example.com · Plus ● 登录已失效, with the reason below and the re-login button. Before, it replaced the email and plan with "登录已失效", while the table row next to it still showed both. The dialog header names the account where other upstreams show their address (chatgpt · ChatGPT 账号 · dev@example.com), the same way the row does, so the account is still visible on the Models and Billing tabs.账号 work@example.com,订阅类型 Pro (More)。The line reads the upstream view once after core reports the sign-in done. Core writes the config before it reports, so this is the new account, also after a re-login into a different account. It is on its own line, so the plan name no longer wraps mid-word.oauth.needs_loginis set, the page no longer callsChatgptUsagefor that account on open (quotaAccounts). The Account section no longer callsChatgptUsage/ChatgptResetseither, and shows only the sign-in box. Both calls fail without a token anyway, and the error used to repeat the sign-in box's reason. Accounts that work still get oneChatgptUsageon page open, for the cold-start quota bar in the row. That is the only remaining page-level call, and nothing uses it for the label.chatgpt.comand can be found by it. A broken sign-in shows "需要重新登录", the same label as the row.Why
The v0.48.0 bump (#202) moved the row and the sign-in box to
oauth.account, but a few places still disagreed. The sign-in dialog's done state took its plan fromChatgptLoginStatus.plan, and that field only arrives through the 2-second poll. Thelogin_finishedevent, which normally lands first, has no plan, so the plan was usually missing, and the email was never shown. The Z.ai dialog had the same race forZaiLoginStatus.account. The event now triggers one status read there, and both dialogs settle a sign-in only once, even when the event and a poll both report it.How it was verified
pnpm typecheck,pnpm testandpnpm build, on the latest dev. New tests:quotaAccountsskips disabled accounts, accounts with a broken sign-in and other upstreams, and the palette finds an account upstream by its email and labels a broken sign-in. Rust is untouched.login_finished, afterconfig_reloaded, like core. A re-login switches the account towork@example.comon Pro.?issues(chatgpt needs sign-in): noChatgptUsagecall on page open, and none when the Account section opens. The sign-in box readsdev@example.com · Plus ● 登录已失效with the translatedgw.oauth.expiredreason, and there are no quota or credits sections. Re-login → done shows账号 work@example.com,订阅类型 Pro (More)。→ the row becomeschatgpt [Pro (More)] ChatGPT 账号 · work@example.com, and the page then asksChatgptUsageonce for its quota.ChatgptUsageon page open. The dialog header shows… · dev@example.comon all three tabs. A new ChatGPT sign-in completes in about 3.3 s, driven by the event and not by the next poll, with账号 dev2@example.com,订阅类型 Plus。, and the new row shows the same account. A Z.ai sign-in completes through the event with账号 dev@example.com。dev@findschatgpt dev@example.com ● 需要重新登录, and other upstreams still show their host.🤖 Generated with Claude Code