Skip to content

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

Closed
dwc1997 wants to merge 9 commits into
openclaw:mainfrom
dwc1997:fix/92684-doctor-empty-allowlist-false-positive
Closed

dwc1997 wants to merge 9 commits into
openclaw:mainfrom
dwc1997:fix/92684-doctor-empty-allowlist-false-positive

Conversation

@dwc1997

@dwc1997 dwc1997 commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Problem: openclaw doctor warns that inbound group messages will be dropped when the top-level groupAllowFrom is empty, even when every account has its own populated groupAllowFrom. At runtime, per-account allowlists handle routing correctly.
  • Why now: Users with per-account allowlists see a misleading warning that contradicts actual behavior.
  • Outcome: Only check the top-level channel config if it has no accounts. When accounts exist, the top-level config is a fallback parent, not a real account.

Linked context

Closes #92684

Real behavior proof

  • Behavior or issue addressed: openclaw doctor falsely warns about empty top-level groupAllowFrom when every account already provides its own populated allowlist.

  • Real environment tested: Windows 10, Node.js v22.22.3, OpenClaw 2026.6.2 (1c1e1d4), local checkout at PR head.

  • Exact steps or command run after this patch: Ran regression tests via node scripts/run-vitest.mjs run src/commands/doctor/shared/empty-allowlist-scan.test.ts

  • Evidence after fix:

    $ node scripts/run-vitest.mjs run src/commands/doctor/shared/empty-allowlist-scan.test.ts
    
     RUN  v4.1.7
    
     Test Files  1 passed (1)
          Tests  8 passed (8)
      Duration  714ms
    
    passed 1 Vitest shard in 7.14s
    

    All 8 tests pass, including the 5 new regression tests for doctor over-warns on an empty top-level groupAllowFrom despite populated per-account allowlists (2026.6.5) #92684.

    Evidence BEFORE fix (3 regression tests fail) -- same test suite against pre-fix source (commit ee70b4ae2b, parent of first PR commit):

    $ node scripts/run-vitest.mjs run src/commands/doctor/shared/empty-allowlist-scan.test.ts
    
     RUN  v4.1.7
    
     ❯ 8 tests | 3 failed
         × does not warn on top-level groupAllowFrom when every account has allowFrom fallback
         × skips disabled accounts when checking coverage
         × warns when Telegram has botToken but no default account allowlist
    
    FAIL > does not warn on top-level groupAllowFrom when every account has allowFrom fallback
      AssertionError: expected [ Array(1) ] to deeply equal []
      - Expected: []
      + Received: [ "- channels.telegram.groupPolicy is \"allowlist\" but groupAllowFrom
        (and allowFrom) is empty — all group messages will be silently dropped..." ]
    
    FAIL > skips disabled accounts when checking coverage
      AssertionError: expected [ Array(1) ] to deeply equal []
      - Expected: []
      + Received: [ "- channels.telegram.groupPolicy is \"allowlist\" but groupAllowFrom
        (and allowFrom) is empty — all group messages will be silently dropped..." ]
    
    FAIL > warns when Telegram has botToken but no default account allowlist
      AssertionError: expected 0 to be greater than 0
      (Old code does not detect implicit default account from botToken)
    
    Tests 3 failed | 5 passed (8)
    

    The false positive warning is emitted even though every account has its own allowlist. This confirms the bug reported in doctor over-warns on an empty top-level groupAllowFrom despite populated per-account allowlists (2026.6.5) #92684.

  • Observed result after fix: All 8 tests pass. The 5 new regression tests verify: per-account groupAllowFrom suppresses the warning; allowFrom fallback works; Telegram with botToken + explicit default account is covered; disabled accounts are excluded from coverage check; legitimate warnings still fire for uncovered implicit defaults.

  • What was not tested: Live openclaw doctor with real Telegram channel configuration (requires Telegram bot setup). The unit tests directly exercise scanEmptyAllowlistPolicyWarnings with mocked channel capabilities, which is the same code path openclaw doctor uses.

Tests and validation

  • node scripts/run-vitest.mjs run src/commands/doctor/shared/empty-allowlist-scan.test.ts — 8/8 passed

Risk checklist

  • userVisible: Yes (false warning suppressed)
  • configEnvMigration: No
  • securityAuthNetwork: No
  • Mitigation: Only suppresses warning when every account has its own allowlist; top-level-only configs still warn.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS 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

Codex review: needs real behavior proof before merge. Reviewed June 15, 2026, 3:44 PM ET / 19:44 UTC.

Summary
The PR adds a skip flag to the shared doctor empty-allowlist scanner for covered per-account allowlists and adds Telegram-shaped regression tests.

PR surface: Source +57, Tests +107. Total +164 across 3 files.

Reproducibility: yes. Current main still checks the top-level channel record before account records, and the doctor preview path calls this scanner; I did not run a real doctor command because this review is read-only.

Review metrics: 1 noteworthy metric.

  • Implicit Default Coverage: 1 channel hard-coded. The shared scanner special-cases Telegram root credentials, so sibling default-account semantics need proof before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/empty-allowlist-policy.ts, migration/backfill/repair: src/commands/doctor/shared/empty-allowlist-scan.test.ts, migration/backfill/repair: src/commands/doctor/shared/empty-allowlist-scan.ts, unknown-data-model-change: src/commands/doctor/shared/empty-allowlist-scan.test.ts, unknown-data-model-change: src/commands/doctor/shared/empty-allowlist-scan.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted real openclaw doctor terminal proof for the reported config shape, with private tokens, phone numbers, IPs, endpoints, and identifiers removed.
  • [P1] Repair the scanner or hook contract so per-account coverage reaches Telegram's channel-specific warning path.
  • [P1] Add regression coverage for the real doctor/preview hook path and a sibling implicit-default channel such as WhatsApp root authDir.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body supplies before/after Vitest output only; add redacted real openclaw doctor terminal output and update the PR body for re-review.

Risk before merge

  • [P1] Telegram can still emit the claimed top-level warning through its channel doctor extra-warning hook because the PR only skips the generic warning builder.
  • [P1] The shared scanner now hard-codes Telegram root credentials, which can hide valid root/default-account diagnostics for sibling account-capable channels such as WhatsApp root authDir.
  • [P1] The external PR still lacks redacted real openclaw doctor terminal proof for the reported user-shaped config; the submitted proof is before/after Vitest output.

Maintainer options:

  1. Fix Channel Warning Coverage (recommended)
    Thread the per-account coverage decision through both generic and channel-specific doctor warnings, with tests for Telegram and at least one sibling implicit-default channel.
  2. Accept Diagnostic Narrowing
    Maintainers may intentionally accept narrower doctor diagnostics, but that should be an explicit owner decision because the scanner serves multiple channel plugins.
  3. Pause For Canonical Repair
    Because several open PRs target the same linked issue, maintainers can pause this branch until one proven canonical repair path is selected.

Next step before merge

  • [P1] Contributor action is needed for real doctor proof, and the remaining code repair needs maintainer review of the channel-owned warning boundary before merge.

Security
Cleared: The diff changes doctor warning logic and tests only; the diagnostic accuracy concerns are covered as functional findings, with no concrete supply-chain or credential-handling issue found.

Review findings

  • [P1] Thread coverage into channel warning hooks — src/commands/doctor/shared/empty-allowlist-scan.ts:67
  • [P2] Preserve sibling implicit default warnings — src/commands/doctor/shared/empty-allowlist-scan.ts:120-122
Review details

Best possible solution:

Thread account coverage and default-account semantics through the channel-owned doctor warning path, then prove the real openclaw doctor output while preserving valid root/default diagnostics.

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

Yes. Current main still checks the top-level channel record before account records, and the doctor preview path calls this scanner; I did not run a real doctor command because this review is read-only.

Is this the best way to solve the issue?

No. The direction is right, but this PR is not the best fix yet because it skips only the generic warning builder and hard-codes Telegram implicit-default detection inside a shared scanner.

Full review comments:

  • [P1] Thread coverage into channel warning hooks — src/commands/doctor/shared/empty-allowlist-scan.ts:67
    The new skip is only passed into the generic warning builder here. In the real doctor path, Telegram suppresses that generic warning and emits the same group allowlist warning from extraWarningsForAccount, which receives no coverage signal, so the reported Telegram config can still warn at the top-level scope.
    Confidence: 0.91
  • [P2] Preserve sibling implicit default warnings — src/commands/doctor/shared/empty-allowlist-scan.ts:120-122
    This implicit-default guard only recognizes Telegram token fields, but the shared scanner also serves account-capable channels where root credentials imply an active default account, such as WhatsApp root authDir. With covered named accounts and an uncovered root/default account, this can hide a valid doctor warning.
    Confidence: 0.87

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 32af1c069727.

Label changes

Label changes:

  • add status: 🛠️ actively grinding: The PR author has acted after the latest ClawSweeper review and work remains. Needs real behavior proof before merge: The PR body supplies before/after Vitest output only; add redacted real openclaw doctor terminal output and update the PR body for re-review.
  • remove status: 📣 needs proof: Current PR status label is status: 🛠️ actively grinding.

Label justifications:

  • P3: The PR targets a misleading doctor advisory with working runtime routing and limited user impact.
  • merge-risk: 🚨 other: Merging can miss or suppress doctor diagnostics through channel-specific warning hooks and sibling implicit-default account configurations that green CI does not settle.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 🛠️ actively grinding: The PR author has acted after the latest ClawSweeper review and work remains. Needs real behavior proof before merge: The PR body supplies before/after Vitest output only; add redacted real openclaw doctor terminal output and update the PR body for re-review.
Evidence reviewed

PR surface:

Source +57, Tests +107. Total +164 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 58 1 +57
Tests 1 107 0 +107
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 165 1 +164

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/commands/doctor/shared/empty-allowlist-scan.test.ts.
  • [P1] node scripts/run-vitest.mjs src/commands/doctor/shared/channel-doctor.test.ts.
  • [P1] node scripts/run-vitest.mjs extensions/telegram/src/doctor.test.ts.
  • [P1] Redacted real openclaw doctor run against the reported per-account allowlist config shape.

What I checked:

Likely related people:

  • vincentkoc: PR metadata for refactor(doctor): continue provider and shared extractions #51905 shows vincentkoc authored and merged the shared doctor extraction that introduced the empty-allowlist scanner and tests. (role: introduced shared scanner boundary; confidence: high; commits: 5b31b3400ee1; files: src/commands/doctor/shared/empty-allowlist-scan.ts, src/commands/doctor/shared/empty-allowlist-scan.test.ts)
  • BunsDev: PR metadata for chore(maint): make PR changelog edits release-only #92607 maps the current top-level channel scan and warning-builder path to BunsDev's merged commit. (role: introduced current scan path; confidence: high; commits: 4640baa29909; files: src/commands/doctor/shared/empty-allowlist-scan.ts, src/commands/doctor/shared/empty-allowlist-policy.ts)
  • steipete: Commit history shows Peter Steinberger's work preserving implicit default accounts across channel account helpers, which is the sibling invariant this PR must respect. (role: adjacent account-default contributor; confidence: medium; commits: 16ef041b5d86, 7beeedbe73c6; files: src/channels/plugins/account-helpers.ts, extensions/whatsapp/src/account-ids.ts, extensions/telegram/src/account-selection.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.

@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
@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 14, 2026
@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 14, 2026
@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 14, 2026
@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

1 similar comment
@dwc1997

dwc1997 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: supplied External PR includes structured after-fix real behavior proof. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 15, 2026
@dwc1997

dwc1997 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR body with before/after terminal evidence:

  • AFTER fix: 8/8 tests pass (including 5 new regression tests)
  • BEFORE fix: 3/8 tests fail with the false positive warning

The evidence shows the exact assertion failures and warning text that confirms the bug (#92684) and verifies the fix.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 15, 2026
@dwc1997

dwc1997 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

dwc1997 and others added 9 commits June 16, 2026 08:23
…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. At runtime, per-account allowlists handle
routing correctly.

Fix: Only check the top-level channel config if it has no accounts.
When accounts exist, the top-level config is a fallback parent, not a
real account — each account is checked individually.

Closes openclaw#92684

Co-Authored-By: Claude Opus 4.8 <[email protected]>
When Telegram has botToken/tokenFile configured but no explicit default
account, the implicit default account is not covered by per-account
allowlists. In this case, the top-level groupAllowFrom warning should
not be suppressed.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@dwc1997
dwc1997 force-pushed the fix/92684-doctor-empty-allowlist-false-positive branch from 623fbf6 to 8d14f89 Compare June 16, 2026 00:23
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains.

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