Skip to content

fix(windows): remove duplicate creationflags in local subprocess Popen call - #29028

Closed
momowind wants to merge 1 commit into
NousResearch:mainfrom
momowind:fix/windows-creationflags-duplicate
Closed

fix(windows): remove duplicate creationflags in local subprocess Popen call#29028
momowind wants to merge 1 commit into
NousResearch:mainfrom
momowind:fix/windows-creationflags-duplicate

Conversation

@momowind

Copy link
Copy Markdown
Contributor

Problem

On Windows, every terminal tool call fails with:

TypeError: subprocess.Popen() got multiple values for keyword argument 'creationflags'

Root Cause

In tools/environments/local.py, the _run_bash method passes creationflags to subprocess.Popen() twice on Windows:

  1. Via _popen_kwargs dict (windows_hide_flags()CREATE_NO_WINDOW)
  2. Via explicit creationflags=subprocess.CREATE_NO_WINDOW parameter

Python raises TypeError when the same keyword argument appears twice (once directly, once via **dict expansion).

Fix

Remove the redundant explicit creationflags parameter. _popen_kwargs already handles it via the established windows_hide_flags() compat-layer helper.

Commit

2b454a0f1 — single-line deletion, 1 file changed, 1 deletion.

The _popen_kwargs dict already provides creationflags via
windows_hide_flags() (CREATE_NO_WINDOW). The explicit
creationflags=subprocess.CREATE_NO_WINDOW on the Popen call
created a duplicate keyword argument on Windows, causing:
  TypeError: subprocess.Popen() got multiple values for
  keyword argument 'creationflags'

Remove the redundant explicit parameter; _popen_kwargs handles
it via the already-established compat-layer pattern.
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround backend/local Local shell execution labels May 20, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #28898 — identical fix (remove duplicate creationflags kwarg in _run_bash() on Windows). See also #28920 (the bug report).

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for catching this Windows regression. This has since been fixed on main by the same one-line change, so I’m closing this as implemented on main.

Evidence from this automated hermes-sweeper review:

  • tools/environments/local.py:593 on current origin/main builds _popen_kwargs = {"creationflags": windows_hide_flags()} if _IS_WINDOWS else {}.
  • tools/environments/local.py:595-607 calls subprocess.Popen(...) with cwd=_popen_cwd, **_popen_kwargs and no separate explicit creationflags= keyword.
  • Commit 05f02640e1f763afb7afdae4efe6b450016a908f removes exactly the stale creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0 line from LocalEnvironment._run_bash().
  • That fix was merged via PR fix(windows): drop duplicate creationflags kwarg in LocalEnvironment run_bash #29059 as merge commit 62713c8b8926c5280a0dfbfcf42cf2c07ec8a047 and is contained in release tag v2026.5.28.

@alt-glitch’s duplicate note was accurate: this PR, #28898, and the bug report #28920 all point at the same duplicate-creationflags regression.

@teknium1 teknium1 closed this Jun 15, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 15, 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 P1 High — major feature broken, no workaround sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants