Conversation
Contributor
|
Merged via #79170 — your commits cherry-picked onto current main with authorship preserved (rebase merge). Thank you for the contribution! The steer marker one-shot lifetime contract is a solid defense-in-depth improvement. |
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.
Fixes #78237
Summary
Prevent an already-delivered mid-turn user message from being interpreted again as a fresh OUT-OF-BAND instruction during a long-running turn.
Root cause
Hermes appends trusted OOB messages to a tool result. That marker remains in immutable conversation history and is therefore included in later API requests.
The existing system-prompt contract established that the marker was trustworthy, but did not distinguish:
A model could consequently interpret the historical marker as a new instruction and repeat previously completed, potentially non-idempotent work.
Fix
The fix does not mutate previous messages, rebuild the system prompt mid-conversation, or change message-role alternation, so prompt-cache stability is preserved.
Duplicate check
No PR currently references or fixes #78237.
Related work was inspected and is distinct:
/steermessages with the correct trust marker.None defines the one-shot lifetime of a genuine historical OOB marker.
Validation
tests/run_agent/test_steer.pytests/agent/test_prompt_builder.pygit diff --checkpassedThe broader
tests/agent/test_system_prompt.pyfile has an unrelated pre-existing Windows path-normalization assertion (/hermesvs\hermes); the changed OOB suites are green.