hermes-agent/agent
m4dni5 d1f23bb2d5 fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls
When Hermes runs in TUI mode, the gateway child process communicates with
the Node.js parent over a JSON-RPC protocol on stdin. Subprocess calls that
inherit this stdin fd can trigger a race condition where the child's stdin
read returns EOF, causing the gateway to exit cleanly (exit code 0) mid-tool-
execution.

This is the same root cause as issue #14036 (byterover plugin) and PR #39257
(SSH environment backend). This commit applies the fix — stdin=subprocess.DEVNULL
— to all 85 subprocess.run() and subprocess.Popen() calls that execute inside
the TUI gateway child process.

Scope: TUI-context code only (agent/, tools/, plugins/, tui_gateway/server.py).
CLI code (cli.py, hermes_cli/), tests, scripts, and gateway process management
are excluded — they don't run inside the TUI child and inherit the terminal's
stdin, not the JSON-RPC pipe.

85 call sites across 28 files. All files pass syntax check.
2026-06-08 22:46:57 -07:00
..
lsp fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
secret_sources fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
transports fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
__init__.py
…
account_usage.py
…
agent_init.py
…
agent_runtime_helpers.py
…
anthropic_adapter.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
async_utils.py
…
auxiliary_client.py
…
azure_identity_adapter.py
…
background_review.py
…
bedrock_adapter.py
…
browser_provider.py
…
browser_registry.py
…
chat_completion_helpers.py
…
codex_responses_adapter.py
…
codex_runtime.py
…
context_compressor.py
…
context_engine.py
…
context_references.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
conversation_compression.py
…
conversation_loop.py
…
copilot_acp_client.py
…
credential_persistence.py
…
credential_pool.py
…
credential_sources.py
…
credits_tracker.py
…
curator.py
…
curator_backup.py
…
display.py
…
error_classifier.py
…
file_safety.py
…
gemini_cloudcode_adapter.py
…
gemini_native_adapter.py
…
gemini_schema.py
…
google_code_assist.py
…
google_oauth.py
…
i18n.py
…
image_gen_provider.py
…
image_gen_registry.py
…
image_routing.py
…
insights.py
…
iteration_budget.py
…
jiter_preload.py
…
lmstudio_reasoning.py
…
manual_compression_feedback.py
…
markdown_tables.py
…
memory_manager.py
…
memory_provider.py
…
message_sanitization.py
…
model_metadata.py
…
models_dev.py
…
moonshot_schema.py
…
nous_rate_guard.py
…
onboarding.py
…
plugin_llm.py
…
portal_tags.py
…
process_bootstrap.py
…
prompt_builder.py
…
prompt_caching.py
…
rate_limit_tracker.py
…
redact.py
…
retry_utils.py
…
runtime_cwd.py
…
shell_hooks.py
…
skill_bundles.py
…
skill_commands.py
…
skill_preprocessing.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
skill_utils.py
…
stream_diag.py
…
subdirectory_hints.py
…
system_prompt.py
…
think_scrubber.py
…
title_generator.py
…
tool_dispatch_helpers.py
…
tool_executor.py
…
tool_guardrails.py
…
tool_result_classification.py
…
trajectory.py
…
transcription_provider.py
…
transcription_registry.py
…
tts_provider.py
…
tts_registry.py
…
turn_context.py
…
turn_finalizer.py
…
turn_retry_state.py
…
usage_pricing.py
…
video_gen_provider.py
…
video_gen_registry.py
…
web_search_provider.py
…
web_search_registry.py
…