Skip to content

fix(cron): apply responsePrefix to direct delivery payloads#35469

Open
ethanperezz wants to merge 1 commit intoopenclaw:mainfrom
ethanperezz:fix/cron-direct-delivery-response-prefix
Open

fix(cron): apply responsePrefix to direct delivery payloads#35469
ethanperezz wants to merge 1 commit intoopenclaw:mainfrom
ethanperezz:fix/cron-direct-delivery-response-prefix

Conversation

@ethanperezz
Copy link
Copy Markdown

Summary

  • Cron direct delivery (deliverViaDirect) was sending raw response text without applying the configured responsePrefix
  • Interactive replies correctly resolve the prefix via resolveEffectiveMessagesConfig, but the cron direct delivery path skipped this step
  • Now resolves responsePrefix for the delivery channel/account and prepends it to payload text, matching the behavior of route-reply and heartbeat delivery paths

Change Type

  • Bug fix

Scope

  • Gateway / orchestration

Linked Issue

User-visible / Behavior Changes

  • Cron direct delivery messages now include the configured responsePrefix (e.g. [Thames]) matching interactive reply behavior

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No

Test plan

  • Verify responsePrefix: "auto" is applied to cron direct delivery messages
  • Verify responsePrefix per-channel/account resolution works for cron delivery
  • Verify no double-prefix when text already starts with the prefix

🤖 Generated with Claude Code

Cron direct delivery (delivery.mode: "announce" with direct path) was
sending raw response text without applying the configured responsePrefix.
Interactive replies correctly resolve the prefix via
resolveEffectiveMessagesConfig, but the cron deliverViaDirect path
skipped this step entirely.

Resolve responsePrefix for the delivery channel/account and prepend it
to payload text, matching the behavior of route-reply and heartbeat
delivery paths.

Fixes openclaw#29600

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR fixes a bug where the deliverViaDirect path in cron delivery was sending raw response text without applying the configured responsePrefix, while the interactive reply path was already applying it correctly via resolveEffectiveMessagesConfig. The fix resolves the prefix for the delivery channel/account and prepends it to each payload's text, with a startsWith guard to prevent double-prefixing.

Key changes:

  • Imports resolveEffectiveMessagesConfig from ../../agents/identity.js
  • Calls resolveEffectiveMessagesConfig at the top of deliverViaDirect (outside the try block, consistent with the existing resolveAgentOutboundIdentity call)
  • Constructs rawPayloads first, then maps them with applyPrefix only when responsePrefix is truthy
  • applyPrefix handles undefined text, falsy prefix, and already-prefixed text safely

The implementation is symmetric with the interactive reply path and also correctly applies to the fallback case (announce fails → direct delivery), since deliverViaDirect reads the outer closure's deliveryPayloads which may have been updated by deliverViaAnnounce.

Confidence Score: 4/5

  • This PR is safe to merge — it is a targeted, one-file bug fix with no structural changes.
  • The change is small and well-scoped: it mirrors the existing responsePrefix logic used in the interactive reply path. The startsWith guard prevents double-prefixing, the !responsePrefix falsy guard handles unconfigured cases, and the placement of resolveEffectiveMessagesConfig outside the try block is consistent with the pre-existing pattern. No new permissions or secrets handling. The one minor caveat is there are no automated tests covering the new code path in this diff, but the logic is straightforward enough to have high confidence.
  • No files require special attention.

Last reviewed commit: 0aed3a7

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cron announce delivery does not apply responsePrefix

1 participant