Skip to content

fix(env-probe): capture probe output via temp files so descendants can't stall the read (#67964 follow-up) - #68045

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-1a618f9e
Jul 20, 2026
Merged

fix(env-probe): capture probe output via temp files so descendants can't stall the read (#67964 follow-up)#68045
teknium1 merged 1 commit into
mainfrom
hermes/hermes-1a618f9e

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of #67991 by @PRATHAMESH75: the env probe now captures subprocess output through temp files instead of pipes, so timeout bounds the whole call and a lingering pipe-holding descendant can't stall the probe at all — improving on the tree-kill approach merged in #67999 for the same bug (#67964).

Why this is better than what #67999 shipped in _run: temp files have no reader threads, so wait() only ever waits on the direct child. A fast pip that leaves a lingering descendant now returns its real output in milliseconds (probe line survives), where the pipe-based path burned the full 3s timeout and discarded the output. The _kill_process_tree helper from #67999 becomes unnecessary and is removed; the fail-open worker/event layer around callers (also from #67999) stays — it guards against any future probe hang class.

Changes

Validation

Pipe capture (#67999) Temp-file capture (this PR)
Fast pip + lingering descendant (E2E, real shim) 3s timeout burned, output lost real output in 0.03s
Fully hung pip, 4 concurrent sessions (E2E) bounded, 3.2s, fail open bounded, 3.2s, fail open
tests/tools/test_env_probe.py 14 tests 15 tests, green
tests/run_agent/test_run_agent.py 451/451 green (combined run)

Contributor authorship preserved via cherry-pick; merge with rebase.

Credit: @PRATHAMESH75 submitted the temp-file capture mechanism in #67991 before #67999 was opened.

Infographic

env-probe-tempfile-capture

@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets platform/windows Native Windows-specific behavior or breakage P1 High — major feature broken, no workaround sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Jul 20, 2026
@teknium1
teknium1 merged commit e77ffdc into main Jul 20, 2026
33 checks passed
@teknium1
teknium1 deleted the hermes/hermes-1a618f9e branch July 20, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P1 High — major feature broken, no workaround platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants