fix(cli): enable editing in custom model prompt - #90327
Closed
helix4u wants to merge 2 commits into
Closed
Conversation
helix4u
marked this pull request as ready for review
August 19, 2026 22:56
teknium1
added a commit
that referenced
this pull request
Aug 20, 2026
…diting Widens #90327's line_input() to the whole bug class: all 46 bare input() free-text prompt sites across the setup wizards (model_setup_flows, setup, config, gateway, auth, auth_commands, plugins_cmd, skills_hub, bundles, setup_whatsapp_cloud, main) now route through line_input(), and the shared cli_output.prompt() / setup.prompt() helpers do too — so every CLI wizard gets cursor editing, not just the custom model prompt. Redirected stdin and missing prompt_toolkit keep builtin input() behavior. E2E: real PTY with raw escape bytes through line_input, cli_output.prompt, and setup.prompt (arrows + Ctrl+A/E edit correctly); redirected-stdin fallback verified.
Contributor
|
Merged via PR #90345 with your commit cherry-picked onto current main, authorship preserved in git log. We widened your line_input() fix to all 46 bare input() free-text prompt sites across the setup wizards plus the shared prompt() helpers. Thanks! |
lisajlau
pushed a commit
to lisajlau/hermes-agent
that referenced
this pull request
Aug 20, 2026
…diting Widens NousResearch#90327's line_input() to the whole bug class: all 46 bare input() free-text prompt sites across the setup wizards (model_setup_flows, setup, config, gateway, auth, auth_commands, plugins_cmd, skills_hub, bundles, setup_whatsapp_cloud, main) now route through line_input(), and the shared cli_output.prompt() / setup.prompt() helpers do too — so every CLI wizard gets cursor editing, not just the custom model prompt. Redirected stdin and missing prompt_toolkit keep builtin input() behavior. E2E: real PTY with raw escape bytes through line_input, cli_output.prompt, and setup.prompt (arrows + Ctrl+A/E edit correctly); redirected-stdin fallback verified.
bobaba76
pushed a commit
to bobaba76/hermes-agent
that referenced
this pull request
Aug 27, 2026
…diting Widens NousResearch#90327's line_input() to the whole bug class: all 46 bare input() free-text prompt sites across the setup wizards (model_setup_flows, setup, config, gateway, auth, auth_commands, plugins_cmd, skills_hub, bundles, setup_whatsapp_cloud, main) now route through line_input(), and the shared cli_output.prompt() / setup.prompt() helpers do too — so every CLI wizard gets cursor editing, not just the custom model prompt. Redirected stdin and missing prompt_toolkit keep builtin input() behavior. E2E: real PTY with raw escape bytes through line_input, cli_output.prompt, and setup.prompt (arrows + Ctrl+A/E edit correctly); redirected-stdin fallback verified.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…diting Widens NousResearch#90327's line_input() to the whole bug class: all 46 bare input() free-text prompt sites across the setup wizards (model_setup_flows, setup, config, gateway, auth, auth_commands, plugins_cmd, skills_hub, bundles, setup_whatsapp_cloud, main) now route through line_input(), and the shared cli_output.prompt() / setup.prompt() helpers do too — so every CLI wizard gets cursor editing, not just the custom model prompt. Redirected stdin and missing prompt_toolkit keep builtin input() behavior. E2E: real PTY with raw escape bytes through line_input, cli_output.prompt, and setup.prompt (arrows + Ctrl+A/E edit correctly); redirected-stdin fallback verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds normal line editing to the custom model-name prompt. On an interactive terminal, the prompt now uses Hermes' existing
prompt_toolkitdependency, so Left/Right and Ctrl+A/Ctrl+E edit the entered model name instead of printing raw escape bytes.The helper is intentionally narrow: redirected input/output keeps the existing built-in
input()path, imports stay lazy, and password or masked-secret prompts are unchanged.The root cause was the transition from the curses model picker to a bare
input("Enter model name: ")call. A scripted Python process does not initialize a readline-style editor for that call, so affected terminals pass cursor keys through as visible VT sequences.Related Issue
Reported in the Discord support thread arrow keys are not correctly processed by CLI wizard.
Related open PRs #83045 and #40458 affect the curses picker itself, but neither changes the subsequent custom model-name prompt covered here.
Type of Change
Changes Made
hermes_cli/cli_output.py: add a TTY-aware non-secret line-input helper backed byprompt_toolkit, with the existing built-ininput()behavior retained for redirected streams or an unavailable dependency.hermes_cli/auth.py: use that helper in both custom model-name branches, including the numbered fallback.tests/hermes_cli/test_cli_output.py: cover Left/Right and Ctrl+A/Ctrl+E editing through a real prompt-toolkit pipe, plus the redirected-input fallback.tests/hermes_cli/test_terminal_menu_fallbacks.py: verify both model-selector paths use the line editor.How to Test
hermes modeland select a provider with a model picker.Enter custom model name.tests/hermes_cli/test_cli_output.pyandtests/hermes_cli/test_terminal_menu_fallbacks.py.Local validation:
ruff checkon all four changed files: passedruff format --checkon the newly formatted helper and helper-test files: passedgit diff --check: passedChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) - N/A; no documented workflow changescli-config.yaml.exampleif I added/changed config keys - N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - N/AScreenshots / Logs
Not applicable. The regression is exercised with prompt-toolkit pipe input so the terminal key sequences remain deterministic in CI.