Skip to content

fix(cli): handle NoConsoleScreenBufferError in _cprint on Windows#25556

Closed
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/win32-no-console-cprint
Closed

fix(cli): handle NoConsoleScreenBufferError in _cprint on Windows#25556
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/win32-no-console-cprint

Conversation

@ygd58

@ygd58 ygd58 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Problem

Kanban task runner on Windows crashes with NoConsoleScreenBufferError because prompt_toolkit tries to access a Win32 console buffer that does not exist in non-interactive contexts. Gateway log shows crashed=1 for the kanban dispatcher.

Fix

Catch NoConsoleScreenBufferError in _cprint and fall back to print() so output is not lost and execution continues.

Fixes #25535

When Hermes runs in a non-interactive Windows context (Kanban task
runner, Scheduled Task, subprocess without attached console), prompt_
toolkit raises NoConsoleScreenBufferError because there is no Win32
console buffer. This crashed the agent before any work was done.

Fix: catch the error in _cprint and fall back to plain print() so
output is not lost and execution continues normally.

Fixes NousResearch#25535
@ygd58 ygd58 mentioned this pull request May 14, 2026
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 14, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #22482 (canonical fix for #22445). See also #25340 (already marked as dup of #22482) and #22928 (alternative approach with --no-gui flag).

@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (high confidence):
cli.py:2016-2025 already wraps _pt_print in try/except with a print(text) fallback and explicit comment about NoConsoleScreenBufferError on Windows.

If you still see this on the latest version, please reopen with reproduction steps.

(Bulk-closed during a CLI triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Setup]: Hermes Kanban

3 participants