feat(config/channels): add reply_min_interval_secs to TelegramConfig#6389
feat(config/channels): add reply_min_interval_secs to TelegramConfig#6389singlerider wants to merge 4 commits intozeroclaw-labs:masterfrom
Conversation
First step of the zeroclaw-labs#6345 throttle. Adds the schema field on TelegramConfig as a proof-of-concept for the broader rollout. The field defaults to 0 (current behaviour preserved exactly) and is gated to 0..=3600 by validation that lands in a follow-up commit. Not in this commit (deliberately separate so the schema delta is reviewable in isolation): - Update every TelegramConfig struct-literal construction site to include the new field. CI will fail until this lands; that failure is the actionable list. - Mirror the field on every other channel that supports outbound sends (Discord, Slack, Matrix, Signal, WhatsApp, etc.) per the issue's "Mirror in every channel that supports outbound sends" acceptance criterion. - Range validation (0..=3600) at config load time. - Per-conversation outbound scheduler that honors the interval (queue replies, dispatch with tokio::time::Instant for monotonic clock). - Bounded per-conversation queue with overflow log + drop metric. - Documentation entry in the channel section of the book. Refs zeroclaw-labs#6345.
β¦literals CI surfaced 9 missing-field sites after the schema field add in the previous commit. All TelegramConfig struct literals across daemon, orchestrator, registry, config-mod, and three schema test fixtures now set reply_min_interval_secs: 0 explicitly so the build compiles. Sites fixed: - crates/zeroclaw-runtime/src/daemon/mod.rs:1107, 1253, 1273 - crates/zeroclaw-channels/src/orchestrator/mod.rs:11802 - crates/zeroclaw-runtime/src/integrations/registry.rs:872 - src/config/mod.rs:73 - crates/zeroclaw-config/src/schema.rs:12330, 13235, 16657 Refs zeroclaw-labs#6345.
Two fixes on top of the schema field add: * Drop the docs/book/theme/lang-switcher.js drive-by reorder. The file is generated by the mdbook build from locales.toml at the repo root, per its own header comment; manual edits are clobbered on next build. Reorder belongs in a standalone commit if at all. * The original docstring claimed the field had load-time validation and a per-(channel, peer-jid) scheduler. Neither lands in this commit (per the PR body's own scope boundary). Rewrite the docstring so what it claims and what the code does match. The intended range and the follow-up sequencing are still documented; the false present-tense claims are gone. Refs zeroclaw-labs#6345
Audacity88
left a comment
There was a problem hiding this comment.
Reviewed head a163123. I checked the fetched PR state, linked issue #6345, the existing #6345 triage comment, the full diff, the config-schema source around TelegramConfig, CI status at fetch time, and the relevant ZeroClaw review/docs/governance guidance. There are no prior PR comments, inline comments, or formal reviews. I did not run local cargo; CI is green. Local checks were git merge-tree --write-tree origin/master origin/pr/6389 and git diff --check origin/master...origin/pr/6389.
π’ What looks good β the schema slice is narrow and default-safe
The actual code change is small and low-behavior-risk: reply_min_interval_secs is added to TelegramConfig with #[serde(default)], and every existing TelegramConfig struct literal is updated with 0. That preserves existing behavior for users who do not set the new key. The follow-up commits also cleaned up the stale present-tense docstring claims and removed the unrelated generated docs reorder, which keeps this PR focused.
π΄ Blocking β Closes #6345 would close work this PR explicitly defers
The PR body says this is only the Telegram schema-field slice. It explicitly defers mirroring the field to other outbound channels, load-time range validation, and the per-channel/per-peer outbound scheduler. The linked issue #6345 is broader than this PR: its acceptance criteria require the field across supported channels, 0..=3600 validation, delayed outbound delivery, bounded queue behavior, and docs.
If this merges with Closes #6345, GitHub will close the tracker even though the actual pacing behavior has not landed and the remaining acceptance criteria are still open. That would make the work look complete when the PR itself says it is only the first step.
Please either change this PR to Refs #6345 and keep #6345 open, or open/link concrete follow-up issues for the remaining scheduler, validation, cross-channel, queue, and docs work before closing the tracker. If the intent is for this PR to fully close #6345, then the remaining acceptance criteria need to land here.
π‘ Warning β validation evidence should include command output
The PR says fmt, clippy, and check all pass locally, but the validation section summarizes the results without command output. CI is green, so I am not treating this as a code blocker, but the section should paste the command output tails or explain why local output is intentionally omitted.
Summary
Adds the
reply_min_interval_secs: u64field onTelegramConfig, defaulting to0(current behaviour: replies fire as soon as the LLM completes). The intended range is0..=3600.The threat model: on paired-identity channels under personal accounts, sub-second replies are a strong AI-tell and a platform-side anomaly signal. Raising this value paces the agent so its cadence resembles a human operator's.
This commit ships the schema field for Telegram. Mirroring the field to other channels, load-time range validation, and the per-(channel, peer-jid) outbound scheduler that honours the interval are tracked separately and will land in follow-up PRs against the same issue.
Closes #6345
Validation Evidence
All three pass locally. Every existing
TelegramConfigstruct literal has the new field added (default0); CI catches any new construction site that omits it.Security & Privacy Impact
Compatibility
0preserves current behaviour byte-for-byte. Existing configs deserialize cleanly without the key set.reply_min_interval_secskey under[channels.telegram]. Same name will be added to other channels in follow-ups.Rollback
git revert <merge-sha>. Schema-only diff; no runtime is wired to the field yet, so a revert is byte-equivalent to current behaviour.