Skip to content

fix(background-review): silence memory provider teardown output leak (#25342)#25499

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-65abd7c4
May 14, 2026
Merged

fix(background-review): silence memory provider teardown output leak (#25342)#25499
teknium1 merged 1 commit into
mainfrom
hermes/hermes-65abd7c4

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Background review fork redirected stdout/stderr around run_conversation() so its iteration messages stay silent. But the memory-provider teardown (shutdown_memory_provider() and review_agent.close()) fired in the outer finally block AFTER the redirect_stdout context exited — so provider teardown prints (Honcho disconnect, Hindsight sync, etc.) leaked into the parent terminal at end of every turn.

Moves the teardown inside the redirect_stdout scope on the success path (and nulls review_agent so the finally safety-net skips double-shutdown). The finally block is rewritten as an exception-path safety net that re-opens a devnull redirect, since the original with context has already exited by the time finally runs.

Salvage of #25342 by @ayushere. Manually re-applied + merged conflict with current main's set_thread_tool_whitelist wiring.

Background review fork redirected stdout/stderr around run_conversation()
so its iteration messages stay silent.  But the memory-provider teardown
(shutdown_memory_provider() and review_agent.close()) fired in the outer
finally block AFTER the redirect_stdout context exited — so provider
teardown prints (Honcho disconnect, Hindsight sync, etc.) leaked into
the parent terminal at end of every turn.

Moves the teardown inside the redirect_stdout scope on the success path
(and nulls review_agent so the finally safety-net skips double-shutdown).
The finally block is rewritten as an exception-path safety net that
re-opens a devnull redirect, since the original 'with' context has
already exited by the time finally runs.

Salvage of #25342 by @ayushere (manually re-applied + merged conflict
with current main's set_thread_tool_whitelist wiring).
@teknium1 teknium1 merged commit 55ba02b into main May 14, 2026
@teknium1 teknium1 deleted the hermes/hermes-65abd7c4 branch May 14, 2026 06:17
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-65abd7c4 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8319 on HEAD, 8319 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4381 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants