Commit Graph

18 Commits

Author SHA1 Message Date
kshitijk4poor
57644ec000 fix(process): a family's stop path releases its group only once the group is empty
Same class as the router fix: nine stop paths released their group from the owner-death supervisor
as soon as the leader exited, but members that ignore TERM or outlive the leader keep the group
alive. Releasing it let those members survive a later kill -9 of this process.

Lightpanda, real-profile Chrome, embedded cua-driver, the TTS command provider, dashboard WhatsApp
pairing, the raft and WhatsApp bridges, verify's app server, agent-browser session groups, and
Browser Use harness daemons stopped by --reload now go through release_process_group_once_empty.

New test stops a raft bridge whose TERM-ignoring helper survives. It fails when raft releases
unconditionally, and the group stays covered with the fix. Test seams moved from the per-module
release_process_groups name to the shared helper.

Reported by Greptile on #137057 (thread on the router).
2026-10-29 16:58:09 +05:30
kshitijk4poor
118712327d fix(tts): a command TTS/STT provider dies with the Hermes process that ran it (orphans after kill -9: 3 -> 0)
Command providers run in their own session so the IDLE timeout (default 120 s, reset by every byte
of output) can kill the whole tree. That timer lives in the Hermes process: a SIGKILLed or
OOM-killed gateway left a stalled or long-running provider (a shell plus its synthesiser) running
forever, detached and reparented to init.

run_command_provider now starts the command through process_identity.spawn_owned (POSIX: group
leader, group handed to the owner-death supervisor, so provider_popen_group_kwargs no longer adds
start_new_session) and releases the group once the command has exited or the idle kill stopped it.
Windows keeps its CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW flags and taskkill tree kill.

Measured on Linux, owner killed inside the idle timeout, 6 s settle: origin/main 3 of 3
survived; this commit 0 of 4 descendants. New kill -9 / live-owner case and an own-then-release
test (success and idle kill); reverting spawn_owned to the main-era Popen turns the kill -9 case
red. Existing spawn-kwargs tests now patch the module's spawn_owned seam.
2026-10-29 16:58:09 +05:30
Maciej Lisiewski
0006a5e229 ci: fix PLW1509, PLW1510, PLW2101 linter errors 2026-10-10 15:20:13 +02:00
Maciej Lisiewski
2ff58849f4 ci: ruff UP037 fixes 2026-10-09 17:34:38 +02:00
Maciej Lisiewski
d76cce4f11 ci: apply all automatic linter fixes available 2026-10-08 17:22:54 +02:00
Brooklyn Nicholson
72f51ba66f fix(tts): hide the console window on Windows command-provider spawns
run_command_provider() spawns the user's TTS/STT command-provider shell with
shell=True and, on Windows, creationflags=CREATE_NEW_PROCESS_GROUP only.
shell=True routes through cmd.exe, a console-subsystem shim, so without
CREATE_NO_WINDOW the child allocates a visible console window flash on every
provider run from a windowless host (pythonw gateway, TUI, Desktop) — issue
#101585.

Switch the branch to the shared bundle
hermes_cli/_subprocess_compat.windows_detach_flags_without_breakaway()
(CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW), extracted into a pure
provider_popen_group_kwargs(os_name) helper so the platform contract is
assertable on every host. CREATE_BREAKAWAY_FROM_JOB is deliberately NOT used:
the provider is foreground-owned and killed by us on idle timeout, so job
teardown propagation must keep working. POSIX keeps start_new_session=True.

Same bug class one path later: terminate_command_process_tree()'s taskkill
run also lacked flags — give it windows_hide_flags() so the idle-timeout kill
doesn't flash a console either.

Co-authored-by: finn763 <165816600+finn763@users.noreply.github.com>
2026-10-02 18:35:34 -05:00
John Paul Soliva
1df4af417f fix(tts): resolve command-provider env_passthrough through the profile secret scope
run_command_provider forwarded declared env_passthrough keys from os.environ,
which under the multiplexer is the LAUNCH profile's .env. A served profile's
command TTS/STT subprocess (voice-note transcription, speech, warm/release
hooks) got the launch profile's credential and never its own. Resolve each key
with resolve_passthrough_value, as the terminal and code-execution spawns do.

(cherry picked from commit 22a299d5f562e1d174fa5d37590cd46361a1383a)
2026-09-28 12:23:25 -07:00
Teknium
fc9ed6973e simplify(compat): tts_tool — drop 57 re-exports/aliases, repoint 10 callers + 23 test files 2026-09-03 13:20:22 -07:00
Teknium
b57f17bd4b fix(late-slices): restore subprocess footgun guards re-collapsed by r3-30/33/34/36 tails; telegram format_message stays self-free (staticmethod via class ref); _captured_exec explicit shell/env kwargs 2026-09-03 05:33:46 -07:00
Teknium
ff44eca74f refactor(tools): compact STT module docstrings and section banners, keep every invariant 2026-09-03 01:13:03 -07:00
Teknium
198fe72a35 refactor(tools): compact TTS command/streaming/normalizer docstrings, keep every invariant 2026-09-03 01:02:21 -07:00
Teknium
412ddb6772 refactor(tools): drop unreachable legacy TTS strip fallback and duplicated streamer sample rates; STT/TTS config wrappers as partials 2026-09-03 00:57:29 -07:00
Teknium
d85b86e97a refactor(tools): AST-neutral closer/bracket hug pass over STT/TTS modules 2026-09-03 00:53:14 -07:00
Teknium
9d4dd9b1f1 refactor(tools): collapse command-provider quoting/process-tree/config guards into single expressions 2026-09-03 00:38:22 -07:00
Teknium
7ed48064db refactor(tools): compact STT/TTS docstrings and comments, keep every invariant 2026-09-02 23:11:57 -07:00
Teknium
4d37eddc2f refactor(tools): unify STT/TTS command-provider config helpers, REST STT flow, dispatch tables 2026-09-02 22:41:57 -07:00
Teknium
d913175067 refactor(tts): move command-provider config layer into tts_command_provider
Completes the half-done move snapshotted by the parent (wip commit 283f63b):
the tts.providers.<name> config layer (_get_named_provider_config,
_resolve_command_provider_config, _generate_command_tts, ...) now lives in
tools/tts_command_provider.py; tts_tool re-imports the historical names.
2026-09-02 16:44:05 -07:00
Teknium
d4cec15b47 refactor(tools): first-wave simplification of tools/ (file ops split, lazy_deps, code_exec, approval, browser, delegate, mcp, skills, terminal, voice, media)
Behavior-neutral structural pass over tools/*: god-file extractions into
sibling modules (file_operations_common/lint/search, file_tools_paths/
read_tracking/write, code_execution_env/rpc, tool_search_catalog/names/
validation, tts_command_provider, ...), duplicate helper unification,
if/elif -> dispatch tables, dead-code removal, docstring compaction.
Tool schemas (get_tool_definitions) verified byte-identical to base.
2026-09-02 14:43:45 -07:00