Skip to content

fix(web-server): reap zombie action subprocesses + fix meet_bot pcm_pump leak - #38040

Closed
ygd58 wants to merge 4 commits into
NousResearch:mainfrom
ygd58:fix/web-server-zombie-reap
Closed

fix(web-server): reap zombie action subprocesses + fix meet_bot pcm_pump leak#38040
ygd58 wants to merge 4 commits into
NousResearch:mainfrom
ygd58:fix/web-server-zombie-reap

Conversation

@ygd58

@ygd58 ygd58 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Problem

Two zombie process leaks (issue #38032):

  1. web_server.py: proc.poll() reads exit code but never reaps — every completed dashboard action lingers as <defunct>
  2. meet_bot.py: pcm_pump (paplay/ffmpeg) never cleaned up on bot exit

Fix

  1. After poll() returns non-None, call proc.wait(timeout=1) and remove from _ACTION_PROCS
  2. Add pcm_pump.terminate() + .wait(timeout=3) to meet_bot teardown

Fixes #38032

ygd58 added 4 commits May 28, 2026 18:26
…read from config

Two fixes for issue NousResearch#33947 (regression in cc8e5ec):

1. Silent drop logging: when require_mention filters a message, log at
  INFO level with channel/author context so operators can diagnose
  why bots are silent without source-patching. Previously logged at
  DEBUG (invisible at default log level).

2. auto_thread config awareness: read discord.auto_thread from
  config.extra first (like require_mention already does), falling
  back to DISCORD_AUTO_THREAD env var. Profiles without an explicit
  discord: block now get env-var behavior instead of hardcoded true.

Fixes NousResearch#33947 (partial — addresses items 2 and 3 from the proposed fixes)
INFO-level logging for every dropped message is too noisy in busy
Discord servers — can generate hundreds of log lines per minute.
DEBUG is appropriate: useful for diagnosing silent bot issues but
not cluttering production monitoring.

Suggested by @liuhao1024 in review of NousResearch#33975.
The status bar context meter read context_compressor.context_length
which could hold a stale value from a previous model/alias session.
When model_aliases defines a persona with a different context_length
(e.g. sophia-cloud: m2.7, 204800K) and the active model is different
(m3, 1M), the compressor value could show the alias context instead
of the active model's (issue NousResearch#38006).

Fix: re-resolve context_length via get_model_context_length() with
the agent's current model+provider+base_url+config_context_length,
falling back to the compressor value if resolution fails.

Fixes NousResearch#38006
…ump leak

Two zombie process fixes (issue NousResearch#38032):

1. hermes_cli/web_server.py: after proc.poll() returns non-None,
  call proc.wait(timeout=1) to reap the child and remove it from
  _ACTION_PROCS. Without this, every completed dashboard action
  (update, restart, etc.) lingers as a <defunct> zombie.

2. plugins/google_meet/meet_bot.py: add pcm_pump cleanup to the
  teardown block — terminate() + wait(timeout=3) so the paplay/
  ffmpeg subprocess is reaped on normal bot exit.

Fixes NousResearch#38032
@teknium1

teknium1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Superseded by #38049 (commit 78e2101), now merged to main — closes #38032. The zombie-reap half of your PR is fully covered there. Note the meet_bot pcm_pump cleanup was a separate concern from this issue; if you'd like that change landed on its own, please open a focused PR for it and we'll review. Thanks!

@teknium1 teknium1 closed this Jun 8, 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 comp/plugins Plugin system and bundled plugins 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.

[Bug]: web_server.py: dashboard action subprocesses become zombies — _ACTION_PROCS uses .poll() but never .wait()

3 participants