agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

fix(windows): hide persistent Codex provider console windows

Open Vaibhaav-Tiwari opened this issue 2 months ago • 4 comments

Bug

Creating a Codex Chat task on Windows opens a visible console window for the provider process. Closing that console terminates Codex, closes the chat controller stream, and makes AO show the session as Exited.

Source: local Windows user report in Codex chat Analyzed against: c4a7a6f5c AO version: desktop development build (0.10.3) Confidence: High Priority: P2 — Codex tasks work if the console is left open, but normal window cleanup kills the session.

Reproduction

  1. Run the AO desktop app on Windows.
  2. Create a new worker task with Codex in Chat mode.
  3. Observe a console window opened for the Codex provider.
  4. Close that console window.
  5. Observe the AO session transition to Exited.

Root Cause

backend/internal/adapters/chatdriver/persistenthost/host.go starts the provider inside the detached chat-host using raw exec.Command. That bypasses backend/internal/process.Command, which applies CREATE_NO_WINDOW and HideWindow on Windows. The provider therefore receives a user-visible console whose lifetime is coupled to the Codex process.

The Exited activity is a correct downstream result: closing the console kills the provider, closes the persistent chat stream, and the controller reports chat.controller.stopped.

Fix

Launch the persistent provider with process.Command, preserving existing behavior on macOS/Linux while applying AO's hidden-process attributes on Windows. Add a Windows regression test that starts the full detached chat-host path and asks the provider helper whether it has an attached console window.

Impact

  • New Codex Chat tasks create unexpected terminal windows on Windows.
  • Closing those windows kills otherwise healthy sessions.
  • Other persistent Chat providers using this host path can be affected as well.

Related

  • #3835 — related Windows console flashing, but caused by background Git probes during session selection rather than the persistent provider launch.

Vaibhaav-Tiwari avatar Sep 06 '26 18:09 Vaibhaav-Tiwari

@Vaibhaav-Tiwari Is this fixed?

Rishet11 avatar Oct 18 '26 15:10 Rishet11

@Vaibhaav-Tiwari Is this fixed?

I have switched from windows to mac, @codebanditssss can you confirm it? But I think it was done by @whoisasx, still check

Vaibhaav-Tiwari avatar Oct 18 '26 15:10 Vaibhaav-Tiwari

i created a codex chat task in the windows app and did not see a separate provider console window. the task stayed in ao, so i did not encounter the reported behavior on my setup.

codebanditssss avatar Oct 29 '26 16:10 codebanditssss

closing this based on the current windows check: a codex chat task stayed in ao without opening a provider console. the current provider launch also uses process.Command, which applies the windows hidden-window flags. please reopen if the console still appears on another build or setup.

codebanditssss avatar Oct 29 '26 16:10 codebanditssss