fix(reply): auto-inject replyToCurrent for reply threading

replyToMode "first"/"all" only filters replyToId but never generates
it — that required the LLM to emit [[reply_to_current]] tags. Inject
replyToCurrent:true on all payloads so applyReplyTagsToPayload sets
replyToId=currentMessageId, then let the existing mode filter decide
which replies keep threading (first only, all, or off).

Covers both final reply path (reply-payloads.ts) and block streaming
path (agent-runner-execution.ts).
This commit is contained in:
Andrey
2026-02-12 14:44:53 -05:00
committed by Peter Steinberger
parent 39ee708df6
commit 3d89f0f14a
3 changed files with 54 additions and 2 deletions

View File

@@ -63,7 +63,9 @@ export function applyReplyThreading(params: {
const { payloads, replyToMode, replyToChannel, currentMessageId } = params;
const applyReplyToMode = createReplyToModeFilterForChannel(replyToMode, replyToChannel);
return payloads
.map((payload) => applyReplyTagsToPayload(payload, currentMessageId))
.map((payload) =>
applyReplyTagsToPayload({ ...payload, replyToCurrent: true }, currentMessageId),
)
.filter(isRenderablePayload)
.map(applyReplyToMode);
}