d9aee1a4c2b54b10888d8f8f40d940e8f29805e0
Revert "Merge pull request 'fix: use systemPrompt instead of prependContext for end marker instruction' (#5) from fix/moderator-and-system-prompt into feat/turn-based-speaking"
WhisperGate
Rule-based no-reply gate + turn manager for OpenClaw (Discord).
What it does
WhisperGate adds deterministic logic before model selection and turn-based speaking for multi-agent Discord channels:
-
Rule gate (before_model_resolve)
- Non-Discord → skip
- Sender in bypass list / human list → skip
- Message ends with configured end symbol → skip
- Otherwise → route to no-reply model/provider
-
End-symbol enforcement
- Injects instruction like:
你的这次发言必须以🔚作为结尾… - In group chats, also injects: “无关/不需要回应就 NO_REPLY”
- Injects instruction like:
-
Turn-based speaking (multi-bot)
- Only the current speaker is allowed to respond
- Others are forced to no-reply
- Turn advances on end-symbol or NO_REPLY
- If all bots NO_REPLY, channel becomes dormant until a new human message
-
Moderator handoff (optional)
- When the current speaker NO_REPLYs, a moderator bot can post a handoff message to wake the next speaker
-
Per-channel policy runtime
- Policies stored in a standalone JSON file
- Update at runtime via
whispergate_tools(memory first → persist to file)
-
Discord control actions (optional)
- Private channel create/update + member list
- Unified via
whispergate_tools
Repo layout
plugin/— OpenClaw plugin (gate + turn manager + moderator presence)no-reply-api/— OpenAI-compatible API that always returnsNO_REPLYdiscord-control-api/— Discord 管理扩展 API(私密频道 + 成员列表)docs/— rollout, integration, run-mode notes, turn-wakeup analysisscripts/— smoke/dev/helper checksMakefile— common dev commands (make check,make check-rules,make test-api,make smoke-discord-control,make up)CHANGELOG.md— milestone summary
Quick start (no Docker)
cd no-reply-api
node server.mjs
Then render config snippet:
node scripts/render-openclaw-config.mjs
See docs/RUN_MODES.md for Docker mode.
Discord 扩展能力见:docs/DISCORD_CONTROL.md。
Runtime tools & commands
Tool: whispergate_tools
Actions:
policy-get,policy-set-channel,policy-delete-channelturn-status,turn-advance,turn-resetchannel-private-create,channel-private-update,member-list
Slash command (Discord)
/whispergate status
/whispergate turn-status
/whispergate turn-advance
/whispergate turn-reset
Config highlights
Common options (see docs/INTEGRATION.md):
listMode:human-listoragent-listhumanList,agentListendSymbolschannelPoliciesFile(per-channel overrides)moderatorBotToken(handoff messages)enableDebugLogs,debugLogChannelIds
Development plan (incremental commits)
- Task 1: project docs + structure
- Task 2: no-reply API MVP
- Task 3: plugin MVP with rule chain
- Task 4: sample config + quick verification scripts
- Task 5: plugin rule extraction + hardening
- Task 6: containerization + compose
- Task 7: plugin usage notes
- Task 8: sender normalization + TTL + one-shot decision
- Task 9: auth-aware no-reply API
- Task 10: smoke test helpers
- Task 11: plugin structure checker
- Task 12: rollout checklist
Description
Languages
TypeScript
75.7%
JavaScript
23.8%
Shell
0.4%
Makefile
0.1%