Skip to content

System prompt reports Windows (10) on Windows 11 hosts #51755

Description

@MegumiKato0

Description

Hermes Agent system prompt reports Host: Windows (10) on Windows 11 machines, misleading the LLM about the host OS.

Root Cause

agent/prompt_builder.py::build_environment_hints() uses platform.release() which returns 10.0 for BOTH Windows 10 and Windows 11 — the kernel version is identical between them.

# Current behavior: platform.release() returns '10.0' for both
# Result: prompt says "Windows (10)" even on Windows 11

Fix

Use sys.getwindowsversion().build to distinguish:

  • Build >= 22000 → Windows 11 (or later)
  • Build < 22000 → Windows 10
import sys
if sys.platform == "win32":
    build = sys.getwindowsversion().build
    win_version = "11" if build >= 22000 else "10"
    # f"Windows ({win_version})"

Environment

  • OS: Windows 11 家庭中文版 (Build 26200)
  • Hermes version: 0.17.0-cn.1
  • platform.release(): 10.0
  • sys.getwindowsversion().build: 26200

Expected

Host: Windows (11)

Actual

Host: Windows (10)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointplatform/windowsNative Windows-specific behavior or breakagetype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions