Repository navigation
feat: sign in with a ChatGPT account, and spend reset credits on request - #40
Merged
Merged
Conversation
Pins core v0.5.0, whose control plane runs the login. - "Service type" in the new-upstream dialog offers a ChatGPT account. It opens a login dialog: the risks first, then a name and an egress proxy, then the browser. core waits for the callback and writes the upstream, and the dialog settles on the login event with polling as a fallback. - The app registers thinkwatch://, so the page the browser lands on can bring the app back to the front, recreating the window when it was closed. The authorize URL stays on the Rust side: the webview never hands the app a URL to open. - A ChatGPT account has a "Quota and reset credits" dialog: the windows with their reset times, and the credits with an explicit confirmation before one is spent. A credit cannot be refunded, so it is only ever spent when asked for, with an idempotency key, and never by the gateway. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
Phase 4 of the ChatGPT account work, the desktop half. It pins core v0.5.0, whose control plane runs the login (Core#38).
Signing in
login_finishedevent. Polling every two seconds is the fallback for a missed event.Coming back to the app
thinkwatch://is registered, so the page the browser lands on can bring the app back to the front. The window is recreated when it was closed, which is the normal state for a menu-bar app.Quota and reset credits
Test plan
pnpm typecheck,pnpm build,pnpm test(88)cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(77)tauri dev.🤖 Generated with Claude Code