编程

Cron To Session Transcript

试用

Isolated crons, scripts, reminders, and status checkers sent it but the agent forgot? Write deliveries into the session transcript.

它能做什么

Isolated crons, scripts, reminders, and status checkers sent it but the agent forgot? Write deliveries into the session transcript.

技能文档

Cron To Session Transcript

Command crons and scripts can send messages that users see, while the owning agent never records them. Cron To Session Transcript closes that gap.

Use it when a deterministic --command cron, dispatcher, reminder script, or status checker calls openclaw message send and the agent should remember that delivery in its own session history.

All commands:

bash "{baseDir}/scripts/send-to-transcript.sh" 

The Problem

openclaw message send reaches the chat, but it bypasses the agent run loop. That means no assistant row is appended to the agent's session transcript. On a later turn, the agent has no durable record that the cron/script sent anything.

Agent replies and agentTurn crons already go through OpenClaw's delivery layer and are recorded normally. This skill is only for direct command/script sends.

What It Does

  1. Sends the message exactly as before with openclaw message send ... --json.
  2. Resolves the owning agent's current sessionFile from agents//sessions/sessions.json.
  3. Appends one transcript-only assistant row containing the delivered text, chained to the previous row with parentId.
  4. Optionally skips duplicate retries with --idem .

The row intentionally uses OpenClaw's internal delivery marker: provider: "openclaw", model: "delivery-mirror", zeroed usage, and openclawDeliveryMirror: {kind:"channel-final"}. Keep that internal model string unchanged: OpenClaw core recognizes transcript-only delivery rows by it.

Appending is best-effort. If the send succeeds but the transcript cannot be resolved, the helper exits 0 with a warning so the real user-facing delivery is not failed by a memory append problem.

Permissions & Write Scope

This skill performs local filesystem writes and runs the openclaw CLI:

  • Reads /agents//sessions/sessions.json.
  • Appends one JSONL row to the matched session transcript.
  • Writes idempotency state and logs under /cron-to-transcript/.
  • Uses an advisory .transcript.lock while appending.
  • Executes openclaw message send.

It does not run any model, make network calls of its own, edit existing transcript records, delete data, or read ambient environment variables for message data. Inputs are passed to the embedded Python as positional argv.

Use --openclaw-home to confine paths for tests.

Usage

scripts/send-to-transcript.sh \
  --agent ula \
  --account ula \
  --to -1003971971641 \
  --thread-id 131 \
  --source agenda-dispatch \
  --idem "agenda:131:$(date +%F):morning" \
  --message "$MSG"

Message input can be --message "...", --message-file PATH, or --message-file - for stdin.

In a Command Cron

Replace a bare send:

openclaw message send --channel telegram -t "$CHAT" --thread-id "$TOPIC" -m "$MSG"

with:

bash ~/.openclaw/skills/cron-to-transcript/scripts/send-to-transcript.sh \
  --agent ula --account ula \
  --to "$CHAT" --thread-id "$TOPIC" \
  --source agenda-dispatch \
  --message "$MSG"

Flags

flagmeaning
--message / --message-filemessage text (file or - for stdin)
--tochannel target, for example Telegram chat id
--agentagent id that owns the transcript
--accountchannel account id for send (default: --agent)
--channelchannel (default telegram)
--thread-idTelegram forum topic id
--session-keyexplicit session key (else auto-resolved)
--sourcelabel recorded in helper logs
--idemidempotency key; skip if already handled
--openclaw-homeOpenClaw home (default $OPENCLAW_HOME or ~/.openclaw)
--openclaw-binopenclaw binary (default openclaw on PATH)
--dry-runprint the plan, do nothing
--no-sendappend only (testing)
--no-transcriptsend only

Compatibility alias: --no-mirror is accepted and behaves like --no-transcript.

Exit Codes

codemeaning
0delivered; transcript append succeeded or was skipped best-effort
2bad usage / missing required args
3idempotency key already handled
4send failed; nothing appended

Session Resolution

The helper finds the transcript by explicit --session-key, then by auto-constructed keys:

  • agent:::group::topic:
  • agent:::group:
  • agent:::direct:

If no key matches, it scans sessions.json for a matching delivery target and thread id. It appends to the entry's sessionFile, so compaction rotation is followed automatically.

Caveats

  • The transcript row is reproduced from bash because no CLI exposes core's internal append function. Re-verify after major OpenClaw upgrades.
  • Appends are serialized with flock, but the gateway does not take that lock. Dispatcher-style schedules where the target agent is idle are the intended use case.
  • Message text is stored verbatim. Treat the cron/script as the trust source.

Test

scripts/send-to-transcript.sh --dry-run --agent X --to  --thread-id  --message "hi"
scripts/send-to-transcript.sh --no-send --agent X --to  --thread-id  --message "hi"

相关技能

Mirror cron/script deliveries into agent session transcripts so scheduled and isolated-cron messages persist in context. Session continuity, no core changes.

2 次安装1 星标

Use the OpenClaw cron tool for scheduling reminders, delayed follow-ups, and recurring periodic checks. Covers one-shot and recurring schedules, session targeting, delivery modes, and wake events.

实现『用 A 会话调起/注入 B 会话』的能力(sessions_send):cron 任务、外部进程或另一会话可向目标会话注入消息,唤醒其 agent 带完整上下文继续推进。适用于 OpenClaw 与 QClaw(同内核)。含 Windows 下 visibility 配置检查/修复、正确重启网关(SIGUSR1 bug 规避)、cron job 设计。当用户要求「定时任务完成后回到本对话继续推进」「cron 回调当前会话」「让任务结果上报到同一对话」时使用。

1 次安装

Run a hosted agent on a cron schedule — daily digests, uptime monitors, recurring scrapes, periodic reports — that fire on their own and bill exactly-once wi...

1 次安装

Proactive cron job health monitoring, failure detection, and auto-repair delegation. Triggers: 'cron failed', 'cron health', 'fix cron', 'consecutive errors

2 次安装

让定时任务在每次运行时自动采用最新的提示词、策略、投递方式和模型配置。

21 次安装