Skip to content

fix(cron): send text output directly when delivery.to is set#16360

Merged
thewilloftheshadow merged 1 commit intoopenclaw:mainfrom
rubyrunsstuff:fix/cron-delivery-direct-text
Feb 14, 2026
Merged

fix(cron): send text output directly when delivery.to is set#16360
thewilloftheshadow merged 1 commit intoopenclaw:mainfrom
rubyrunsstuff:fix/cron-delivery-direct-text

Conversation

@rubyrunsstuff
Copy link
Contributor

@rubyrunsstuff rubyrunsstuff commented Feb 14, 2026

Problem

When a cron job has an explicit delivery.to target, text-only output was being routed through runSubagentAnnounceFlow, which prompts the main agent to "summarize naturally in 1-2 sentences." This means users receive the main agent's summary instead of the actual cron output.

Example: A morning briefing cron generates a detailed update about art projects, calendar, weather, etc. But the user receives: "morning briefing nailed it — heartstrings is live and it's valentine's day. go be romantic!" instead of the actual briefing content.

Solution

Add a check for hasExplicitDeliveryTarget (when delivery.to is set) to the condition that determines whether to use direct delivery via deliverOutboundPayloads. This makes text-only cron output behave like structured content — going directly to the target without summarization.

The announce flow is still used when there's no explicit target, which is the intended behavior for subagent tasks that need conversational context from the main session.

Changes

  • src/cron/isolated-agent/run.ts: Added hasExplicitDeliveryTarget check to bypass announce flow when delivery.to exists

Testing

Manually tested with a cron job that has delivery: { mode: 'announce', channel: 'bluebubbles', to: '+1234567890' } - confirmed the full output is now delivered instead of a summary.

Greptile Overview

Greptile Summary

Adds hasExplicitDeliveryTarget check to bypass the announce flow when delivery.to is explicitly set, ensuring cron output is delivered directly without main agent summarization.

  • Fixes issue where text-only cron output with explicit delivery.to was being summarized by the main agent instead of being delivered verbatim
  • The change correctly identifies when a user has set an explicit delivery target and routes output through direct delivery (deliverOutboundPayloads) rather than the subagent announce flow
  • Minor style suggestion: use resolvedDelivery.to instead of deliveryPlan.to for consistency with the actual delivery mechanism

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is straightforward and directly addresses the stated problem. The change adds a single condition to an existing decision point, and the logic is protected by upstream validation (line 546 ensures resolvedDelivery.to exists). The only issue is a minor style preference that doesn't affect functionality.
  • No files require special attention

Last reviewed commit: 1c263e8

@thewilloftheshadow thewilloftheshadow self-assigned this Feb 14, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

// summarize. When we have an explicit delivery target (delivery.to), sender
// identity, or structured content, prefer direct outbound delivery to send
// the actual cron output without summarization.
const hasExplicitDeliveryTarget = Boolean(deliveryPlan.to);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use resolvedDelivery.to instead of deliveryPlan.to for consistency — resolvedDelivery.to is the validated, resolved value that's actually used for delivery (line 578), while deliveryPlan.to is the raw input

Suggested change
const hasExplicitDeliveryTarget = Boolean(deliveryPlan.to);
const hasExplicitDeliveryTarget = Boolean(resolvedDelivery.to);
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cron/isolated-agent/run.ts
Line: 565:565

Comment:
use `resolvedDelivery.to` instead of `deliveryPlan.to` for consistency — `resolvedDelivery.to` is the validated, resolved value that's actually used for delivery (line 578), while `deliveryPlan.to` is the raw input

```suggestion
    const hasExplicitDeliveryTarget = Boolean(resolvedDelivery.to);
```

How can I resolve this? If you propose a fix, please make it concise.

@openclaw-barnacle openclaw-barnacle bot added size: XS trusted-contributor Contributor with 4+ merged PRs labels Feb 14, 2026
@thewilloftheshadow thewilloftheshadow force-pushed the fix/cron-delivery-direct-text branch from 1c263e8 to c768185 Compare February 14, 2026 18:01
@thewilloftheshadow thewilloftheshadow force-pushed the fix/cron-delivery-direct-text branch from c768185 to d37ae34 Compare February 14, 2026 18:41
@thewilloftheshadow thewilloftheshadow force-pushed the fix/cron-delivery-direct-text branch from d37ae34 to c424340 Compare February 14, 2026 18:43
@thewilloftheshadow thewilloftheshadow merged commit a73ccf2 into openclaw:main Feb 14, 2026
9 checks passed
@Takhoffman
Copy link
Contributor

Takhoffman commented Feb 14, 2026

Hey @thewilloftheshadow I was going to work on this one... hehe

@thewilloftheshadow
Copy link
Member

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test -- src/cron/isolated-agent.delivers-response-has-heartbeat-ok-but-includes.test.ts src/cron/isolated-agent.skips-delivery-without-whatsapp-recipient-besteffortdeliver-true.e2e.test.ts
  • Land commit: c424340
  • Merge commit: a73ccf2

Thanks @rubyrunsstuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S trusted-contributor Contributor with 4+ merged PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments