Skip to content

fix(tui): /skills browse no longer blocks the whole gateway#13661

Merged
OutThisLife merged 1 commit into
mainfrom
bb/tui-skills-manage-async
Apr 21, 2026
Merged

fix(tui): /skills browse no longer blocks the whole gateway#13661
OutThisLife merged 1 commit into
mainfrom
bb/tui-skills-manage-async

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

From TUI v2 retest: "when /skills browse happens i cant do anything. /skills browse blocks everything else."

Root cause

`skills.manage` action=`browse` / `search` / `install` calls `hermes_cli.skills_hub` which fetches 6 remote sources and can take ~15s. The handler ran on the main RPC dispatcher thread in `tui_gateway/server.py`, so while the network calls were in flight every other inbound RPC — completions, new slash commands, `approval.respond`, `session.interrupt` — sat queued in stdin. The TUI looked frozen.

The gateway already has a thread pool (`_pool`) for exactly this pattern, gated by the `_LONG_HANDLERS` set (covering `slash.exec`, `shell.exec`, `session.resume`, `session.branch`, `cli.exec`).

Fix

Add `skills.manage` to `_LONG_HANDLERS`. One-line set extension.

The fast actions (`list`, `inspect`) pay a negligible thread-pool hop; the slow ones stop blocking the main loop.

Test plan

  • `uv run pytest tests/test_tui_gateway_server.py` — 47/47 pass
  • Manual: `/skills browse` → during the 15s fetch, type `/tools list` or hit Tab for completions — expect immediate response, no frozen UI
  • Manual: `/skills browse` followed by `Ctrl+C` — still cancellable via approval/session mechanics

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents the TUI gateway’s JSON-RPC dispatcher from stalling during /skills browse (and other slow skills.manage actions) by routing skills.manage through the existing long-handler thread pool, keeping other RPCs responsive.

Changes:

  • Add skills.manage to _LONG_HANDLERS so it is dispatched via the thread pool.
  • Reformat _LONG_HANDLERS declaration to a multiline frozenset literal for readability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tui_gateway/server.py
Comment thread tui_gateway/server.py
@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/skills Skills system (list, view, manage) labels Apr 21, 2026
`/skills browse` is documented to scan 6 sources and take ~15s, but the
gateway dispatched `skills.manage` on the main RPC thread.  While it
ran, every other inbound RPC — completions, new slash commands, even
`approval.respond` — blocked until the HTTP fetches finished, making
the whole TUI feel frozen.  Reported during TUI v2 retest:
"/skills browse blocks everything else".

`_LONG_HANDLERS` already exists precisely for this pattern (slash.exec,
shell.exec, session.resume, etc. run on `_pool`).  Add `skills.manage`
to that set so browse/search/install run off the dispatcher; the fast
`list` / `inspect` actions pay a negligible thread-pool hop.
@OutThisLife OutThisLife force-pushed the bb/tui-skills-manage-async branch from 506f3b0 to 48f8244 Compare April 21, 2026 20:06
@OutThisLife OutThisLife merged commit 12c7f27 into main Apr 21, 2026
11 of 12 checks passed
@OutThisLife OutThisLife deleted the bb/tui-skills-manage-async branch April 21, 2026 20:51
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…-manage-async

fix(tui): /skills browse no longer blocks the whole gateway
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…-manage-async

fix(tui): /skills browse no longer blocks the whole gateway
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
…-manage-async

fix(tui): /skills browse no longer blocks the whole gateway
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…-manage-async

fix(tui): /skills browse no longer blocks the whole gateway
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…-manage-async

fix(tui): /skills browse no longer blocks the whole gateway
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…-manage-async

fix(tui): /skills browse no longer blocks the whole gateway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants