hermes - 💡(How to fix) Fix [Feature]: Built-in terminal should support RTK-first command rewriting for foreground/background execution [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#11488Fetched 2026-04-18 06:00:48
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Root Cause

This matters because RTK is useful for reducing noisy CLI output, lowering token/context cost, and making repository inspection, test output, and log reading cheaper in terminal-heavy sessions.

Code Example

Not attaching a debug report for now, since this is primarily a feature request about terminal execution behavior rather than a single crash scenario.
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Hermes built-in terminal currently executes shell commands directly through its terminal backend paths, so RTK-first workflows are not enforced at the execution layer.

This means RTK preference can exist in persona / user profile / skills, but terminal execution may still run raw commands unless the model explicitly prefixes them every time.

This matters because RTK is useful for reducing noisy CLI output, lowering token/context cost, and making repository inspection, test output, and log reading cheaper in terminal-heavy sessions.

Proposed Solution

Add a built-in RTK-first rewrite layer for simple shell commands in the terminal execution path.

Suggested behavior:

  • rewrite simple commands to rtk ... before execution
  • do not double-wrap commands already starting with rtk
  • apply the same policy to both foreground and background execution
  • keep complex shell constructs excluded initially (&&, ||, |, redirection, multiline scripts, etc.)

Optional but useful:

  • if RTK execution fails, retry the raw command once

Likely implementation points:

  • tools/environments/base.py
  • tools/process_registry.py

A shared command rewrite helper would allow both execution paths to follow the same RTK-first policy.

Alternatives Considered

I considered relying only on persona / user profile / skills instructions, but that does not guarantee RTK usage at the actual terminal execution layer.

I also considered solving this through a plugin or external hook, but the terminal execution paths appear to be implemented in core foreground/background code paths, so a small built-in rewrite layer seems more reliable and consistent.

Another option is to keep using raw commands and require the model to manually prefix rtk every time, but that is less reliable and easy to miss in practice.

Feature Type

CLI improvement

Scope

Small (single file, < 50 lines)

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

Not attaching a debug report for now, since this is primarily a feature request about terminal execution behavior rather than a single crash scenario.

extent analysis

TL;DR

Implement a built-in RTK-first rewrite layer in the terminal execution path to enforce RTK usage for simple shell commands.

Guidance

  • Identify the terminal execution paths in tools/environments/base.py and tools/process_registry.py to determine where to integrate the RTK-first rewrite layer.
  • Develop a shared command rewrite helper to apply the RTK-first policy consistently across both foreground and background execution.
  • Consider implementing a retry mechanism to execute the raw command if RTK execution fails.
  • Ensure the rewrite layer excludes complex shell constructs, such as &&, ||, |, redirection, and multiline scripts, to avoid interfering with existing functionality.

Example

def rewrite_command(command):
    if not command.startswith('rtk '):
        return 'rtk ' + command
    return command

This example illustrates a basic command rewrite function that prefixes rtk to simple commands.

Notes

The implementation should be careful not to double-wrap commands already starting with rtk to avoid unnecessary overhead.

Recommendation

Apply workaround by implementing the built-in RTK-first rewrite layer, as it provides a more reliable and consistent solution than relying on manual prefixing or external plugins.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: Built-in terminal should support RTK-first command rewriting for foreground/background execution [1 participants]