Repository navigation
feat: nudge assistant to stay quiet when silent mode streams a second message - #1885
Merged
Merged
Conversation
… message When agent.silent is true and a second text-bearing assistant message starts in the same turn, abandon the stream before that text renders and send the hidden nudge 'Stay quiet, silent mode is enabled'. Bounded by autoContinueLimit.
The nudge corrects behavior rather than continuing a turn, so it no longer increments autoContinueCountRef or checks the auto-continue limit.
3 of 12 tasks
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.
Description
When
agent.silentis true and a second text-bearing assistant message starts streaming in the same turn, the stream is abandoned before that text renders and a hidden nudge, "Stay quiet, silent mode is enabled", is sent to the assistant. The nudge reuses the existing silent "Continue" / "You're looping" pattern, but it corrects behavior rather than continuing a turn, so it is not counted againstautoContinueLimit.Type of Change
Testing
Added
tests/unit/stream/silentMode.test.js(11 tests). It coversconsumeStreamsilent detection (second message abandons the stream without forwarding its text, chunks of one message are not flagged, tool-call-only messages and subagent messages are ignored, nothing is flagged when silent is off) andshouldNudgeSilent(violation, interrupted turn, non-last bubble, not bound by the auto-continue limit, nudge text). The full suite and coverage ran green via the pre-commit hook. The behavior has not been exercised in the live TUI.Coverage
Checklist
npm run lintpassesThreat model
N/A. No new inputs, I/O, or network calls. The nudge is a fixed constant string, gated by an existing config flag.