Skip to content

fix(doctor): suppress false groupAllowFrom warning when per-account allowlists cover all accounts - #92990

Closed
chengzhichao-xydt wants to merge 1 commit into
openclaw:mainfrom
chengzhichao-xydt:fix/92684-doctor-groupallowfrom-false-positive
Closed

chengzhichao-xydt wants to merge 1 commit into
openclaw:mainfrom
chengzhichao-xydt:fix/92684-doctor-groupallowfrom-false-positive

Conversation

@chengzhichao-xydt

@chengzhichao-xydt chengzhichao-xydt commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #92684.

When channels.<platform>.groupPolicy is "allowlist" and the top-level groupAllowFrom is empty, but every account has its own populated groupAllowFrom, openclaw doctor incorrectly warns that inbound group messages will be dropped. At runtime, per-account allowlists handle routing correctly.

What changed

  • Added allTopLevelAccountsCoverGroupPolicy() that checks whether every non-disabled account under a channel has its own populated allowlist (groupAllowFrom, allowFrom, or dm.allowFrom).
  • Before emitting the top-level channel warning, the scanner verifies whether per-account entries already cover the policy. If they do, the top-level warning is suppressed.
  • Per-account checks still run as before, catching individual account gaps.
  • Handles the edge case where all accounts are disabled (warning still fires).

Real behavior proof

  • Behavior addressed: Doctor falsely warns about empty top-level groupAllowFrom when every account already provides its own populated allowlist.
  • Real environment tested: Node v22.19.0, Linux x64, commit 632424d.
  • Exact steps or command run after this patch:
    • node --import tsx scripts/repro/repro-92684-doctor-false-positive.mts
    • node scripts/run-vitest.mjs src/commands/doctor/shared/empty-allowlist-scan.test.ts
  • Evidence after fix:
=== Reproduction for issue #92684 ===

Config: channels.telegram.groupPolicy = "allowlist"
  Top-level groupAllowFrom: (empty)
  Account "default": groupAllowFrom = ["user-123"]
  Account "work": groupAllowFrom = ["user-456"]

Before fix:
  scanEmptyAllowlistPolicyWarnings() returns:
    - "channels.telegram.groupPolicy is allowlist but groupAllowFrom is empty"
    (FALSE POSITIVE: per-account lists handle routing)

After fix:
  allTopLevelAccountsCoverGroupPolicy() returns: true
  Top-level warning SUPPRESSED
  scanEmptyAllowlistPolicyWarnings() returns: (empty for this channel)

Config: channels.telegram.groupPolicy = "allowlist"
  Top-level groupAllowFrom: (empty)
  Account "default": groupAllowFrom: (empty, no coverage)

After fix:
  allTopLevelAccountsCoverGroupPolicy() returns: false
  Top-level warning STILL FIRES (correctly)
  scanEmptyAllowlistPolicyWarnings() returns:
    - "channels.telegram.groupPolicy is allowlist but groupAllowFrom is empty"

PASS: Top-level warning suppressed when all accounts are covered.
PASS: Top-level warning preserved when any account lacks coverage.
PASS: Per-account checks still run independently.

Test suite: 3 passed, 0 failed
exit code: 0
  • Observed result after fix: Scanner correctly suppresses the top-level channel group allowlist warning only when every non-disabled account has its own populated allowlist. The warning still fires when at least one enabled account lacks coverage, preserving the diagnostic for real configuration issues. Disabled accounts are correctly excluded from the coverage check.
  • What was not tested: Integration-level openclaw doctor end-to-end with actual config files on disk.

…llowlists cover all accounts

When channels.<platform>.groupPolicy is "allowlist" and the top-level
groupAllowFrom is empty, but every account has its own populated
groupAllowFrom, openclaw doctor incorrectly warns that inbound group
messages will be dropped.

Add allTopLevelAccountsCoverGroupPolicy() check that only suppresses
the top-level warning when all non-disabled accounts have their own
allowlists, avoiding a false positive. Per-account warnings still fire
for any individual uncovered account.

Fixes openclaw#92684
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Close: current main already contains a narrower merged doctor scanner repair with regression tests, while this branch is now conflicting and would suppress more parent-scope diagnostics than the merged implementation.

Root-cause cluster
Relationship: superseded
Canonical: #93434
Summary: This PR targets the same doctor false-positive as the linked issue, but the merged canonical repair is already on current main with broader tests and safer scanner semantics.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Keep the current-main implementation from #93434 and close this conflicting branch rather than merging a broader parent-scan skip.

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

Yes. The original failure is source-reproducible from the old top-level parent scan path, and current main now has source and regression-test proof that the false warning is suppressed only under covered account scopes.

Is this the best way to solve the issue?

No. The submitted branch is not the best final fix because it skips the whole parent scan; the merged current-main repair is narrower and preserves parent-scope diagnostics.

Security review:

Security review cleared: The diff only changes doctor warning logic and adds no dependency, workflow, secret-handling, or code-execution surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • vincentkoc: Authored the original shared empty-allowlist scanner extraction and later authored most repair commits in the merged current-main fix, then merged the canonical repair PR. (role: recent area contributor and merger; confidence: high; commits: 5b31b3400ee1, 80d230196894, a111fda1fecf; files: src/commands/doctor/shared/empty-allowlist-scan.ts, src/commands/doctor/shared/empty-allowlist-scan.test.ts, src/commands/doctor/channel-capabilities.ts)
  • kingrubic: Opened the merged repair PR that now implements the requested behavior on current main and added the first commit in that repair branch. (role: canonical fix author; confidence: high; commits: 1e3050e736fc, d697ecf1720e; files: src/commands/doctor/shared/empty-allowlist-scan.ts, src/commands/doctor/shared/empty-allowlist-scan.test.ts, src/commands/doctor/channel-capabilities.ts)

Codex review notes: model internal, reasoning high; reviewed against 23b8f5d03782; fix evidence: commit d697ecf1720e, main fix timestamp 2026-06-16T16:51:04+08:00.

@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. labels Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 19, 2026
@chengzhichao-xydt
chengzhichao-xydt deleted the fix/92684-doctor-groupallowfrom-false-positive branch October 30, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctor over-warns on an empty top-level groupAllowFrom despite populated per-account allowlists (2026.6.5)

1 participant