feat: add openclaw-tps-mail channel plugin#263
Conversation
Makes TPS mail a first-class OpenClaw channel alongside Discord/Telegram. Messages route through the gateway's native message flow with proper turn budgets, session continuity, and tool access — replacing the shell-hook wrapper that suffered from 60s timeouts and session accumulation noise. Reviewed by Kern (architecture, 5/5 validated) and Sherlock (security, 2 fixed, 3 accepted for single-user rockit with TPS-MAIL-SIGNATURES spec gating non-rockit deployment). Key design decisions: - Session isolation via dmScope per-channel-peer - Atomic file moves (new → tmp → cur) to prevent replay - Fail-closed outbound identity (no anonymous "unknown" sink) - DLQ for malformed files - abortSignal lifecycle to prevent gateway restart loops Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `packages/*` workspace glob causes bun to regenerate the full lockfile when a new package is added, with platform-specific differences between macOS and Linux CI. Since this plugin has zero runtime dependencies (only peer deps on openclaw SDK), it doesn't need to be a workspace member. Moving to `plugins/` keeps the lockfile stable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tps-flint
left a comment
There was a problem hiding this comment.
📐 Architecture Review: openclaw-tps-mail plugin
Approved. The implementation correctly transitions TPS mail from an external shell-hook wrapper to a first-class OpenClaw channel plugin.
Key Architecture Validations:
- Atomicity (#5): moveToCur now uses a robust renameSync from new/ to tmp/ before writing the enriched JSON to cur/. This prevents message replay if the gateway crashes mid-transition.
- Fail-Closed Identity (#4): sendText now explicitly returns an error if the outbound sender identity cannot be resolved, preventing anonymous or 'unknown' session sinks.
- Queue Hygiene: The addition of moveToDlq for parse failures ensures that malformed files don't permanently pollute the new/ directory or trigger redundant watcher events.
- Session Isolation: Using dmScope: 'per-channel-peer' correctly isolates inter-agent conversations into dedicated sessions, preserving the main session for human interaction and system alerts.
- Gateway Lifecycle: The startAccount implementation correctly uses the abortSignal to manage fs.watch lifecycles, preventing the 'zombie watcher' issues seen in earlier drafts.
This is a significant stability upgrade for inter-agent coordination. Unblocked for merge.
Summary
packages/openclaw-tps-mail— an OpenClaw channel plugin that makes TPS mail a first-class channel alongside Discord/Telegramopenclaw-deliver.shshell-hook wrapper that had 60s timeouts and session accumulation noiseWhat's included
fs.watchon~/.tps/mail/<agent>/new/, parse envelope, dispatch viachannelRuntime.reply.dispatchReplyWithBufferedBlockDispatchernew/directorydmScope: "per-channel-peer"— each sender gets their own session per agentnew/ → tmp/ → cur/viarenameSyncto prevent replay on crashdlq/with.reasoncompanion fileabortSignalpromise keepsstartAccountalive, preventing gateway restart loopsReview status
TPS-MAIL-SIGNATURESspec for multi-host deploymentTest plan
tmp/clean after transition,cur/has enriched recorddlq/with.reasonfileabortSignalpatternagent:<recipient>:tps-mail:direct:<sender>ok: false🤖 Generated with Claude Code