[Bug] Background subprocesses flash console windows on native Windows #1461
Replies: 5 comments
|
Still reproducible on The main offender is function runProcessQuery(command, args) {
return execFileSync(command, args, {
encoding: "utf8",
stdio: ["ignore", "pipe", "ignore"], // no windowsHide
});
}On Windows, while (getProcessStartId(listener.pid) === processStartId && Date.now() < deadline) { ... }Each iteration spawns a new PowerShell. The daemon runs without an attached console, so every spawn allocates a visible console window — that's the storm of windows flashing open/closed. Linux/macOS are unaffected because I patched my installed 0.7.2 by adding
|
|
Confirmed this is still present in Prime Agent 0.8.0 on native Windows (build 26200) with Node.js 24.18.0. I inspected the installed 0.8.0 bundle and the daemon, session-worker, catalog, command-check, and IPython kernel launch paths still reach As an update-resistant local workaround, I now launch Prime Agent through a user-level wrapper that injects a Node preload hook. The hook wraps That global hook is useful as a diagnostic/workaround, but it should not be the upstream implementation. Please consider accepting a focused patch that:
This is a significant usability issue on native Windows because polling or recovery loops can turn a single missing option into a burst of visible console windows. I would be happy to validate a candidate fix on the environment above. |
|
Confirming on Windows 11. Still present in v0.8.0.
Symptom matches what is described here: the terminal flashes several times per turn, and one kernel console window stays visible. Setting |
|
Still reproducible on Environment
Reproduction
In one observed run the process timestamps matched exactly: The Prime session was idle ( Current 0.9.1 source pathThe source map for the shipped package points to const child = spawn(python, ["-m", "rlm.repl"], {
cwd: this.options.cwd,
env: {
...process.env,
...this.options.env,
PRIME_AGENT_KERNEL_OWNER_PID: String(process.pid),
},
stdio: ["pipe", "pipe", "pipe"],
});There is still no Expected behaviorStarting or resuming a chat must not create any extra visible Windows Terminal tabs. The long-lived Suggested focused fixAdd This is the same bug family as closed issue #668, but it remains reproducible in the current |
Urgent follow-up: this is release-blocking on WindowsThis is not a cosmetic annoyance. On native Windows, Prime Agent 0.9.1 becomes effectively unusable for real work. Every RLM/subagent kernel launch ( Reproduction
This should have been caught by a basic native-Windows multi-kernel smoke test. Please treat the missing coverage as a release-gate gap and ship an urgent hotfix:
We confirmed locally that applying |
Uh oh!
There was an error while loading. Please reload this page.
Affected area
Coding agent and CLI (native Windows subprocess lifecycle)
What happened?
Starting Prime Agent on native Windows causes multiple console windows to appear and disappear rapidly. After startup, a console window titled
prime-agentcan remain open for the lifetime of the session.The TUI itself still runs correctly in its host terminal. The extra windows come from background Node and command-line subprocesses that do not set Node's
windowsHidechild-process option.The persistent process is the daemon catalog child launched as
prime-agent --versionwithPRIME_AGENT_INTERNAL_DAEMON_CATALOG=1. A process snapshot showed this tree:The catalog child also acquired a
conhost.exe. Short-lived startup checks and other daemon/worker launches account for the transient windows.Steps to reproduce
prime-agent --offline --provider openai-codex --model gpt-5.6-solprime-agentremaining open.The issue happens before any model request and is independent of the selected provider.
Expected behavior
Prime Agent should remain connected to the terminal that launched it, while all background daemon, worker, catalog, and command-check subprocesses run without creating separate Windows console windows.
Input, output, Ctrl+C handling, IPC, and exit-code propagation should remain unchanged.
Prime Agent version
0.7.2; the relevant call sites are also present on current
mainat06e4a19dc902382dbb90b67fbe4ed53c3f7b99b2.Environment
Additional context
Windows-reachable background call sites currently omit
windowsHide, including:packages/coding-agent/src/modes/daemon/daemon-catalog-process.ts(spawnCatalog)packages/coding-agent/src/cli/daemon-launch.tspackages/coding-agent/src/cli/daemon-command.tspackages/coding-agent/src/cli/daemon-update-restart.tspackages/coding-agent/src/cli/owned-session-worker.tspackages/coding-agent/src/modes/daemon/daemon-mode.tspackages/coding-agent/src/modes/daemon/daemon-supervisor.tspackages/coding-agent/src/utils/shell.tsandtools-manager.tsAs a local diagnostic, adding
windowsHide: trueonly to detached daemon/worker launches and the catalog launch removed the persistent window but did not eliminate every transient flash. EnforcingwindowsHide: trueacross Prime Agent'sspawn,spawnSync,execFile,execFileSync, andforkcalls eliminated both the transient windows and the persistent catalog window. The global interception was useful for diagnosis, but I would not propose it as the upstream implementation.A focused fix could consistently add
windowsHide: trueto Windows-reachable background subprocess options, potentially through a small shared helper so future call sites do not regress. Regression tests can mock the child-process launch functions and assert that daemon, worker, catalog, and command-check launches receivewindowsHide: true. This does not change the daemon protocol or IPC shapes.I can prepare the focused source change and tests if a maintainer would like a pull request.
All reactions