Skip to content

[Bug]: Windows: All tools fail with multiple values for keyword argument 'creationflags' in 0.14.0 #28920

@Daevalus

Description

@Daevalus

[Bug]: Windows: All tools fail with "multiple values for keyword argument 'creationflags'" in 0.14.0

Summary

On Windows, Hermes Agent 0.14.0 is completely non-functional. Every tool that invokes subprocess execution (terminal, read_file, write_file, patch, search_files, etc.) crashes with:

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

This is a P1 critical regression — the agent cannot execute any commands on Windows.

Environment

  • OS: Windows 10/11
  • Hermes version: 0.14.0
  • Python: 3.11.13 (also affects other versions)
  • Shell: Git Bash (MSYS)

Root Cause

In tools/environments/local.py, lines 523-537, creationflags is passed to subprocess.Popen() twice on Windows:

# Line 523
_popen_kwargs = {"creationflags": windows_hide_flags()} if _IS_WINDOWS else {}

# Lines 525-538
proc = subprocess.Popen(
    args,
    ...
    creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0,  # <-- FIRST time
    cwd=_popen_cwd,
    **_popen_kwargs,  # <-- SECOND time (contains creationflags on Windows)
)

Python's subprocess.Popen does not allow duplicate keyword arguments, causing an immediate TypeError.

Affected Tools

All tools that rely on LocalEnvironment.execute() or subprocess execution:

  • terminal — completely broken
  • read_file — completely broken
  • write_file — completely broken
  • patch — completely broken
  • search_files — completely broken
  • Any skill or workflow that shells out

Minimal Reproduction

On Windows with Hermes 0.14.0:

  1. Start Hermes: hermes
  2. Ask the agent to run any terminal command: echo hello
  3. Observe TypeError: subprocess.Popen() got multiple values for keyword argument 'creationflags'

Fix

Remove the duplicate explicit creationflags argument. The _popen_kwargs dict already handles it correctly:

_popen_kwargs = {"creationflags": windows_hide_flags()} if _IS_WINDOWS else {}

proc = subprocess.Popen(
    args,
    text=True,
    env=run_env,
    encoding="utf-8",
    errors="replace",
    stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT,
    stdin=subprocess.PIPE if stdin_data is not None else subprocess.DEVNULL,
    preexec_fn=None if _IS_WINDOWS else os.setsid,
    # REMOVED: creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0,
    cwd=_popen_cwd,
    **_popen_kwargs,
)

File Location

tools/environments/local.py, lines 523-537

Suggested Labels

  • type/bug
  • P1 High
  • comp/tools
  • platform/windows

Additional Context

This appears to have been introduced in 0.14.0, likely as part of Windows subprocess compatibility improvements. The _popen_kwargs pattern was added but the original explicit creationflags line was not removed, creating the collision.

The _subprocess_compat.py module correctly provides windows_hide_flags() and windows_detach_popen_kwargs() — the bug is purely in how local.py consumes them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundbackend/localLocal shell executioncomp/toolsTool registry, model_tools, toolsetstool/terminalTerminal execution and process managementtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions