#17289: test(line): add DM policy matrix coverage for open/allowlist/pairing/disabled
stale
size: S
Cluster:
Tool and Plugin Enhancements
## Problem
LINE DM policy behavior lacked matrix-style coverage across `open`, `allowlist`, `pairing`, and `disabled` paths.
## What changed
- Added targeted DM policy matrix tests to `/Users/davidahmann/Projects/agent-ecosystem/openclaw/src/line/bot-handlers.test.ts`.
- Covered deterministic allow/block behavior for:
- `disabled`
- `open`
- `allowlist` (allowed + blocked senders)
- `pairing` (blocked + pairing request path)
## Validation
- `pnpm test src/line/bot-handlers.test.ts` (pass)
Fixes #17285
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added comprehensive matrix-style test coverage for LINE direct message policy enforcement across all four policy modes (`disabled`, `open`, `allowlist`, `pairing`).
- Verified `disabled` policy blocks all DMs and prevents message processing
- Confirmed `open` policy allows all DMs through
- Validated `allowlist` policy correctly discriminates between allowed and blocked senders
- Ensured `pairing` policy blocks messages but triggers pairing request flow
Tests follow existing patterns in the file with proper mocking, clear event structures, and deterministic assertions. The coverage addresses the gap identified in issue #17285.
<h3>Confidence Score: 5/5</h3>
- Safe to merge with no issues found
- Pure test addition that follows established patterns, provides valuable coverage for DM policy enforcement logic, and validates all four policy modes deterministically. No changes to production code, proper mocking structure, and clear assertions.
- No files require special attention
<sub>Last reviewed commit: bf1146e</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14249: slack: add DM policy matrix regressions (open/allowlist/pairing/dis...
by davidahmann · 2026-02-11
83.9%
#22636: fix(whatsapp): skip pairing store merge when dmPolicy is allowlist (#…
by anillBhoi · 2026-02-21
71.9%
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
70.7%
#6567: fix: include paired users in WhatsApp group sender allowlist
by giannisanni · 2026-02-01
70.6%
#23582: fix(tool-policy): add group:fs and group:runtime to group:openclaw
by arosstale · 2026-02-22
70.4%
#17513: fix(discord): respect groupPolicy in channel config fallback (#4555)
by aronchick · 2026-02-15
70.4%
#14789: fix: per-account dmPolicy ignored in checkInboundAccessControl
by croll83 · 2026-02-12
70.3%
#20496: test(utils): add comprehensive unit tests for utility functions
by masifislamm · 2026-02-19
69.9%
#16064: feat: add contact-based tool permissions with verification
by jamiequint · 2026-02-14
69.4%
#22611: fix(discord): allow messages from other instance bots in multi-acco...
by dae-sun · 2026-02-21
69.3%