Keep prompted Hermes sessions interactive - #8705
Open
spencerbull wants to merge 5 commits into
Open
Conversation
Hermes oneshot deliberately exits after answering, which closes the agent terminal. Seed the TUI chat session instead, keep inherited flags after the subcommand for older Hermes parsers, and bind the query as one argument so dash-prefixed prompts remain data. Co-Authored-By: Codex XHigh <noreply@openai.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Keeps prompted Hermes sessions interactive by launching its TUI with a seeded query instead of one-shot mode.
Changes:
- Uses
hermes chat --yolo --tui --query=...for prompted launches. - Adds coverage for prompted and unprompted Hermes launches.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-agent |
Keeps seeded Hermes sessions interactive. |
test/shell.d/default-agent-test.sh |
Verifies both Hermes launch modes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Hermes TUI startup queries execute slash, shell, interpolation, and multiline syntax before reaching the model. Run the prompt through literal one-shot mode, read its exact session ID from a private usage report, and resume that session in the TUI so arbitrary prompt text stays data while the conversation remains interactive. Co-Authored-By: Codex XHigh <noreply@openai.com>
Keep the one-shot session on Hermes' native CLI source so it records the launch directory before the exact session is resumed in the TUI. Co-Authored-By: Codex XHigh <noreply@openai.com>
Bind option-looking prompts to one-shot mode, require a successful completed usage report before resuming, replay the prompt after first-run setup, and reject Hermes runtimes that lack the session-report capability. Co-Authored-By: Codex XHigh <noreply@openai.com>
Clear inherited session-source tags for Omarchy's local one-shot process so Hermes records the launch directory before the exact session is resumed in the TUI. Co-Authored-By: Codex XHigh <noreply@openai.com>
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Aug 28, 2026
…t literally On a real TTY, `hermes chat -q "…"` (and `--tui -q`) now starts a normal interactive session with the prompt submitted literally as the first turn — no slash-command routing, no '!' shell dispatch, no $(...) interpolation, no file-drop rewriting — matching how other coding agents handle seeded launches (Omarchy prompted agent terminals, basecamp/omarchy#8705). Legacy answer-and-exit is preserved everywhere automation depends on it: - new `hermes chat --oneshot` flag (distinct dest from top-level -z) - -Q/--quiet machine-readable contract - any non-TTY stdio (kanban workers, cron, pipes, A2A) - top-level `hermes -z` unchanged CLI: seeded prompt rides a _SeededQueryMessage sentinel through process_loop, which skips the slash/!/file-drop dispatchers for that one message. TUI: STARTUP_QUERY submits via a new literal path (submitLiteral) that bypasses dispatchSubmission and the input.detect_drop rewrite.
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Aug 28, 2026
…t literally On a real TTY, `hermes chat -q "…"` (and `--tui -q`) now starts a normal interactive session with the prompt submitted literally as the first turn — no slash-command routing, no '!' shell dispatch, no $(...) interpolation, no file-drop rewriting — matching how other coding agents handle seeded launches (Omarchy prompted agent terminals, basecamp/omarchy#8705). Legacy answer-and-exit is preserved everywhere automation depends on it: - new `hermes chat --oneshot` flag (distinct dest from top-level -z) - -Q/--quiet machine-readable contract - any non-TTY stdio (kanban workers, cron, pipes, A2A) - top-level `hermes -z` unchanged CLI: seeded prompt rides a _SeededQueryMessage sentinel through process_loop, which skips the slash/!/file-drop dispatchers for that one message. TUI: STARTUP_QUERY submits via a new literal path (submitLiteral) that bypasses dispatchSubmission and the input.detect_drop rewrite.
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.
Prompted Hermes launches currently use
--oneshot, so Hermes exits after answering andomarchy-launch-tuicorrectly closes the agent terminal with it. Passing an arbitrary prompt through Hermes's TUI startup query is not safe because TUI control syntax can be interpreted instead of remaining literal prompt data.This change uses a two-stage handoff: seed Hermes with
--oneshot="$prompt"plus a temporary--usage-file, require a completed non-failed report with a nonempty exact session ID, then resume that session withhermes chat --yolo --tui --resume "$session_id". It clears inheritedHERMES_SESSION_SOURCEfor both stages so Hermes records the local CLI source and actual launch cwd/workspace, retries once after first-run provider setup, and removes the temporary usage file on every exit path.The installer now accepts any Hermes version exposing the required
--usage-filecapability, preserves unsupported foreign installations instead of taking ownership, and leaves the unprompted route ashermes --yolo.Exact SHA
64203cc2085717d29b7a13257bad1b48a2434cbfpassed 57 focused shell assertions and a credential-free disposable Omabot/Proxmox validation against real Hermes Agent 0.19.0. The runtime validation preserved a multiline option-shaped/control-syntax prompt literally, resumed the exact reported session, persistedsource=cliplus the correct cwd/workspace, cleaned temporary files on success and failure, preserved a foreign Hermes installation, and kept the unprompted argv unchanged. Residual runtime gaps are rendered-TUI automation and a successful real first-run setup replay; both control paths have focused mock coverage.This pull request is stacked on #7469's
hermes-agentbranch. No standalone issue is closed.🤖 Generated by GPT-5.6 in Codex. Reviewed and runtime-validated by Codex XHigh.