Fix #747: Add explicit terminal/shell access awareness to system prompt#834
Open
fuleinist wants to merge 1 commit intoNousResearch:mainfrom
Open
Fix #747: Add explicit terminal/shell access awareness to system prompt#834fuleinist wants to merge 1 commit intoNousResearch:mainfrom
fuleinist wants to merge 1 commit intoNousResearch:mainfrom
Conversation
… system prompt When the terminal tool is available, inject clear guidance that the agent has shell access and should use the terminal tool directly instead of outputting code blocks for the user to copy-paste. This addresses the issue where hermes-agent would 'forget' it has shell access and output code on-screen instead of executing it. Changes: - Add TERMINAL_GUIDANCE constant in agent/prompt_builder.py - Inject TERMINAL_GUIDANCE in _build_system_prompt() when terminal tool is available - Follows the same pattern as MEMORY_GUIDANCE, SKILLS_GUIDANCE, etc.
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.
Summary
Fixes #747 - Agent consistently forgets it has shell access
Problem
Users reported that Hermes Agent would 'forget' it has shell access and output code blocks for the user to copy-paste instead of using the terminal tool directly.
From the issue:
Solution
Add explicit
TERMINAL_GUIDANCEthat gets injected into the system prompt when theterminaltool is available. This follows the same pattern as existing guidance constants (MEMORY_GUIDANCE,SKILLS_GUIDANCE,SESSION_SEARCH_GUIDANCE).The guidance explicitly tells the agent:
Changes
TERMINAL_GUIDANCEconstant inagent/prompt_builder.pyTERMINAL_GUIDANCEin_build_system_prompt()whenterminaltool is availableTesting
How it works
When the agent initializes, it checks which tools are available. If the
terminaltool is invalid_tool_names, theTERMINAL_GUIDANCEstring is appended to the system prompt. This ensures the agent is explicitly aware of its shell access capabilities at the start of every session.