Skip to content

fix: guard init-time stdio writes - #1271

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-de3d4e49
Mar 14, 2026
Merged

fix: guard init-time stdio writes#1271
teknium1 merged 1 commit into
mainfrom
hermes/hermes-de3d4e49

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

  • install safe stdio wrappers at agent init time, not just at run_conversation startup
  • extend the existing _SafeWriter guard to stderr as well as stdout
  • add regression coverage for init-time Honcho fallback prints and stdio installation

Why

PR #911 correctly identified that best-effort console output can still abort a gateway turn when stdio is broken. Current main already fixed the main run_conversation path with _SafeWriter, but there was still a smaller init-time gap before that guard was installed: the Honcho init fallback prints in AIAgent.init could still raise if stdout was already detached.

This patch fixes that remaining edge case on current main rather than layering a second print wrapper on top of the broader _SafeWriter approach.

Test plan

  • python -m pytest tests/test_run_agent.py -n0 -q
  • python -m pytest tests/ -n0 -q
  • python -m hermes_cli.main chat -q "Reply with exactly: smoke test ok"

@teknium1
teknium1 merged commit 1117a21 into main Mar 14, 2026
1 check passed
@teknium1
teknium1 deleted the hermes/hermes-de3d4e49 branch March 14, 2026 09:21
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…de3d4e49

fix: guard init-time stdio writes
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…de3d4e49

fix: guard init-time stdio writes
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…de3d4e49

fix: guard init-time stdio writes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant