fix(auto-reply): prevent duplicate transcript entries for followup queue messages#17340
Closed
Facens wants to merge 1 commit into
Closed
fix(auto-reply): prevent duplicate transcript entries for followup queue messages#17340Facens wants to merge 1 commit into
Facens wants to merge 1 commit into
Conversation
bfc1ccb to
f92900f
Compare
e014876 to
5c74271
Compare
…eue messages When messages arrive while the agent is busy, the followup queue processes them and routes the response via routeReply. The delivery-mirror mechanism in routeReply writes the assistant response to the session transcript, but the embedded agent already persists the response during its normal run. This causes duplicate assistant messages in the transcript, which can confuse the model on subsequent interactions. Add mirror: false to the routeReply call in sendFollowupPayloads to suppress the redundant delivery-mirror copy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5c74271 to
6e10cdb
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
This was referenced Apr 20, 2026
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
routeReply. This produces duplicate assistant messages in the transcript, which can confuse the model on subsequent interactions.mirror: falseto therouteReplycall insidesendFollowupPayloadsinsrc/auto-reply/reply/followup-runner.ts. Since the agent already persists its response in the session transcript, the delivery-mirror copy is redundant for followup queue messages.mirror: falseparameter to the existingrouteReply({ ... })call at line 97.Details
routeReplyaccepts an optionalmirrorparameter (defined insrc/auto-reply/reply/route-reply.ts). Whenmirroris not explicitlyfalseand asessionKeyis provided, the reply is mirrored into the session transcript. For followup queue runs,sessionKeyis always provided (line 94:sessionKey: queued.run.sessionKey), so the mirror fires unconditionally. But the embedded agent that processes the followup already saves the response to the transcript as part of its normal execution, creating the duplicate.Setting
mirror: falsedisables only the delivery-mirror copy; the agent's own transcript persistence is unaffected.Test plan
routeReplycalls (which do not setmirror: false) continue to mirror as beforeContribution checklist
pnpm build && pnpm check && pnpm test— all passing🤖 Generated with Claude Code
Greptile Summary
Adds
mirror: falseparameter torouteReplycall in followup queue handler to prevent duplicate assistant responses in session transcripts. The embedded agent already persists its response during execution, so the delivery-mirror copy is redundant for followup messages.Confidence Score: 5/5
mirror: falsebehavior (route-reply.test.ts:380-395), and doesn't affect other call sites. The embedded agent's transcript persistence is independent of the mirror mechanism.Last reviewed commit: 5c74271
(4/5) You can add custom instructions or style guidelines for the agent here!