Repository navigation
Add GitHub sign-in, AI Gateway choices, and code push - #2
Merged
implemented.stream (thanabartbb) merged 1 commit intoOct 14, 2026
Merged
implemented.stream (thanabartbb) merged 1 commit into
implemented.stream (thanabartbb) merged 1 commit into
Conversation
Chat history can follow a GitHub account, the model picker can use Vercel AI Gateway, and a reply's code block can be committed through the GitHub API. The server still does not run that code. Co-authored-by: thanabartbb <thanabartbb@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 3e632787-4baf-4a35-8f35-52891a259971) |
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.
Chat history can follow a GitHub account, the model picker can use Vercel AI Gateway, and a reply's code block can be committed through the GitHub API. The server still does not run that code.
Note
High Risk
Introduces OAuth, encrypted token storage, and GitHub repo write via the Contents API—security-sensitive paths that need correct secrets, migration order, and CSRF/origin enforcement in production.
Overview
Adds GitHub OAuth on
/chatso history can follow a signed-in account instead of only the anonymous cookie. OAuth stores an AES-GCM–encrypted access token in D1 (github_credentials, migration0006_github_auth) and uses a signednvx_authsession cookie; first sign-in promotes or moves anonymous conversations. Sign-out clears the credential row; chats stay on the user.Extends User Chat with Vercel AI Gateway as a new
gatewaymode and six allowlisted models in the picker (enabled whenAI_GATEWAY_API_KEYis set). Turns stream through a new gateway client with fallback to Workers AI / HF.Adds push one fenced code block to GitHub via
POST /api/github/contents(and repo listing), with UIGithubPublish, path/repo validation, same-origin checks, and rate limits—the server does not run committed code.Chat APIs switch from cookie-only identity to
resolveActor(GitHub session preferred). Docs, env examples, CSP (GitHub avatars), i18n, andtests/github-auth.test.tsare updated. Remote D1 must apply0006before production sign-in works.Reviewed by Cursor Bugbot for commit 559497b. Bugbot is set up for automated code reviews on this repo. Configure here.