Skip to content

fix(cron): resolve human-friendly delivery labels via channel directory#3860

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-bf2cd279
Mar 30, 2026
Merged

fix(cron): resolve human-friendly delivery labels via channel directory#3860
teknium1 merged 1 commit intomainfrom
hermes/hermes-bf2cd279

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Salvage of the core fix from PR #1950 by @ifrederico (which was 549 commits behind and touched 20 files). Fixes #1945 reported by @dan-and.

The bug

Cron jobs set deliver: "whatsapp:Alice (dm)" using the human-friendly labels from send_message(action="list"). _resolve_delivery_target() passed "Alice (dm)" as a literal chat_id to the WhatsApp bridge, which failed with:

Cannot destructure property 'user' of 'jidDecode(...)' as it is undefined.

The fix

_resolve_delivery_target() now:

  1. Strips display suffixes like " (dm)" or " (group)" from the target
  2. Resolves the name via resolve_channel_name() from the channel directory
  3. Falls back to the raw target if no match (preserves existing behavior for raw IDs)

Tests

3 new tests covering label resolution, plain name resolution, and raw ID passthrough. 39/39 scheduler tests pass.

Closes #1950. Fixes #1945. Credit to @ifrederico for the PR and @dan-and for the detailed bug report.

Cron jobs configured with deliver labels from send_message(action='list')
like 'whatsapp:Alice (dm)' passed the label as a literal chat_id.
WhatsApp bridge failed with jidDecode error since 'Alice (dm)' isn't
a valid JID.

Now _resolve_delivery_target() strips display suffixes like ' (dm)' and
resolves human-friendly names via the channel directory before using
them. Raw IDs pass through unchanged when the directory has no match.

Fixes #1945.
@teknium1 teknium1 merged commit 3fad1e7 into main Mar 30, 2026
3 checks passed
itsXactlY pushed a commit to itsXactlY/hermes-agent that referenced this pull request Mar 30, 2026
…ry (NousResearch#3860)

Cron jobs configured with deliver labels from send_message(action='list')
like 'whatsapp:Alice (dm)' passed the label as a literal chat_id.
WhatsApp bridge failed with jidDecode error since 'Alice (dm)' isn't
a valid JID.

Now _resolve_delivery_target() strips display suffixes like ' (dm)' and
resolves human-friendly names via the channel directory before using
them. Raw IDs pass through unchanged when the directory has no match.

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

Labels

None yet

1 participant