fix(windows): hide persistent Codex provider console windows
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
- Run the AO desktop app on Windows.
- Create a new worker task with Codex in Chat mode.
- Observe a console window opened for the Codex provider.
- Close that console window.
- 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 Is this fixed?
@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
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.
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.