forked from google-gemini/gemini-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
find a minor bug, fix it, you don't have to build and run, just find ...#3
Closed
ningcui-compass wants to merge 2 commits into
Closed
find a minor bug, fix it, you don't have to build and run, just find ... #3ningcui-compass wants to merge 2 commits into
ningcui-compass wants to merge 2 commits into
Conversation
...th callback handler to prevent fall-through execution
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
What we're building and why
Gemini CLI is an open-source TypeScript/Node.js CLI tool that provides terminal-first access to Google's Gemini AI models. It's structured as a monorepo with packages for the CLI frontend (
packages/cli, React/Ink), backend core (packages/core), and supporting packages.We found a minor bug in the OAuth2 authentication flow: a missing
returnstatement after a promisereject()in an HTTP request handler, causing fall-through execution on invalid requests.Architectural context
packages/core/src/code_assist/oauth2.ts) implements Google OAuth2 authentication. It spins up a local HTTP server to receive the OAuth callback redirect. The server's request handler is inside anew Promiseconstructor, usingresolve/rejectto signal auth completion.Chunks
returnafter promise rejection in OAuth callback handler to prevent fall-through executionAdvisories
reject()calls at lines 504-508 (qs.get('error')branch) and 512-516 (statemismatch branch) also lackreturnafterreject(). They are safe today because they sit in anif/else if/elsechain with no code afterreject()within each block. However, they are inconsistent with the style of the fix applied here. Addingreturnafter thosereject()calls too would make the handler uniformly defensive against future edits that might add code after a branch. This is minor and not blocking.Metrics
Generated by temporal-harness