Skip to content

fix: gate ClickClack group replies on mentions - #115484

Merged
shakkernerd merged 8 commits into
openclaw:mainfrom
jjjhenriksen:agent/clickclack-mention-gating
Jul 30, 2026
Merged

shakkernerd merged 8 commits into
openclaw:mainfrom
jjjhenriksen:agent/clickclack-mention-gating

Conversation

@jjjhenriksen

@jjjhenriksen jjjhenriksen commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add opt-in ClickClack group mention gating so shared-workspace agents do not all respond to ordinary group traffic.

  • Supports ClickClack @handle mentions and configured mention patterns.
  • Supports account defaults plus exact-channel and wildcard group overrides.
  • Preserves DM behavior and backward-compatible group dispatch by default.
  • Uses the selected discussion agent's mention patterns for managed discussions.
  • Propagates the resolved mention facts through inbound dispatch.
  • Documents the configuration and publishes it in the plugin manifest.

What Problem This Solves

When several enabled ClickClack accounts share one workspace, ordinary group traffic can activate every account because the adapter treated each group message as addressed to the bot. This change adds opt-in mention gating while preserving direct-message behavior and default group dispatch.

Evidence

  • Blacksmith Testbox passed all 25 ClickClack test files, covering 306 tests.
  • A separate Blacksmith Testbox run passed the full build, docs-map validation, and bundled-channel metadata validation.
  • Focused mention, gateway, inbound, account, group-policy, and managed-discussion tests passed.
  • Two-pass branch autoreview completed with no actionable findings.

Behavior

requireMention is disabled unless configured. When enabled for a group:

  • A mention of the authenticated bot handle satisfies the policy.
  • Safe configured regular expressions can provide additional mention forms.
  • Mentions of other users do not count as mentions of the bot.
  • Authorized text commands continue to follow the shared command policy.
  • DMs bypass group mention gating.

Group policy resolution uses normalized channel IDs with this precedence:

  1. Exact channel override
  2. Wildcard groups["*"] override
  3. Account default

Named-account settings inherit missing fields from the top-level ClickClack configuration, including partial overrides for the same group key.

Verification

Blacksmith Testbox:

  • tbx_01kyrghk85vz125wdxn6pcx9vq: all 25 ClickClack test files passed, 306 tests total.
  • tbx_01kyrk3p9frj7r0krbvt40yjdg: full pnpm build, docs-map validation, and bundled-channel metadata validation passed.

Additional proof:

  • Focused mention, gateway, inbound, account, group-policy, and managed-discussion suites passed.
  • git diff --check passed.
  • Two-pass branch autoreview completed with no actionable findings.

A broad pnpm test:changed run continued beyond the complete passing ClickClack suite and encountered unrelated current-main failures.

Thanks @jjjhenriksen for the original contribution.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 29, 2026
@jjjhenriksen jjjhenriksen changed the title fix(clickclack): gate group replies on mentions fix(clickclack): gate group replies on mentions [AI-assisted] Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 29, 2026
@jjjhenriksen
jjjhenriksen marked this pull request as ready for review July 29, 2026 03:00
@jjjhenriksen
jjjhenriksen force-pushed the agent/clickclack-mention-gating branch from a73e024 to af6e08b Compare July 29, 2026 03:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a73e0247fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/clickclack/src/access.ts Resolved
Comment thread extensions/clickclack/src/access.ts Resolved
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 30, 2026, 10:07 AM ET / 14:07 UTC.

ClawSweeper review

What this changes

This PR adds optional ClickClack group-message mention gating, with account and per-channel policies, mention detection before inbound dispatch, plugin metadata, tests, and user documentation.

Merge readiness

⚠️ Needs maintainer review before merge - 6 items remain

Keep this PR open. The current head still manually adds ClickClack headings to the generated docs map, so the prior P2 blocker remains; the underlying opt-in delivery policy has useful proof and active maintainer involvement, but the public configuration direction and generated-docs cleanup need completion before merge.

Priority: P2
Reviewed head: 2a5bc631d7547fa3501b1383a13bb707730b652a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR has meaningful reported validation and a focused delivery-policy design, but the remaining generated-documentation defect and pending configuration-contract decision keep it below merge-ready quality.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body reports passing Testbox ClickClack tests and a full build, and the supplied PR state marks real-behavior proof sufficient; redact any private workspace, endpoint, or token details if additional runtime output is posted.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body reports passing Testbox ClickClack tests and a full build, and the supplied PR state marks real-behavior proof sufficient; redact any private workspace, endpoint, or token details if additional runtime output is posted.
Evidence reviewed 4 items Generated documentation map remains manually edited: The PR still adds four ClickClack headings beneath the generated-map warning. The file declares that it must not be edited by hand, so these entries should be removed or produced by the supported generator rather than maintained in the PR.
Prior review blocker remains applicable: The preceding ClawSweeper review identified these docs-map additions as a P2 issue, and the supplied current-head file list still contains the same four added headings.
Maintainer-facing documentation concern: A review comment on the docs-map change states that it should not be included because it would publish to the documentation site; that aligns with retaining the generated-file cleanup as an actionable blocker.
Findings 1 actionable finding [P2] Remove the manual generated docs-map entries
Security None None.

How this fits together

ClickClack is a bundled channel plugin: its gateway receives ClickClack events, resolves account and agent routing, decides whether inbound access permits dispatch, and sends accepted messages into the agent pipeline. The proposed policy adds a mention-based decision before agent dispatch for group messages while leaving direct messages outside that gate.

flowchart LR
  A[ClickClack message event] --> B[Gateway account]
  B --> C[Route and access resolution]
  C --> D[Mention and group policy]
  D --> E{Dispatch allowed?}
  E -->|Yes| F[Agent inbound pipeline]
  E -->|No| G[Recorded skipped message]
  F --> H[ClickClack outbound reply]
Loading

Decision needed

Question Recommendation
Should ClickClack permanently expose account-level and per-group mention-gating settings as a supported public plugin configuration contract? Sponsor the configuration contract: Accept the default-off group-policy model after the generated docs-map cleanup and retain focused compatibility and delivery tests.

Why: The branch introduces new user-facing configuration and delivery policy rather than only repairing an established ClickClack behavior; active implementation work supports the direction, but permanent contract acceptance is a maintainer choice.

Before merge

  • Remove the manual generated docs-map entries (P2) - docs/docs_map.md declares that it is generated and must not be edited by hand, but this patch adds four ClickClack headings directly. Keep the ClickClack page documentation, then remove these entries or generate the map through its supported workflow so the published map cannot drift on the next regeneration.
  • Resolve merge risk (P1) - The new group policy decides whether messages reach an agent; incorrect inheritance, command bypasses, or mention facts can suppress intended ClickClack group delivery.
  • Resolve merge risk (P1) - The public configuration shape adds account, wildcard, and exact-channel settings, so maintainers should explicitly accept this plugin configuration contract before it becomes a supported surface.
  • Resolve merge risk (P1) - Manual edits to the generated docs map can leave published navigation/content out of sync with the supported documentation-generation workflow.
  • Complete next step (P2) - A narrow docs-map repair is clear, but landing the new user-facing ClickClack configuration requires maintainer product-contract confirmation rather than autonomous repair routing.

Findings

  • [P2] Remove the manual generated docs-map entries — docs/docs_map.md:355-358
Agent review details

Security

None.

PR surface

Source +363, Tests +637, Docs +57, Generated 0. Total +1057 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 9 469 106 +363
Tests 6 637 0 +637
Docs 2 74 17 +57
Config 0 0 0 0
Generated 1 18 18 0
Other 0 0 0 0
Total 18 1198 141 +1057

Review metrics

Metric Value Why it matters
Configuration policy surface 3 added setting families requireMention, mentionPatterns, and per-channel groups collectively change how configured ClickClack group messages are activated and routed.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/docs_map.md, unknown-data-model-change: src/config/bundled-channel-config-metadata.generated.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Regenerate or remove the docs-map entries (recommended)
    Keep the ClickClack documentation, but remove manual docs/docs_map.md headings or update that generated file through its supported generator before merge.
  2. Accept a documented configuration contract
    After cleanup, explicitly accept that the new account, wildcard, and exact-channel policies are supported plugin configuration rather than an internal implementation detail.
  3. Pause the policy expansion
    Close or defer this PR if maintainers do not want ClickClack-specific mention gating to add a permanent configuration surface.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Remove the manual docs-map headings or regenerate the file with the repository-supported docs-map workflow, then retain only the generated result.

Technical review

Best possible solution:

Retain the opt-in, default-off ClickClack gating design only after removing the hand-authored generated-map entries or regenerating them through the supported docs-map workflow, then land the documented configuration as the accepted plugin contract.

Do we have a high-confidence way to reproduce the issue?

Yes for the remaining review finding: the current PR diff adds headings directly to docs/docs_map.md immediately after its generated-file warning. The channel behavior itself has source-backed and reported Testbox coverage, but no fresh live ClickClack transcript is included in the supplied evidence.

Is this the best way to solve the issue?

No: the present branch is not yet the best merge-ready solution because it hand-edits a generated documentation map. Removing those entries or regenerating them through the repository workflow is the narrower maintainable path; maintainers must also confirm the new plugin configuration contract.

Full review comments:

  • [P2] Remove the manual generated docs-map entries — docs/docs_map.md:355-358
    docs/docs_map.md declares that it is generated and must not be edited by hand, but this patch adds four ClickClack headings directly. Keep the ClickClack page documentation, then remove these entries or generate the map through its supported workflow so the published map cannot drift on the next regeneration.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 319fd692d1c8.

Labels

Label justifications:

  • P2: The proposed optional channel policy has a bounded but concrete effect on whether group messages dispatch to agents.
  • merge-risk: 🚨 compatibility: The new account, wildcard, and exact-channel policy hierarchy becomes a user-facing configuration contract that must preserve default dispatch and inheritance.
  • merge-risk: 🚨 message-delivery: Mention gating directly determines whether a ClickClack group message is delivered to the agent pipeline.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body reports passing Testbox ClickClack tests and a full build, and the supplied PR state marks real-behavior proof sufficient; redact any private workspace, endpoint, or token details if additional runtime output is posted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports passing Testbox ClickClack tests and a full build, and the supplied PR state marks real-behavior proof sufficient; redact any private workspace, endpoint, or token details if additional runtime output is posted.

Evidence

What I checked:

  • Generated documentation map remains manually edited: The PR still adds four ClickClack headings beneath the generated-map warning. The file declares that it must not be edited by hand, so these entries should be removed or produced by the supported generator rather than maintained in the PR. Public docs: docs/docs_map.md. (docs/docs_map.md:352, 2a5bc631d754)
  • Prior review blocker remains applicable: The preceding ClawSweeper review identified these docs-map additions as a P2 issue, and the supplied current-head file list still contains the same four added headings. Public docs: docs/docs_map.md. (docs/docs_map.md:355, 2a5bc631d754)
  • Maintainer-facing documentation concern: A review comment on the docs-map change states that it should not be included because it would publish to the documentation site; that aligns with retaining the generated-file cleanup as an actionable blocker. Public docs: docs/docs_map.md. (docs/docs_map.md:355, 2a5bc631d754)
  • Current branch has substantial real-behavior and build evidence: The PR body reports a passing 306-test ClickClack suite, focused policy and inbound suites, a full build, docs-map validation, and bundled-channel metadata validation; the supplied PR state also marks proof sufficient. (extensions/clickclack/src/inbound.mention-gating.test.ts:1, 2a5bc631d754)

Likely related people:

  • shakkernerd: Was assigned to this PR and authored the follow-up commits that addressed mention recognition, discussion routing, policy inheritance, generated metadata, normalized group lookup, and final lint work. (role: active follow-up contributor and likely decision owner; confidence: medium; commits: d775245c7b9f, 8659df0541ec, 2c36519c8714; files: extensions/clickclack/src/access.ts, extensions/clickclack/src/group-policy.ts, extensions/clickclack/src/mention-facts.ts)
  • Patrick-Erichsen: Raised the concrete concern that the docs-map change would be published, which directly relates to the remaining generated-documentation finding. (role: adjacent documentation reviewer; confidence: medium; files: docs/docs_map.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove or regenerate the docs/docs_map.md additions through the supported workflow.
  • Confirm maintainer sponsorship of the new ClickClack configuration contract.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-29T17:12:03.072Z sha 5c85e666dfb5655aa563bab387547a130f5fa06e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T19:11:20.550Z sha 72aa98dbb22807f1e5de0da733a7c2db90f06199 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T19:29:02.694Z sha d08e617ae973ac524e39cc0f261e96bd48dcd90d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T20:35:42.235Z sha d08e617ae973ac524e39cc0f261e96bd48dcd90d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T22:58:59.997Z sha 3daef0461e93551d792cba0cac59fd6c5860d62f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T23:35:33.120Z sha e3af448ca9ebf49e3295a1830fad0b5a25caa1fb :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T00:23:19.733Z sha 127fc13883e32b0f0227426592db89e2059ca56c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T04:42:10.502Z sha 56a929f36951286665e05ca22a242030eb903b68 :: needs changes before merge. :: [P2] Remove the manual generated docs-map entries

@openclaw-barnacle openclaw-barnacle Bot added size: M size: L triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: blank-template Candidate: PR template appears mostly untouched. and removed size: L size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 30, 2026
@shakkernerd
shakkernerd force-pushed the agent/clickclack-mention-gating branch from b4ddbbd to a256212 Compare July 30, 2026 04:11
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 30, 2026

MixxyAI commented Jul 30, 2026

Copy link
Copy Markdown

Following up on the multi-Agent testing collaboration I mentioned earlier: I now have a narrowly scoped external test ready for the NodeRooms release-source/1.3.0 OpenClaw plugin source. It is read-only and pinned to SHA-256 3846f8f8a1c5d051064efc629da3e4cf768c0b10f3386436506aa3db8cdc5913; there is no public posting, capability request, lease claim, raw-log sharing, or secret handling. Your ClickClack/mention-gate environment would be useful for checking plugin coexistence and per-Agent isolation. If you’d like to try it, I can send the exact short protocol and we can keep the result to redacted compatibility evidence.

@shakkernerd
shakkernerd force-pushed the agent/clickclack-mention-gating branch from 56a929f to 2a5bc63 Compare July 30, 2026 14:03
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Jul 30, 2026
@shakkernerd
shakkernerd force-pushed the agent/clickclack-mention-gating branch from 2a5bc63 to ea82059 Compare July 30, 2026 14:42
@shakkernerd
shakkernerd merged commit ea82059 into openclaw:main Jul 30, 2026
115 of 116 checks passed
@shakkernerd

shakkernerd commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Merged.

What changed after review:

  • Corrected ClickClack @handle detection and managed-discussion mention routing.
  • Preserved inherited account/channel policy and normalized group lookups.
  • Refreshed docs, manifest metadata, and focused regression coverage.

Verification:

  • Rebased onto current origin/main and proved every patch equivalent with git range-diff.
  • Blacksmith Testbox tbx_01kyrghk85vz125wdxn6pcx9vq: all ClickClack tests passed (306 tests).
  • Blacksmith Testbox tbx_01kyrk3p9frj7r0krbvt40yjdg: full build and generated metadata checks passed.
  • Auto-review: clean after final fixes.
  • GitHub checks: openclaw/ci-gate passed on the equivalent prepared patch; the final signed replay preserved patch content.

Landed on main:

Thanks @jjjhenriksen!

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 30, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
steipete added a commit that referenced this pull request Aug 13, 2026
clickclack inbound mention gating: #114388 (1ca60fb) made multi-agent fallback ownership explicit, so the #115484 fixture now declares its clickclack:default service-bot binding.

policy CLI: #114388 (1ca60fb) removed ambient ownership from normalized multi-agent configs, so the #111087 routing-probe fixture uses the sole main agent and still reaches the intended findings exit.

Teams and Zoom node invoke policy: #118451 (7d40666) added trusted audio backend, buffer size, and format forwarding; assert those fields alongside the configured commands.

Teams node host: #118451 (7d40666) made default audio commands platform-dependent at import time after #111455 added the sox dedupe test; reset modules and mock Darwin before importing defaults.

This branch had an error being deployed

1 failed deployment
qa-live-shared — ea82059e Deployed Jul 30, 2026 by github-actions[bot] via Run isolated Telegram candidate #483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. triage: blank-template Candidate: PR template appears mostly untouched.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants