Skip to content

fix: keep the Antigravity CLI's self-updater from opening console windows - #280

Merged
HemSoft merged 3 commits into
mainfrom
t3/hide-console-windows
Oct 27, 2026
Merged

HemSoft merged 3 commits into
mainfrom
t3/hide-console-windows

Conversation

@HemSoft

@HemSoft HemSoft commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Background Gemini coding refreshes run agy. Once agy's 15-minute update check is due, it starts its self-updater detached. The updater then starts agy --version, which gets a new, visible, foreground console. No creation flag on the agy CodexBar starts can reach that grandchild. This PR turns the updater off for every agy CodexBar starts, using Antigravity's documented switch. It also locks the hidden-console contract for background CLIs with a Windows regression test.

Fixes #271. Supersedes #272. Context: chief#43.

Change

  • gemini_coding::CliRunner runs agy through SystemCommandRunner with AGY_CLI_DISABLE_AUTO_UPDATE=true, replacing any inherited value. Only true works (troubleshooting, antigravity-cli#1046). The background provider, the post-sign-in check and the live diagnostic use it. The sign-in window's agy sets it too. agy run in a terminal still updates itself. tastecode#1942 found and fixed the same popup this way.
  • CommandOptions.cwd becomes optional, so agy keeps the working folder it has today. Muse still passes its folder. The option handling moved into configure to keep run_scoped's CRAP unchanged.
  • command_runner gains two fixtures:
    • Windows: a parent with no console, like the release app, runs a child through SystemCommandRunner. The child and an ordinary flag-less grandchild must both report no console window.
    • All platforms: options without cwd keep the parent's folder and still set the child's environment.
  • docs/COMMAND_RUNNER.md documents the console policy.

An audit of every launch site found no background launch outside CREATE_NO_WINDOW. The only visible launches are the user-started sign-in windows. The retired WPF app also set CreateNoWindow = true for gh.

Windows-native evidence

The probe lives on the never-merged probe/console-windows-native branch. It ran on windows-latest (Server 2025, with Windows Terminal as the default terminal, as on Windows 11).

Each run builds and starts the real CodexBar release with a Copilot account on the GitHub CLI and a Gemini account with Antigravity coding quotas, on a 60-second refresh. agy is installed but not signed in. Before each run, agy's updater state is wiped so the update check is due.

Three observers run at once:

  • a WinEvent create/show/foreground hook;
  • an EnumWindows poll every 15 ms;
  • an EnumDesktopWindows sweep of every desktop in WinSta0.

Security event 4688 logs every process start with its command line.

Run 40505158287: main versus this PR, same workload (6 gh and 6 agy launches each).

Build agy updater Visible console windows
Main bd1bab8 (sha256 dba1d289…) agy -p /usage → agy --bg-updater → agy --version → Windows Terminal handoff 1: created, foreground, on screen, titled with agy's path
This PR 68de2e0 (sha256 cc65140b…, rebuilt from this branch) never started 0

Main (the popup Franz reports):

Main: agy updater's console window over CodexBar

This PR after its refreshes:

This PR: no console window

Window events: main's updater window. Summary: run summary. Process log: process starts.

gh is not a source. Main ran gh 13 times in run 40486095984 and run 40493362418 with 0 console windows. Main rebuilt without CREATE_NO_WINDOW opened 9 (screenshot), so the probe does catch them.

The probe also launched gh and agy from a GUI-subsystem launcher with fixed flags:

Launch flags Visible console window
None Yes, for both gh and agy
CodexBar's CREATE_NO_WINDOW | CREATE_SUSPENDED plus job No, including cmd → gh grandchildren
CREATE_NO_WINDOW alone No
Detached No

Every conhost on the runner started as conhost.exe 0xffffffff -ForceV1, windowless ones included. A visible console always came with an OpenConsole.exe -Embedding start.

Related

Limits

  • Copilot usage numbers need a Copilot-licensed account. No secrets were used. The probe shows gh's output parsed into the account list, and the runner suite covers capture.
  • This is a hosted desktop, not Franz's machine. Nothing ran on Home.

Validation

  • CI on 68de2e0: all 7 checks green, including rust-metrics and rust (windows-latest) with the new fixture.
  • Local (macOS): cargo fmt --all --check, cargo clippy --workspace --all-targets --locked -- -D warnings and cargo test --workspace --locked all pass.

🤖 Generated with Claude Code

HemSoft added a commit that referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HemSoft HemSoft changed the title test: keep background CLIs and their descendants without a console window fix: keep the Antigravity CLI's self-updater from opening console windows Oct 27, 2026
HemSoft and others added 3 commits October 27, 2026 08:57
…ndow

A fixture parent with no console, like the release app, runs a child through
SystemCommandRunner; the child and an ordinary descendant it starts without
flags must both report no console window (chief#43, #271). Dropping
CREATE_NO_WINDOW gives the child a new console window and fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dows

agy runs its self-updater detached once its 15-minute check is due, and the
updater's agy --version child gets a new, visible console that
CREATE_NO_WINDOW on CodexBar's agy cannot reach (chief#43). Every agy CodexBar
starts, in the background and in the sign-in window, now sets Antigravity's
documented AGY_CLI_DISABLE_AUTO_UPDATE=true. CommandOptions gains an optional
working folder so agy keeps the one it has today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps SystemCommandRunner::run_scoped at its previous complexity now that the
working folder is optional (rust-metrics CRAP gate).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HemSoft
HemSoft force-pushed the t3/hide-console-windows branch from 68de2e0 to d7c47c0 Compare October 27, 2026 12:57
@HemSoft
HemSoft marked this pull request as ready for review October 27, 2026 12:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T12:59:21.293291Z d7c47c0 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HemSoft
HemSoft merged commit af6f00c into main Oct 27, 2026
10 checks passed
@HemSoft
HemSoft deleted the t3/hide-console-windows branch October 27, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent background provider descendants from opening console windows

1 participant