hermes - 💡(How to fix) Fix [BUG] PTY write/submit fails on Windows/MSYS (bytes/str conversion) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When running interactive TUI applications (e.g., freebuff) in PTY mode on Windows/MSYS, the process(action='write') and process(action='submit') tools fail with error:

"argument 'to_write': 'bytes' object cannot be converted to 'PyString'"

Error Message

When running interactive TUI applications (e.g., freebuff) in PTY mode on Windows/MSYS, the process(action='write') and process(action='submit') tools fail with error: 3. Error: "argument 'to_write': 'bytes' object cannot be converted to 'PyString'"

  • Encoding error prevents input from being sent

Root Cause

Type mismatch in PTY write function: receives str, tries to write as bytes, conversion fails.

Fix Action

Fixed

Code Example

"argument 'to_write': 'bytes' object cannot be converted to 'PyString'"

---

def write_to_pty(session_id, data):
    if isinstance(data, str):
        data = data.encode('utf-8')
    # ... rest of write logic
RAW_BUFFERClick to expand / collapse

Bug Report: PTY write/submit fails on Windows/MSYS

Summary

When running interactive TUI applications (e.g., freebuff) in PTY mode on Windows/MSYS, the process(action='write') and process(action='submit') tools fail with error:

"argument 'to_write': 'bytes' object cannot be converted to 'PyString'"

Environment

  • OS: Windows 11 Pro (Build 26200.8457)
  • Shell: MSYS2 bash (Git Bash / MINGW64)
  • Hermes Version: Latest (as of 2026-05-24)
  • Python: 3.11

Steps to Reproduce

  1. Launch interactive TUI: terminal(command="freebuff", pty=True, background=True)
  2. Send input: process(action='write', data=' ')
  3. Error: "argument 'to_write': 'bytes' object cannot be converted to 'PyString'"

Expected Behavior

  • process(write) sends text to PTY session
  • process(submit) sends text + Enter
  • TUI application receives input and responds

Actual Behavior

  • Encoding error prevents input from being sent
  • TUI hangs waiting for input
  • Only process(action='poll') works (reading output)

Affected Use Cases

  1. Freebuff - AI coding assistant with interactive TUI
  2. vim, htop, ncdu and other interactive CLI tools
  3. Package managers with interactive prompts
  4. SSH sessions requiring password input
  5. Python REPL and other interactive interpreters

Root Cause

Type mismatch in PTY write function: receives str, tries to write as bytes, conversion fails.

Files Likely Affected

  • hermes_cli/commands.py
  • tools/process.py
  • _pty_backend.py or similar

Proposed Fix

def write_to_pty(session_id, data):
    if isinstance(data, str):
        data = data.encode('utf-8')
    # ... rest of write logic

Priority

High - Blocks all interactive CLI tool usage on Windows.

Additional Context

  • Works correctly on Linux (tested on WSL Ubuntu)
  • Only affects Windows/MSYS environment
  • Terminal launch works; only interactive I/O is broken

Reported by: Ilya (via Hermes Agent) Date: 2026-05-24 Contact: [email protected]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [BUG] PTY write/submit fails on Windows/MSYS (bytes/str conversion) [1 pull requests]