Repository navigation
Description
Summary
On Windows, loopx intermittently flashes one or more black console windows while running, and occasionally a detached launch fails with:
error 2147942632 (0x800700e8) when launching 'C:\...\uv\tools\loopx\Scripts\python.exe -P -m loopx.usage_goal'
(0x800700e8 = Win32 error 232, ERROR_NO_DATA / "The pipe is being closed".)
Root cause: most child-process launch sites spawn console-subsystem executables (node.exe, python.exe) without CREATE_NO_WINDOW / DETACHED_PROCESS. When the parent process has no console (e.g. loopx is invoked from a console-less host such as an embedded agent harness session), Windows allocates a visible console host window for every short-lived console child, which appears as a briefly flashing black window.
Environment
- loopx 2.4.1 (installed via
uv tool) - Windows 11 x64, Python 3.12 (uv tool venv)
- Host: OpenCode CLI session (pwsh spawned with piped stdio, no attached visible console)
Reproduction
- Run a goal-start flow (
/loopx <goal text>) from a console-less host. - During the first minute (bootstrap → agent registration → requirement/todo writes → quota guards), several black console windows flash briefly.
- Occasionally the detached usage observer itself fails to launch with the
0x800700e8error above.
Cause (loopx 2.4.1 line references)
Windows rule: a console-subsystem child started by a console-less parent gets its own conhost window unless created with DETACHED_PROCESS / CREATE_NO_WINDOW.
Affected launch sites in the installed v2.4.1 (matches the current v2.4.1 tag):
loopx/control_plane/runtime/node_probe.py:121—subprocess.run([node, "--version"], ..., capture_output=True): nocreationflags. Node is probed on nearly every CLI invocation.loopx/control_plane/effect_runtime.py:1365—subprocess.Popen([... node ...]): setsstart_new_session=os.name != "nt"(a no-op on Windows) but no Windowscreationflags; the long-lived Node effect-runtime host is launched withoutCREATE_NO_WINDOW.loopx/usage_ping.py:136(control()) —subprocess.run(_command(), ...)spawning Node: nocreationflags.loopx/usage_ping.py:263(_detach) correctly usesDETACHED_PROCESS | CREATE_NEW_PROCESS_GROUPfor the observer itself, so it does not flash — but that console-less observer then spawns further console children viacontrol()/_command()without flags, which allocate visible consoles. This is also the process whose launch intermittently fails withERROR_NO_DATA(232).
A single /loopx goal start runs dozens of short CLI invocations in sequence (bootstrap, agent registration, acceptance refine, todo add/list readbacks, refresh-state, heartbeat-prompt, multiple quota should-run), each of which may probe Node or start/reuse the effect runtime — producing a burst of flashing windows up front. The same happens for every quota-guarded turn.
Suggested fix
On os.name == "nt", pass creationflags=subprocess.CREATE_NO_WINDOW at all child-spawn sites that launch console executables (a shared spawn helper would keep this consistent):
node_probe.pyprobe_nodeeffect_runtime.pyruntime-hostPopenusage_ping.pycontrol()and anything else spawned from the detached observer
DETACHED_PROCESS-style detachment can stay as-is for the long-lived observer; the fix only ensures no console window is ever allocated for console children.
Happy to provide more details or test a patched wheel if helpful.
Activity
LIHUA919 commentedon Nov 25, 2026
Claiming this issue: PR #9435 adds a shared
no_console_creationflags()helper (CREATE_NO_WINDOWon Windows, 0 elsewhere) at the reporter's launch sites (node probe, effect-runtime host Popen,usage_ping.control()), keeps the detached observer'sDETACHED_PROCESS | CREATE_NEW_PROCESS_GROUPand makes its stdin write tolerant of the child-closed pipe race behind the intermittent0x800700E8/ ERROR_NO_DATA failure, and covers the additional spawn sites the goal-start/turn/quota flow executes on current main (registry git probes, validation commands, scheduler follow-up, turn-driver host spawns) plus the TS hosts missingwindowsHide: true. Non-Windows behavior is unchanged; Windows visual/pipe behavior is disclosed to CI Windows lanes in the PR body. Happy to iterate on the review.