zhi 0729e83b38 feat: split dirigent_tools into individual tools + human @mention override
Feature 1: Split dirigent_tools
- Replace monolithic dirigent_tools (9 actions) with 9 individual tools
- Discord: dirigent_channel_create, dirigent_channel_update, dirigent_member_list
- Policy: dirigent_policy_get, dirigent_policy_set, dirigent_policy_delete
- Turn: dirigent_turn_status, dirigent_turn_advance, dirigent_turn_reset
- Extract shared executeDiscordAction() helper

Feature 2: Human @mention override
- When humanList user @mentions agents, temporarily override turn order
- Only mentioned agents cycle, ordered by their turn order position
- Original order restores when cycle returns to first agent or all NO_REPLY
- New: setMentionOverride(), hasMentionOverride(), extractMentionedUserIds()
- New: buildUserIdToAccountIdMap() for reverse userId→accountId resolution

Bump version to 0.3.0
2026-03-07 16:55:01 +00:00

Dirigent

Rule-based no-reply gate + turn manager for OpenClaw (Discord).

Formerly known as WhisperGate. Renamed to Dirigent in v0.2.0.

What it does

Dirigent adds deterministic logic before model selection and turn-based speaking for multi-agent Discord channels:

  • Rule gate (before_model_resolve)

    1. Non-Discord → skip
    2. Sender in bypass list / human list → skip
    3. Message ends with configured end symbol → skip
    4. Otherwise → route to no-reply model/provider
  • End-symbol enforcement

    • Injects instruction: Your response MUST end with 🔚…
    • In group chats, also injects: "If not relevant, reply NO_REPLY"
  • Scheduling identifier (moderator handoff)

    • Configurable identifier (default: ➡️) used by the moderator bot
    • Handoff format: <@TARGET_USER_ID>➡️ (non-semantic, just a scheduling signal)
    • Agent receives instruction explaining the identifier is meaningless — check chat history and decide
  • 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
  • Agent identity injection

    • Injects agent name, Discord accountId, and Discord userId into group chat prompts
  • Per-channel policy runtime

    • Policies stored in a standalone JSON file
    • Update at runtime via dirigent_tools (memory first → persist to file)
  • Discord control actions (optional)

    • Private channel create/update + member list
    • Unified via dirigent_tools

Repo layout

  • plugin/ — OpenClaw plugin (gate + turn manager + moderator presence)
  • no-reply-api/ — OpenAI-compatible API that always returns NO_REPLY
  • discord-control-api/ — Discord admin extension API (private channels + member list)
  • docs/ — rollout, integration, run-mode notes, turn-wakeup analysis
  • scripts/ — smoke/dev/helper checks
  • Makefile — 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 extension capabilities: docs/DISCORD_CONTROL.md.


Runtime tools & commands

Tool: dirigent_tools

Actions:

  • policy-get, policy-set-channel, policy-delete-channel
  • turn-status, turn-advance, turn-reset
  • channel-private-create, channel-private-update, member-list

Slash command (Discord)

/dirigent status
/dirigent turn-status
/dirigent turn-advance
/dirigent turn-reset

Config highlights

Common options (see docs/INTEGRATION.md):

  • listMode: human-list or agent-list
  • humanList, agentList
  • endSymbols
  • schedulingIdentifier (default ➡️)
  • channelPoliciesFile (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
Rule-based no-reply gate for OpenClaw
Readme 1.6 MiB
Languages
TypeScript 75.7%
JavaScript 23.8%
Shell 0.4%
Makefile 0.1%