Skip to content

fix(windows): suppress console window flash on subprocess spawns#27061

Closed
Grogger wants to merge 1 commit into
NousResearch:mainfrom
Grogger:fix/windows-create-no-window
Closed

fix(windows): suppress console window flash on subprocess spawns#27061
Grogger wants to merge 1 commit into
NousResearch:mainfrom
Grogger:fix/windows-create-no-window

Conversation

@Grogger

@Grogger Grogger commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

On Windows, every subprocess.Popen in the agent spawns a visible CMD window that flashes on the desktop. This adds creationflags=subprocess.CREATE_NO_WINDOW (guarded by _IS_WINDOWS) to all 5 Popen sites across 4 files:

  • tools/environments/local.py: foreground terminal spawn
  • tools/process_registry.py: background process spawn
  • tools/code_execution_tool.py: sandbox Popen + interpreter probe
  • hermes_cli/kanban_db.py: kanban worker spawn (+ adds the missing _IS_WINDOWS module constant)

Why

CMD window flashes are jarring during normal operation, especially when background agents or gateway workers spawn subprocesses. The fix is a single keyword argument per Popen site, no-op on non-Windows thanks to the _IS_WINDOWS guard.

CREATE_NO_WINDOW alone is sufficient to suppress the flash for these call sites. The full daemon flag combo from the cross-platform guide (CREATE_NO_WINDOW | DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP | CREATE_BREAKAWAY_FROM_JOB) is for detached daemons and not needed here.

How to test

On Windows 11:

  1. Run hermes and execute any terminal command. No CMD window flashes.
  2. Start a background process via terminal(background=True). No flash on spawn.
  3. Dispatch a kanban worker. No flash on worker spawn.
  4. Use execute_code. No flash on sandbox spawn.

Test suite: pytest tests/tools/ tests/hermes_cli/ on Windows 11 shows identical results to main branch. All test failures are pre-existing platform issues (Winsock, tilde expansion, macOS-specific tests, docker detection), none related to this change.

Add creationflags=CREATE_NO_WINDOW to every Windows Popen call
across the terminal, process registry, code execution, and kanban
worker subsystems. Prevents visible CMD windows from flashing on
the user's desktop during agent operation.

Also adds the _IS_WINDOWS module constant to kanban_db.py where
it was missing, for consistency with the other patched files.

5 Popen sites across 4 files:
- tools/environments/local.py (terminal foreground spawn)
- tools/process_registry.py (background process spawn)
- tools/code_execution_tool.py (sandbox + interpreter probe)
- hermes_cli/kanban_db.py (kanban worker spawn)
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/terminal Terminal execution and process management tool/code-exec execute_code sandbox backend/local Local shell execution labels May 16, 2026
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Adds release-note attribution mappings for 9 contributors from group 3:
- @darvsum (PR #26766)
- @hueilau (PR #26498)
- @Timur00Kh (PR #27114)
- @Grogger (PR #27061)
- @lemassykoi (PR #27042)
- @draplater (PR #26707)
- @pr7426 (PR #27048)
- @therahul-yo (PR #26215)
- @flamiinngo (PR #27205)

#27154 dropped from this batch — already landed on main as 4e9cedc.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #27302 — your commit was cherry-picked onto current main as part of a batch salvage of low-risk new-contributor PRs. Authorship preserved (fix(windows): suppress console window flash on subprocess spawns). Thanks for the contribution.

@teknium1 teknium1 closed this May 17, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/local Local shell execution P2 Medium — degraded but workaround exists tool/code-exec execute_code sandbox tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants