fix(cron): direct-deliver thread and topic announce targets

Co-authored-by: Andrei Aratmonov <247877121+AndrewArto@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-22 21:41:36 +01:00
parent 320cf8eb3e
commit ffb12397a8
4 changed files with 120 additions and 9 deletions

View File

@@ -657,7 +657,13 @@ export async function runCronIsolatedAgentTurn(params: {
// follows the same system-message injection path as subagent completions.
// Keep direct outbound delivery only for structured payloads (media/channel
// data), which cannot be represented by the shared announce flow.
if (deliveryPayloadHasStructuredContent) {
//
// Forum/topic targets should also use direct delivery. Announce flow can
// be swallowed by ANNOUNCE_SKIP/NO_REPLY in the target agent turn, which
// silently drops cron output for topic-bound sessions.
const useDirectDelivery =
deliveryPayloadHasStructuredContent || resolvedDelivery.threadId != null;
if (useDirectDelivery) {
try {
const payloadsForDelivery =
deliveryPayloads.length > 0