Skip to content

Bug Report: Windows Job Object limits terminate spawned GUI processes on CLI exit #350

@ilkerbekmezcii

Description

@ilkerbekmezcii

Bug Report: Windows Job Object limits terminate spawned GUI processes on CLI exit

Context

  • App: Antigravity CLI (agy.exe)
  • OS: Windows 10/11
  • Command Executor: One-shot terminal runner executing powershell -Command "<command>" or cmd /c "<command>".

Description

When running commands that spawn GUI applications (such as chrome.exe, msedge.exe, or other browsers/GUI programs) through the Antigravity agent, the spawned GUI applications start but are immediately terminated the moment the agent's command execution finishes and the temporary shell process exits.

Root Cause Analysis

  1. The Antigravity CLI runs commands inside a Windows Job Object (verified via IsProcessInJob Win32 API).
  2. The Job Object is configured with process limit flags that terminate all child processes when the parent job handles are closed (JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE behavior).
  3. Unlike agents using persistent shells (e.g. OpenCode, Claude CLI), Antigravity runs commands in one-shot, temporary PowerShell/CMD processes.
  4. When the temporary shell exits, the job handle closes, causing Windows to immediately terminate all child processes (like the browser processes) spawned during that command execution.
  5. This also causes Chrome/Edge sandboxing to fail, as they require nesting Job Objects which is blocked by the outer Job Object unless breakaway is permitted.

Workaround (Implemented locally)

Using Windows Management Instrumentation (WMI) to bypass the Job Object by launching processes under wmiprvse.exe (outside the terminal's job tree):

powershell -Command "([wmiclass]'win32_process').Create('C:\Program Files\Google\Chrome\Application\chrome.exe')"

Requested Fix

The command runner in the Antigravity CLI (agy.exe) should allow child processes to break away from the job object when running GUI/detached commands, or configure the Job Object with the JOB_OBJECT_LIMIT_BREAKAWAY_OK / JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK limit flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions