feat(agent): add human-like delay between block replies

Adds `agent.humanDelay` config option to create natural rhythm between
streamed message bubbles. When enabled, introduces a random delay
(default 800-2500ms) between block replies, making multi-message
responses feel more like natural human texting.

Config example:
```json
{
  "agent": {
    "blockStreamingDefault": "on",
    "humanDelay": {
      "enabled": true,
      "minMs": 800,
      "maxMs": 2500
    }
  }
}
```

- First message sends immediately
- Subsequent messages wait a random delay before sending
- Works with iMessage, Signal, and Discord providers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
LloydandClaude Opus 4.5 authored and Peter Steinberger committed 2026-01-10 17:12:50 +01:00
1 parent 22144cd51b
commit ab994d2c63
18 files changed
+206 -60

No files matched your search

+19 -1
View File
@@ -1,4 +1,8 @@
import type { ClawdbotConfig, IdentityConfig } from "../config/config.js";
import type {
ClawdbotConfig,
HumanDelayConfig,
IdentityConfig,
} from "../config/config.js";
import { resolveAgentConfig } from "./agent-scope.js";
const DEFAULT_ACK_REACTION = "👀";
@@ -72,3 +76,17 @@ export function resolveEffectiveMessagesConfig(
responsePrefix: resolveResponsePrefix(cfg, agentId),
};
}
export function resolveHumanDelayConfig(
cfg: ClawdbotConfig,
agentId: string,
): HumanDelayConfig | undefined {
const defaults = cfg.agents?.defaults?.humanDelay;
const overrides = resolveAgentConfig(cfg, agentId)?.humanDelay;
if (!defaults && !overrides) return undefined;
return {
mode: overrides?.mode ?? defaults?.mode,
minMs: overrides?.minMs ?? defaults?.minMs,
maxMs: overrides?.maxMs ?? defaults?.maxMs,
};
}