Repository navigation
fix: keep background Antigravity refreshes from opening Google sign-in - #283
Merged
Merged
Conversation
#282) A signed-out agy started browser sign-in on every background /usage read and then waited 60 s for a code. CodexBar now runs agy with a loopback SSH_CONNECTION/SSH_CLIENT, so agy prints its sign-in link instead of opening a browser, and stops the run as soon as agy asks for sign-in. The Gemini coding row reports "Not signed in" instead of a timeout. The command runner gains `stop_on_stderr`, used only by agy. The interactive Settings sign-in still clears the SSH variables and uses agy's local browser flow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Collaborator
Author
|
@codex review |
Move collect's completion check, now including the stop marker, into complete(); share CodingError's text through message(), which Display and the provider's Refused reason both use; and classify a failed /usage run in CodingError::of_failed_run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
When agy has no saved sign-in, every background Gemini coding refresh opened Google sign-in in the default browser and then waited 60 s for a code, past CodexBar's 30 s limit. Background agy runs now can't start sign-in, and the Gemini coding row says Not signed in within about a second.
Fixes #282. Context: chief#43.
Change
gemini_coding::CliRunnerruns agy with a loopbackSSH_CONNECTIONandSSH_CLIENT, replacing any inherited values and removingSSH_TTY. Over SSH, agy prints the sign-in link instead of launching a browser (Authenticate: browser locally, "manual URL" over SSH). The Settings sign-in window (gemini_login) already clears these variables, so the interactive flow still uses the local browser.CommandOptions.stop_on_stderr(new, used only by agy): the runner stops the command once that text appears on stderr, ignoring ASCII case, and returns what it wrote so far. agy's marker isauthentication required. Every other caller passesNone.CodingError::SignedOutmaps toProviderError::NotSignedIn("Not signed in. Sign in to the Antigravity CLI from Settings > Accounts."). It replaces aTimedOuton Windows and macOS.collecthands its completion check, now including the marker, tocomplete().CodingError::message()now holds the text thatDisplayand the provider'sRefusedreason used to duplicate, andCodingError::of_failed_runsorts a failed/usagerun intoSignedOutorNoUsage.COMMAND_RUNNER.md("No interactive sign-in") and a no-browser check inANTIGRAVITY_LOGIN_TESTING.md.The obvious alternative, a closed stdin pipe, makes a signed-out agy fail fast on macOS without a tty. On Windows it doesn't help: agy reads the code from the hidden console's
CONIN$and still launchesrundll32(probe below).DETACHED_PROCESSwould remove that console, but agy's own console children would then get visible windows, the #280 regression.Evidence
Windows-native, signed-out agy 1.4.8 started like CodexBar starts it (
CREATE_NO_WINDOW). Run 40540550812 on the throwawayprobe/agy-signin-282branch, with process creations from Security event 4688:rundll32(browser)The SSH variables stop the browser.
stop_on_stderrends the 60 s wait.Windows console probe of the real release builds, main
af6f00cvs this PR (run 40542734918, artifactconsole-probe-40542734918,processes.json). Each build ran for 4 minutes on the hosted desktop with a Gemini account and agy installed but signed out. The candidate was5813c1c; its code matches this PR's code before the CRAP-neutral refactor inc59a20a.agy -p /usagerunsrundll32 url.dll,FileProtocolHandler <accounts.google.com…>started by themaf6f00cControl: in both phases the probe's own launch of agy with no SSH variables (
matrix-agy-contained-usage, 16:55:13 and 17:00:54) still startedrundll32, so agy stayed signed out through the fix phase. The fix phase logged one Edge foreground event, atapp-fix-stopping. That was the Edge window main's runs had already opened, coming forward when CodexBar quit. No process started it. Console windows from CodexBar: 0 in both builds.macOS (air), real signed-out agy 1.4.8, with an
openshim first on PATH that logs calls instead of opening anything:open <accounts.google.com/o/oauth2/auth…>TimedOutat 30 s)CliRunner+fetch, no ttyErr(SignedOut)in 0.9 sCliRunner+fetch, with a ttyErr(SignedOut)in 0.5 sSigned-in
/usagewith the SSH variables set: agy 1.4.8 on Linux (mini), signed in, reached over a real SSH session (SSH_CONNECTIONset), withAGY_CLI_DISABLE_AUTO_UPDATE=trueand null stdin:status SUCCESS,num_turns 0,command usage, all five buckets (gemini-weekly,gemini-5h,3p-weekly,3p-5h,gemini-argon-wtu-weekly). I had no signed-in agy on Windows or macOS to test with.Tests
command_runnerfixtureprompt: a real child writes the prompt and then never exits. Withstop_on_stderrit returnssuccess: falsewith its stderr before the 3 s deadline.command::tests::a_stop_marker_is_found_across_reads_and_case: a marker split across reads, mixed case, no false match.gemini_coding: both of agy's prompt forms map toSignedOut, other failures stayNoUsage, andCliRunner::optionsis pinned.gemini: a signed-out CLI fails the account withneeds_sign_in()and the "Not signed in" text.command_runner.Validation
Local gates on air (macOS arm64) at
c59a20a:cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warningsandcargo test --workspace --lockedall pass (1,048 tests, 0 failed). CI runs the same gates on Windows, macOS and Linux, plus strict rust-metrics.🤖 Generated with Claude Code