fix(tui): pool-route exec quick commands to unblock RPC reader (#67627) - #67789
JonthanaHanh wants to merge 1 commit into
Conversation
|
Thanks for working on this. I compared both implementations after the triage note. #67628 predates this PR, covers the same resolved To avoid maintaining two equivalent fixes, I agree that this PR should be closed as a duplicate in favor of #67628. |
|
Thanks for the focused TUI responsiveness fix. The premise is confirmed on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
SummaryTwo open PRs address Issue #67627 by pool-routing resolved exec quick commands so subprocess execution no longer blocks the RPC reader. #67628 reuses the shared routing path and adds focused exec-responsiveness and non-exec-alias tests, while #67789 implements equivalent routing through a duplicated submission block without corresponding tests. Related pull requests
Duplicates#67789 is a functional duplicate of #67628: both offload only resolved exec quick commands, while #67628 uses the shared routing predicate and includes focused regression coverage. Suggested consolidationKeep #67628 open with a salvage path: preserve its shared routing predicate and focused exec/non-exec regression tests. Close #67789 as duplicate of #67628 because its equivalent implementation duplicates pool-submission logic and contributes no distinct tested behavior. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I67627(["issue #67627 (open)"])
subgraph Dup67628 ["PRs duplicating each other"]
P67628["PR #67628 (open)"]
P67789["PR #67789 (open)"]
end
P67789 -->|fixes| I67627
class I67627 open
class P67628 open
class P67789 open
class P67628 best
class P67789 target
click I67627 "https://github.com/NousResearch/hermes-agent/issues/67627"
click P67628 "https://github.com/NousResearch/hermes-agent/pull/67628"
click P67789 "https://github.com/NousResearch/hermes-agent/pull/67789"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 6 kB of PR diffs, 7 kB of issue/PR text, 3 kB of discussion (4 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Fix
Route
command.dispatchwithtype: execquick commands to the thread pool so the RPC reader loop stays free while the subprocess runs (up to 30s timeout).Problem
command.dispatchruns synchronously on the TUI gateway RPC reader thread. When a quick command hastype: exec, the handler callssubprocess.run(..., timeout=30)inline. During this time, fast RPCs likesession.interruptorapproval.respondsit unread in the stdin pipe, making the TUI appear frozen.Root cause
dispatch()only offloads methods listed in_LONG_HANDLERS.command.dispatchis not in that set because most quick commands (aliases, slash commands) need inline ordering. But exec-type quick commands block the reader unnecessarily.Fix details
In
dispatch(), before the_LONG_HANDLERScheck, detectcommand.dispatchcalls targeting exec-type quick commands and route them to the pool. Non-exec quick commands remain inline to preserve ordering.The detection loads
quick_commandsfrom config and checks the resolved command'stype. Iftype == "exec", the handler runs on the pool; otherwise it falls through to normal inline dispatch.Fixes #67627