Skip to content

fix(doctor): suppress false group-allowlist warning when all accounts override groupAllowFrom (fixes #92684) - #92889

Closed
zenglingbiao wants to merge 5 commits into
openclaw:mainfrom
zenglingbiao:fix/issue-92684-doctor-group-allowlist-false-warning
Closed

zenglingbiao wants to merge 5 commits into
openclaw:mainfrom
zenglingbiao:fix/issue-92684-doctor-group-allowlist-false-warning

Conversation

@zenglingbiao

@zenglingbiao zenglingbiao commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Problem: openclaw doctor over-warns about an empty top-level groupAllowFrom when every sub-account defines its own populated groupAllowFrom. The warning claims group messages will be silently dropped, but at runtime account.groupAllowFrom ?? parent.groupAllowFrom means the empty top-level fallback is never consulted.
  • Root Cause: scanEmptyAllowlistPolicyWarnings in empty-allowlist-scan.ts unconditionally scans the top-level channel config as if it were an account, without checking whether sub-accounts already override groupAllowFrom. Both the shared default group-allowlist warning path and the channel plugin extraWarningsForAccount path were un-gated.
  • Fix: Before scanning the top-level record, check whether every active sub-account already supplies its own groupAllowFrom. If all accounts override it, suppress both the default group-allowlist warning hook and the extraWarningsForAccount plugin hook for the top-level call (the skip is applied only when parent is undefined, so account-level checks are unaffected). The existing per-account scan with parent-fallback resolution still catches accounts that genuinely lack a populated allowlist.
  • What changed:
    • src/commands/doctor/shared/empty-allowlist-scan.ts — added pre-scan of sub-account groupAllowFrom, wrapped both shouldSkipDefaultEmptyGroupAllowlistWarning and extraWarningsForAccount hooks when all accounts override
  • What did NOT change (scope boundary):
    • DM-policy (dmPolicy: "allowlist") handling — the top-level DM warning is still emitted; only the group-allowlist false positive is addressed
    • Channel plugin custom skip hooks for account-level calls — the wrapped hooks delegate to the original for non-top-level calls
    • Any runtime message-delivery logic — this is a doctor advisory fix only
    • allowFrom-as-group-coverage accounting — the channel's groupAllowFromFallbackToAllowFrom heuristic is left to future work; the current fix is conservative and only suppresses when every account has an explicit groupAllowFrom list

Reproduction

  1. Configure a channel with groupPolicy: "allowlist", empty top-level groupAllowFrom, and two or more accounts each with a populated groupAllowFrom.
  2. Run openclaw doctor.
  3. Before this PR: doctor emits a top-level group-allowlist warning claiming group messages will be dropped, even though every account overrides the fallback and inbound group messages are processed normally.
  4. After this PR: the top-level group-allowlist warning is suppressed when all accounts supply their own groupAllowFrom; warnings still fire when no accounts exist or when some accounts lack groupAllowFrom (requiring fallback to the empty top-level).

Real behavior proof

Behavior or issue addressed (92684): doctor EmptyAllowlistCheck warns the top-level record as if it were an account when groupPolicy: "allowlist" and groupAllowFrom is empty, even though every sub-account defines its own groupAllowFrom. The fix suppresses that false positive on both the shared default warning path and the channel plugin extra-warning path, while preserving the warning when accounts genuinely lack a populated allowlist.

Real environment tested: Linux, Node 22 — direct scanner invocation loaded through the real createChannelDoctorEmptyAllowlistPolicyHooks framework (no mocks, not a Vitest test)

Exact steps or command run after this patch: node --import tsx scripts/direct-scanner-proof-92684.mjs

Evidence after fix:

=== Real scanner proof: #92684 (direct, non-test invocation) ===
Config: telegram groupPolicy=allowlist, top-level groupAllowFrom=[]
        work.groupAllowFrom=["@friend1"], personal.groupAllowFrom=["@friend2"]

Total warnings: 2
Top-level group false positives: 0
Result: ✅ No false positive — all accounts override groupAllowFrom

Regression (no accounts): top-level group warnings = 1 ✅ still warns

Observed result after fix: direct scanner invocation with the real doctor hooks framework confirms zero top-level group-allowlist false positives when both accounts supply their own groupAllowFrom. The two remaining warnings are account-level Telegram first-time-setup advisories (not false positives), and the regression check confirms the top-level warning still fires when no accounts exist to override it.

What was not tested: live openclaw doctor CLI invocation against a fully provisioned OpenClaw installation was not driven — the scanner is exercised directly through the real channel-doctor hooks framework rather than through the full CLI pipeline.

Repro confirmation: the direct scanner script fails on origin/main (emits 1 top-level group-allowlist false positive through the Telegram extra-warning path) and succeeds after the third patch commit (emits 0 top-level group false positives, gating both the shared and extra-warning paths).

Risk / Mitigation

  • Risk: the wrapped shouldSkipDefaultEmptyGroupAllowlistWarning and extraWarningsForAccount hooks are restored immediately after the top-level checkAccount call, but the function mutates params directly.
    Mitigation: original function references are saved before the wrap and unconditionally restored on the next line, so account-level checks always receive the original hooks.
  • Risk: a channel with a mix of accounts where some have groupAllowFrom and others do not could lose the top-level warning.
    Mitigation: the suppress condition requires every active sub-account to have a populated groupAllowFrom — a single account without it keeps both hook paths intact.
  • Risk: a channel that supports groupAllowFromFallbackToAllowFrom might have accounts whose allowFrom provides effective group coverage without an explicit groupAllowFrom.
    Mitigation: this is deferred to future work; the current fix is conservative — it only suppresses when every account has an explicit groupAllowFrom list, so no valid warning is lost.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • CLI / doctor commands
  • Commands (doctor shared)

Regression Test Plan

  • node scripts/run-vitest.mjs src/commands/doctor/shared/empty-allowlist-scan.test.ts
  • node scripts/run-vitest.mjs src/commands/doctor/shared/empty-allowlist-policy.test.ts
  • node scripts/run-vitest.mjs src/commands/doctor/shared/empty-allowlist-scan-92684.test.ts
  • node scripts/run-vitest.mjs src/commands/doctor/shared/preview-warnings.test.ts
  • node scripts/run-vitest.mjs src/commands/doctor/repair-sequencing.test.ts

Review Findings Addressed

  • [P2] Gate the Telegram extra-warning path — fixed in 7538369: extraWarningsForAccount is now wrapped alongside shouldSkipDefaultEmptyGroupAllowlistWarning, suppressing the top-level call when all accounts override. Confirmed by direct scanner proof (0 false positives vs 1 on main).
  • [P2] Count account allowFrom fallback coverage — deferred; the current fix is conservative (requires explicit groupAllowFrom on every account). Extending to allowFrom-as-group-coverage requires channel-specific groupAllowFromFallbackToAllowFrom awareness and is left to future work.

Linked Issue/PR

Fixes #92684

… override groupAllowFrom (fixes openclaw#92684)

When every active sub-account supplies its own groupAllowFrom, the
top-level empty groupAllowFrom is never consulted at runtime
(account.groupAllowFrom ?? parent.groupAllowFrom). Suppress the
default group-allowlist warning for the top-level record so doctor
does not over-warn about a fallback that no account ever reads.
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed June 15, 2026, 2:50 PM ET / 18:50 UTC.

Summary
The PR wraps doctor empty-allowlist top-level warning hooks when every active sub-account has a non-empty groupAllowFrom and adds focused regression tests.

PR surface: Source +30, Tests +87. Total +117 across 2 files.

Reproducibility: yes. Current main checks the top-level channel record before account records, and current policy/runtime show that account allowFrom can be effective group coverage for fallback channels.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/empty-allowlist-scan-92684.test.ts, unknown-data-model-change: src/commands/doctor/shared/empty-allowlist-scan-92684.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: 🦪 silver shellfish
Proof: 🐚 platinum hermit
Patch quality: 🦪 silver shellfish
Result: blocked by patch quality or review findings.

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

Rank-up moves:

  • Count account-level allowFrom as effective group coverage when channel capabilities allow fallback.
  • [P2] Add a regression test for the all-accounts-covered-via-allowFrom case, including the plugin extra-warning path.

Risk before merge

  • [P2] The PR still leaves the reported false-positive behavior for fallback channels where every active account is covered by account-level allowFrom instead of explicit groupAllowFrom.
  • [P1] Several open sibling PRs target the same linked doctor warning, so maintainers should choose one canonical scanner semantics before landing competing branches.

Maintainer options:

  1. Decide the mitigation before merge
    Land one canonical scanner fix that suppresses parent warnings only when every active account has an effective group allowlist, including allowFrom fallback where channel capabilities allow it.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] A narrow automated repair can update the account coverage predicate and add the missing fallback regression without changing product direction.

Security
Cleared: The diff is limited to doctor warning logic and focused tests, with no concrete security or supply-chain concern found.

Review findings

  • [P2] Count allowFrom fallback in account coverage — src/commands/doctor/shared/empty-allowlist-scan.ts:108
Review details

Best possible solution:

Land one canonical scanner fix that suppresses parent warnings only when every active account has an effective group allowlist, including allowFrom fallback where channel capabilities allow it.

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

Yes. Current main checks the top-level channel record before account records, and current policy/runtime show that account allowFrom can be effective group coverage for fallback channels.

Is this the best way to solve the issue?

No. The scanner is the right layer and the extra-warning hook is now covered, but the account coverage predicate still ignores the supported allowFrom fallback path.

Full review comments:

  • [P2] Count allowFrom fallback in account coverage — src/commands/doctor/shared/empty-allowlist-scan.ts:108
    For channels that support groupAllowFrom fallback to allowFrom, both the current warning helper and runtime treat account allowFrom as effective group coverage. This predicate only checks account.groupAllowFrom, so accounts covered via allowFrom still keep the parent false warning this PR claims to fix. Build the coverage check from each account's effective group allowlist and add a regression test for the fallback shape.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: The PR targets a misleading doctor advisory with working runtime routing and limited user impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes after-fix direct scanner output through the real channel-doctor hooks framework, showing the false top-level warning is gone for explicit per-account groupAllowFrom and the no-account warning still fires.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix direct scanner output through the real channel-doctor hooks framework, showing the false top-level warning is gone for explicit per-account groupAllowFrom and the no-account warning still fires.
Evidence reviewed

PR surface:

Source +30, Tests +87. Total +117 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 31 1 +30
Tests 1 87 0 +87
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 118 1 +117

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/empty-allowlist-policy.test.ts.
  • [P1] node scripts/run-vitest.mjs src/commands/doctor/shared/empty-allowlist-scan-92684.test.ts.
  • [P1] node scripts/run-vitest.mjs src/commands/doctor/shared/preview-warnings.test.ts.

What I checked:

Likely related people:

  • vincentkoc: GitHub history shows vincentkoc extracted the shared empty-allowlist scanner and warning helpers that define this doctor diagnostic boundary. (role: feature-history owner; confidence: high; commits: 5b31b3400ee1, 4e979ea6ca0d; files: src/commands/doctor/shared/empty-allowlist-scan.ts, src/commands/doctor/shared/empty-allowlist-policy.ts)
  • steipete: Recent history shows steipete documenting doctor warning helpers and owning channel allowlist fallback/security policy code that the doctor warning mirrors. (role: adjacent allowlist policy contributor; confidence: medium; commits: 7beeedbe73c6, 892a9c24b0f6, 8bdda7a651c2; files: src/commands/doctor/shared/empty-allowlist-scan.ts, src/channels/allow-from.ts, src/channels/message-access/allowlist.ts)
  • gumadeiras: Recent doctor routing work changed the channel-doctor hook path that supplies extraWarningsForAccount and skip hooks to this scanner. (role: recent doctor routing contributor; confidence: medium; commits: a197b544fec6; files: src/commands/doctor/shared/channel-doctor.ts, src/commands/doctor/shared/empty-allowlist-scan.ts, src/commands/doctor/shared/empty-allowlist-policy.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.

- Remove unnecessary type assertion (oxlint no-unnecessary-type-assertion)
- Fix groupAllowFrom entries to use string type (DoctorAllowFromEntry = string | number)
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 14, 2026
… override groupAllowFrom (fixes openclaw#92684)

ClawSweeper review finding [P2]: the Telegram extra-warning path was
not gated, so the channel plugin could still emit false positives even
after the shared default warning was suppressed. Wrap both hooks
together so the top-level scan is fully silent when every active
sub-account supplies its own groupAllowFrom.
@zenglingbiao

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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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: 🧂 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 14, 2026
@zenglingbiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. labels Jun 15, 2026
@zenglingbiao
zenglingbiao deleted the fix/issue-92684-doctor-group-allowlist-false-warning branch June 22, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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