Skip to content

fix(cli): add /sessions handler + recover oneshot response (#22951, #22975) - #23006

Closed
KhanCold wants to merge 7 commits into
NousResearch:mainfrom
KhanCold:fix-22951-sessions
Closed

fix(cli): add /sessions handler + recover oneshot response (#22951, #22975)#23006
KhanCold wants to merge 7 commits into
NousResearch:mainfrom
KhanCold:fix-22951-sessions

Conversation

@KhanCold

@KhanCold KhanCold commented May 10, 2026

Copy link
Copy Markdown

Closing in favor of individual PRs per issue. Will split into separate focused PRs as per project guidelines.

KhanCold added 2 commits May 10, 2026 13:50
Fixes NousResearch#22951

The /sessions slash command was registered in CommandDef registry
(commit 09a4914) but only had a handler in TUI mode. This adds
the missing handler for classic CLI mode.

- Add elif canonical == "sessions" branch in process_command()
- Add _handle_sessions_command() that opens SessionDB, lists sessions,
  and calls _session_browse_picker() for interactive selection
- Handle edge cases: no sessions, DB errors, user cancellation
- Use lazy imports to avoid circular dependencies
…eaming returns empty

Fixes NousResearch#22975

hermes -z exits with code 0 but produces zero bytes on stdout. The agent
successfully calls the API and receives a valid response, but agent.chat()
returns empty string when streaming consumes the response before capture.

- After agent.chat(), check agent._last_full_response for the accumulated response
- Fallback: reconstruct from conversation_history assistant messages
- Zero breaking changes — additive recovery logic only
- Fixes empty stdout across all providers (anthropic, mlx, grok, gemini)
@KhanCold KhanCold changed the title fix(cli): add /sessions handler for classic REPL mode (#22951) fix(cli): add /sessions handler + recover oneshot response (#22951, #22975) May 10, 2026
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels May 10, 2026
KhanCold added 2 commits May 10, 2026 14:04
Fixes NousResearch#22976

When working with multiple Hermes TUI sessions side by side, users resize
terminal windows frequently. Each resize event caused blank separator lines
(─) to accumulate because Ink's VDOM diff does not clear previous terminal
output when canvas geometry changes.

- Add terminal clear escape sequence (\x1b[2J\x1b[H) before re-rendering on resize
- This forces a full screen invalidation, preventing ghost line accumulation
- No impact on normal operation — only fires during resize events
Fixes NousResearch#22970

Running /new, /clear, /undo, or /reload-mcp mid-turn produced a RuntimeWarning:
'coroutine run_in_terminal.<locals>.run was never awaited'

The warning occurred because _prompt_text_input() called run_in_terminal()
from process_loop which runs in a background thread. run_in_terminal()
returns a coroutine that can't be scheduled on the main event loop when
called from a non-main thread.

- Add threading.current_thread() is threading.main_thread() guard before
  calling run_in_terminal(), matching the pattern in _run_curses_picker()
- Fall back to direct _ask() call when on a background thread
- Fixes RuntimeWarning for all destructive slash commands:
  /new, /clear, /undo, /reload-mcp
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix for #22951 — also see #22965 and #22962 which address the same missing /sessions handler in classic CLI.

KhanCold and others added 3 commits May 10, 2026 14:28
… role

Fixes NousResearch#22961

In the Dashboard session view, vision_analyze tool results were displayed
with the sender label as 'user' instead of 'tool'. This happened because
the message role was incorrectly set to 'user' for some vision tool results.

- Add effectiveRole override in MessageBubble: when a message has
  tool_name but role is 'user', display it as 'tool' role instead
- This ensures vision_analyze results show the correct 'tool' label
  and styling (warning/amber color instead of primary)
- Only affects display — does not modify the underlying session data
Fixes NousResearch#22960

The /indicator slash command was registered in COMMAND_REGISTRY but had no
handler in process_command(), making it silently fail in non-TUI CLI mode.

- Add _handle_indicator_command() method to set busy-indicator style
  (kaomoji/emoji/unicode/ascii) via save_config_value()
- Add elif canonical == "indicator" dispatch branch in process_command()
- Supports status query (/indicator, /indicator status) and style setting
  (/indicator kaomoji|emoji|unicode|ascii)
- Mirrors the TUI gateway's config.set handler in tui_gateway/server.py
Fixes NousResearch#22952

The npm build script in ui-tui/package.json ended with '&& chmod +x dist/entry.js',
which fails on Windows because chmod is not a valid command. This caused
'hermes --tui' to fail with 'TUI build failed' even though all compilation
steps (esbuild, tsc, babel) succeeded.

- Remove '&& chmod +x dist/entry.js' from the build script
- The execute bit is a cosmetic POSIX convenience — the TUI launcher
  always invokes it via 'node dist/entry.js', which works regardless
  of file permissions
- Fixes Windows TUI startup failure
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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants