Repository navigation
Conversation
- emit observation-only pre-auth hooks for blocked Telegram and WhatsApp DMs - expose message_pre_auth to plugins and message:pre-auth to internal hooks before pairing or rejection - keep pre-auth handling sessionless, model-free, reply-free, bounded, and fire-and-forget - support grouped DM allowFrom entries for Telegram and WhatsApp - propagate sender_group through inbound context, hook metadata, and trusted prompt metadata - add trusted, partner, friends, family, work, and restricted sender groups - allow /allowlist add dm --group to add senders or move existing senders between groups - preserve existing allowlist normalization, configWrites checks, and commands.config authorization - auto-load trusted bundled or managed access-request hooks when any account uses dmPolicy: allowlist - keep workspace hooks explicitly opt-in because they execute mutable local code in the Gateway process - reload internal hooks when relevant configuration changes - add an env-configured workspace access-request example for silent phrase-gated operator notifications - validate stable sender identities and sanitize untrusted notification fields - document plugin compatibility, messaging tool policy, chat config-edit requirements, Docker Compose environment reload behavior, and WhatsApp number normalization troubleshooting - update Telegram and WhatsApp config schemas, generated metadata, channel docs, hook docs, and regression coverage
|
Codex review: found issues before merge. Reviewed July 13, 2026, 4:56 PM ET / 20:56 UTC. Summary Reproducibility: not applicable. this is a new feature and plugin/config API proposal rather than a report of broken established behavior; current main has canonical access groups but not this pre-auth workflow. Review metrics: 3 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep a generic pre-auth observation API explicitly enabled, expose minimal metadata by default with content as a deliberate opt-in, and derive sender classification from canonical named Do we have a high-confidence way to reproduce the issue? Not applicable: this is a new feature and plugin/config API proposal rather than a report of broken established behavior; current main has canonical access groups but not this pre-auth workflow. Is this the best way to solve the issue? No in its current form: the pre-auth workflow is useful, but the fixed grouped-entry model duplicates canonical Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b086cb311053. Label changesLabel justifications:
Evidence reviewedSecurity concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (46 earlier review cycles; latest 8 shown)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c7110b2e5
ℹ️ 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".
| if (!params.group && !params.isFromMe && senderAccess.decision !== "allow") { | ||
| emitWhatsAppMessagePreAuthHooks({ |
There was a problem hiding this comment.
Respect disabled WhatsApp DM policy before pre-auth hooks
When a WhatsApp account has dmPolicy: "disabled", resolveWhatsAppIngressAccess returns a non-allow decision, so this new condition emits message_pre_auth hooks with the raw DM content/name before the dm_policy_disabled branch below blocks the message. That makes explicitly configured pre-auth hooks observe DMs that the disabled policy is supposed to suppress entirely; skip pre-auth emission for senderAccess.reasonCode === "dm_policy_disabled" (matching Telegram's early return) or move this after the disabled-policy check.
Useful? React with 👍 / 👎.
- skip WhatsApp pre-auth hook emission when dmPolicy is disabled - add regression coverage proving disabled DMs do not fire plugin or internal pre-auth hooks - preserve grouped Telegram allowFrom entries across setup, doctor, directory, and runtime helpers - align tests and boundary-safe helpers for grouped allowlist entries
- format updated pre-auth docs with the docs formatter - exclude workspace hook examples from duplicate-scan target coverage - keep access-request workspace examples tracked without treating them as runtime source
- merge current upstream/main into the pre-auth PR branch - fix docs glossary, formatting, lint, and staged merge fallout - keep the WhatsApp pre-auth monitor regression passing - prepare the branch for exact-merge and CI rerun
- remove remaining merge marker cleanup from gateway reload handlers - refresh bundled channel metadata and SDK surface report budgets - align WhatsApp harness and reload handler tests after merging main
…_telegram-whatsapp
|
It's impossible to keep a PR of this level updated and synchronized for so long, given the numerous conflict issues caused by the high volume of advancements on the main branch, and so far there hasn't even been any attention given to this PR. I'm discouraged and no longer interested; maybe I'll do it again for my own use in the future. |
Summary
This PR adds a silent access-request workflow for blocked Telegram and WhatsApp direct messages.
sender_groupmetadata./allowlist add dm --groupto add senders or move them between groups.access-requesthooks while keeping mutable workspace hooks explicitly opt-in.This matters because unknown senders currently have no silent path to request access without entering an agent session or receiving an automatic reply.
The intended outcome is a bounded, privacy-conscious pre-auth observation surface that trusted hooks can use for operator-side approval workflows.
Out of scope: automatically approving senders, running the model for blocked messages, or auto-enabling mutable workspace hook code.
Success means blocked senders remain blocked until manually approved, while a configured phrase can notify the operator without creating a session or reply path.
Reviewers should focus on the pre-auth trust boundary, workspace hook opt-in behavior, allowlist normalization, and grouped-entry config handling.
Linked context
Which issue does this close?
N/A - no linked issue.
Which issues, PRs, or discussions are related?
N/A.
Was this requested by a maintainer or owner?
No known maintainer or owner request. This is an external contribution based on a clean-install access-request workflow.
Real behavior proof (required for external PRs)
dmPolicy: "allowlist"and an explicitly enabled workspaceaccess-requesthook.access-requestexample with environment variables.openclaw config set tools.profile messaging.openclaw config set commands.config true.docker compose down && docker compose up -d./allowlist add dm --channel whatsapp --group restricted <sender-number>./allowlist add dm --channel whatsapp./allowlist add dm --channel telegram.Tests and validation
Commands run:
Focused Vitest validation covered 18 files and 383 tests across Telegram, WhatsApp, hook loading, hook mapping, config reload, inbound metadata, and grouped allowlist edits.
Focused Vitest command:
WhatsApp E2E validation:
Regression coverage added or updated:
/allowlistmutations, internal hook events, plugin hook mapping, config reload behavior, and trusted prompt metadata.Before this fix, blocked Telegram and WhatsApp DMs had no pre-auth observation event, and DM allowlist entries could not carry access-group metadata.
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes.
Did config, environment, or migration behavior change? (
Yes/No)Yes. The config schema adds optional grouped DM
allowFromentries. Existing string entries remain supported. No migration is required.Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)Yes.
What is the highest-risk area?
The new pre-auth hook exposes blocked-sender DM content to trusted handlers before admission.
How is that risk mitigated?
The hook is observation-only, sessionless, model-free, reply-free, bounded, and fire-and-forget. Mutable workspace hooks remain explicitly opt-in. Trusted bundled or managed hooks may auto-load only when an account uses
dmPolicy: "allowlist". Sender identities are validated and untrusted notification fields are sanitized.Current review state
What is the next action?
Submit for maintainer review.
What is still waiting on author, maintainer, CI, or external proof?
CI and maintainer review pending.
Which bot or reviewer comments were addressed?
Earlier review findings were addressed:
allowFromentries.Agent Transcripts
Two redacted English reviewer artifacts are available: