Skip to content

feat(cron): add --account flag for multi-account delivery routing#26284

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
Zitzak:feat/cron-account-id
Feb 28, 2026
Merged

feat(cron): add --account flag for multi-account delivery routing#26284
Takhoffman merged 2 commits intoopenclaw:mainfrom
Zitzak:feat/cron-account-id

Conversation

@Zitzak
Copy link
Copy Markdown
Contributor

@Zitzak Zitzak commented Feb 25, 2026

Summary

  • Add --account <id> to cron add and cron edit so cron delivery can target a specific channel account.
  • Thread delivery.accountId through:
    • CronDelivery types
    • normalization (normalizeCronJobCreate / normalizeCronJobPatch)
    • resolveCronDeliveryPlan()
    • isolated delivery target resolution + run path
  • Prefer explicit accountId over session lastAccountId and bindings fallback.
  • Keep existing cron edit --best-effort-deliver/--no-best-effort-deliver behavior (implicit announce mode when only best-effort is toggled).

Motivation

In multi-account setups (for example multiple Telegram bots), cron announcements could route to the wrong/default account when isolated cron sessions had no prior channel history. This change adds explicit account routing for deterministic delivery.

Usage

openclaw cron add \
  --name "Morning summary" \
  --message "Summarize overnight activity" \
  --announce --channel telegram --to "<chatId>" \
  --account my-second-bot \
  --every 24h

openclaw cron edit <job-id> --account my-second-bot

Backward Compatibility

  • accountId is optional.
  • Existing jobs/configs are unchanged when --account is omitted.
  • Fallback behavior remains: session history -> bindings -> default account.
  • No migration required.

Tests

Added/updated tests for:

  • delivery plan accountId passthrough
  • normalization trim/blank stripping for delivery.accountId
  • explicit account override over session account
  • delivery merge behavior preserving/updating accountId
  • CLI coverage for:
    • cron add --account
    • invalid --account context on add
    • cron edit --account
    • best-effort edit compatibility

Validation run:

  • pnpm check
  • pnpm vitest src/cron src/cli/cron-cli.test.ts

Greptile Summary

Adds --account <id> flag to cron add and cron edit commands enabling explicit channel account selection for multi-account delivery routing. The accountId field is threaded through the entire cron delivery pipeline:

  • Type definition in CronDelivery and CronDeliveryPlan
  • Normalization with trim/blank stripping in normalizeCronJobCreate and normalizeCronJobPatch
  • Delivery plan resolution in resolveCronDeliveryPlan()
  • Isolated agent delivery target resolution with explicit account preference over session fallback
  • CLI validation ensuring --account only applies to isolated agent turn jobs

The implementation preserves backward compatibility by making accountId optional and maintaining existing fallback behavior (session history → bindings → default account) when omitted.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is thorough, well-tested, and follows existing patterns in the codebase. All changes are additive with proper backward compatibility. The feature includes comprehensive test coverage across all affected layers (CLI, normalization, delivery resolution, isolated agent execution). The PR validation confirms tests pass and the code follows TypeScript strict typing conventions.
  • No files require special attention

Last reviewed commit: 9b214c9

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Zitzak and others added 2 commits February 28, 2026 10:56
Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows
@Takhoffman Takhoffman merged commit 5e2ef0e into openclaw:main Feb 28, 2026
9 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

Merged via squash after rebase conflict resolution and full local verification.

Merge commit: 8454da8ff48d49fb64d5f6e0707623f734b13f9f
Local gates run on rebased head:

  • pnpm build
  • pnpm check

@Takhoffman
Copy link
Copy Markdown
Contributor

Correction: the squash merge commit for this PR is
5e2ef0e

vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Feb 28, 2026
* main: (31 commits)
  fix(browser): resolve correct targetId in navigate response after renderer swap (openclaw#25326)
  fix: sed escaping and UID mismatch in Podman Quadlet setup (openclaw#26414)
  fix(cron): pass heartbeat target=last for main-session cron jobs (openclaw#28508) (openclaw#28583)
  fix(cron): disable messaging tool when delivery.mode is none (openclaw#21808) (openclaw#21896)
  fix: clear delivery routing state when creating isolated cron sessions (openclaw#27778)
  fix(cron): avoid marking queued announce paths as delivered (openclaw#29716)
  fix(cron): enable completion direct send for text-only announce delivery (openclaw#29151)
  fix(cron): force main-target system events onto main session (openclaw#28898)
  fix(cron): condition requireExplicitMessageTarget on resolved delivery (openclaw#28017)
  feat(cron): add --account flag for multi-account delivery routing (openclaw#26284)
  fix: schedule nextWakeAtMs for isolated sessionTarget cron jobs (openclaw#19541)
  fix: sandbox browser docker no-sandbox rollout (openclaw#29879) (thanks @Lukavyi)
  GitHub: add regression bug issue template and routing (openclaw#29864) thanks @Takhoffman
  feat(feishu): add chat info/member tool (openclaw#14674)
  feat(feishu): add markdown tables, positional insert, color_text, and table ops (openclaw#29411)
  feat(feishu): add parent/root inbound context for quote support (openclaw#18529)
  fix: land android onboarding and voice reliability updates (openclaw#29796)
  fix(android-voice): rotate playback token per assistant reply
  fix(android-voice): retry talk config after transient failures
  fix(android-voice): cancel in-flight speech when speaker muted
  ...
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
centminmod added a commit to centminmod/clawdbot that referenced this pull request Feb 28, 2026
- Update line refs: models-config.providers.ts:693-701→:749-759 (2 hits), timer.ts:269→:273, types.ts:63,78→:59,75
- Add sync-2 entry: 23 non-security commits (cron delivery routing, Ollama provider, browser fix, container setup)
- Note: feat(cron) --account flag (openclaw#26284) adds multi-account cron delivery routing (13 files)
nsd97 pushed a commit to nsd97/openclaw that referenced this pull request Feb 28, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 1, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
# Conflicts:
#	src/cron/delivery.test.ts
#	src/cron/isolated-agent/delivery-target.ts
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
# Conflicts:
#	src/cron/delivery.test.ts
#	src/cron/isolated-agent/delivery-target.ts
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
Mateljan1 pushed a commit to Mateljan1/openclaw that referenced this pull request Mar 7, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 16, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 5e2ef0e)
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 16, 2026
…enclaw#26284)

* feat(cron): add --account flag for multi-account delivery routing

Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution.

Highlights:
- Add --account <id> to cron add and cron edit
- Add optional delivery.accountId to cron types and delivery plan
- Normalize and trim delivery.accountId in cron create/update normalization
- Prefer explicit accountId over session lastAccountId and bindings fallback
- Thread accountId through isolated cron run delivery resolution
- Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode
- Expand tests for account passthrough/merge/precedence and CLI account flows

* cron: resolve rebase duplicate accountId fields

---------

Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 5e2ef0e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants