fix(auto-reply): tighten silent token semantics and prefix streaming

This commit is contained in:
Ayaan Zaidi
2026-02-26 15:51:52 +05:30
committed by Ayaan Zaidi
parent 2f2110a32c
commit e64d72299e
7 changed files with 56 additions and 14 deletions

View File

@@ -28,7 +28,12 @@ import {
import { stripHeartbeatToken } from "../heartbeat.js";
import type { TemplateContext } from "../templating.js";
import type { VerboseLevel } from "../thinking.js";
import { isSilentReplyPrefixText, isSilentReplyText, SILENT_REPLY_TOKEN } from "../tokens.js";
import {
HEARTBEAT_TOKEN,
isSilentReplyPrefixText,
isSilentReplyText,
SILENT_REPLY_TOKEN,
} from "../tokens.js";
import type { GetReplyOptions, ReplyPayload } from "../types.js";
import {
buildEmbeddedRunBaseParams,
@@ -141,6 +146,12 @@ export async function runAgentTurnWithFallback(params: {
if (isSilentReplyText(text, SILENT_REPLY_TOKEN)) {
return { skip: true };
}
if (
isSilentReplyPrefixText(text, SILENT_REPLY_TOKEN) ||
isSilentReplyPrefixText(text, HEARTBEAT_TOKEN)
) {
return { skip: true };
}
if (!text) {
// Allow media-only payloads (e.g. tool result screenshots) through.
if ((payload.mediaUrls?.length ?? 0) > 0) {