Skip to content

feat: add busy command API for plugins and extensions #10281

@iRonin

Description

@iRonin

Problem

When a slash command, plugin, or extension performs a long-running operation (e.g. context compression, skills install, MCP reload), the TUI input prompt remains active and unblocked. The user can type while the operation runs, which causes:

  1. Input being consumed during the operation (user types into a prompt that is about to be replaced)
  2. No visible status indicator in the TUI status bar
  3. Plugins have no standard way to signal 'I am busy, block input'

Proposal

Add a reusable busy command API that any plugin, extension, or core feature can use to:

  • Block the TUI input prompt during long operations
  • Display a spinner and status message in the TUI status bar
  • Restore input automatically when the operation completes

Core Implementation

Add _busy_command(status: str) context manager to HermesCLI:

with self._busy_command("Installing skill..."):
    # long-running operation here
    # input is blocked, spinner shows in status bar

The context manager:

  1. Sets _command_running = True -- blocks input rendering
  2. Sets _command_status -- shown in status bar with spinner
  3. Prints the status message to the output
  4. On exit, resets both flags and restores the prompt

Plugin Integration

Plugins should be able to access this via the plugin context (ctx):

def register(ctx):
    ctx.register_busy_indicator("my-plugin-status")

# Later, during a long operation:
ctx.set_busy("Processing files...")
try:
    result = do_something_slow()
finally:
    ctx.clear_busy()

Use Cases

Feature Status Message
/compress "Compressing context..."
/skills install "Installing skill..."
/reload-mcp "Reloading MCP servers..."
Plugin: memory flush "Saving memories..."
Plugin: file processing "Processing 23 files..."

Implementation Notes

  • The _busy_command context manager already exists in cli.py -- this issue is about making it available to plugins as a formal API
  • Add a _compressing flag on AIAgent to block input during auto-compression in the agent loop
  • Add _compressor_info() method on AIAgent to return the active compressor name and settings for display

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardcomp/pluginsPlugin system and bundled pluginscomp/tuiTerminal UI (ui-tui/ + tui_gateway/)type/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions