Skip to content

fix(line): keep doctor from granting unintended group access - #147135

Merged
obviyus merged 8 commits into
mainfrom
bugloop/line-doctor-group-allowlist
Sep 13, 2026
Merged

obviyus merged 8 commits into
mainfrom
bugloop/line-doctor-group-allowlist

Conversation

@obviyus

@obviyus obviyus commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Doctor silently copies LINE direct-message permissions into group access when an operator runs doctor --fix with no group allowlist.

Scope and existing permissions

Validation status

  • The retained main reproduction shows doctor --fix adding the DM-only sender to group access.
  • Candidate CLI evidence shows the key remains absent, repeated repair preserves that result, and an existing group list remains unchanged.
  • All six committed CLI cases pass for permission separation, normalized-empty sender entries, shadowed group/room aliases, and reference-backed lists. References now receive checking guidance without false working or blocked claims; saved permissions remain unchanged.
  • Fresh merge 2af5aed7630e584ef8533d60bbb339b188e385b9, with candidate parent 88496f01eb4541446bb9d2599f1ce06a1843d6d6 and main parent 3d8e779759a8a9ae952466e4b542b5fb69917ef5, passed 1,093 tests: 1,039 LINE, 48 Doctor discovery/migration/shared-warning, and six CLI cases.
  • The final commit only moves the unchanged CLI regression to test/e2e. Both routing regressions and all six CLI cases pass at the new path. CI run 34767626917 is green at e5235e0fa5b7243903e708ba36a21b9d41e68e03.
  • The generated channel catalog matches its owner script's output.
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run test/e2e/line-doctor-group-allowlist.built-cli.e2e.test.ts
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run test/scripts/test-projects.test.ts -t 'chunks.*broad shell helper'

Consumers

Doctor’s metadata resolver, fallback repair, and warning scanner consume the LINE declaration and adapter. LINE admission, explicit allowlist editing, directory reads, and account inheritance keep their existing contracts. Metadata uses its existing process and refresh lifecycle.

Limits

  • Empty wildcard overrides over a nonempty groupAllowFrom and per-group empty lists under groupPolicy: "open" remain outside this change.
  • The evidence covers Doctor configuration and warning behavior. It does not claim a live LINE message round trip.

edenfunf and others added 6 commits September 13, 2026 20:37
…verage

The warning adapter read raw group entries, so it missed two shapes the
runtime honors: a group whose own empty allowFrom overrides the defaults
entry and the channel-wide list, and a group disabled through the defaults
entry. Merge the defaults node the way admission does, and point the
operator at the remedy that actually applies to each case.

(cherry picked from commit c1b93d6)
An empty list inherited from the defaults entry or the channel-wide list was
reported as the group's own override, so the remedy pointed at a key the group
does not have. Resolve the allowlist together with its source and address the
warning to the key that actually supplies it.

(cherry picked from commit e212e33)
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line scripts Repository scripts commands Command implementations size: L maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 12:14 PM ET / 16:14 UTC (Revision 3).

ClawSweeper review

What this changes

The PR prevents Doctor from copying LINE direct-message permissions into group permissions and adds group-specific warnings and CLI regression coverage.

Merge readiness

✅ Ready for maintainer review

The defect remains on current main, and this PR is a supported fix with no blocking findings. The linked published-driver evidence addresses the previous upgrade-proof concern.

Priority: P0
Reviewed head: e5235e0fa5b7243903e708ba36a21b9d41e68e03

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused correction with relevant CLI and upgrade evidence, meaningful regression coverage, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Supplied isolated built-CLI observations exercise Doctor’s actual configuration-write boundary: DM-only senders remain absent from group permissions, existing lists survive repair, and reference-backed permissions receive checking guidance. The linked published-driver transcript covers upgrade preservation; the latest head only relocates the test.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Supplied isolated built-CLI observations exercise Doctor’s actual configuration-write boundary: DM-only senders remain absent from group permissions, existing lists survive repair, and reference-backed permissions receive checking guidance. The linked published-driver transcript covers upgrade preservation; the latest head only relocates the test.
Evidence reviewed 8 items Current main still lacks the correction: The fetched main manifest has no doctorCapabilities declaration. Doctor defaults groupAllowFromFallbackToAllowFrom to true, whereas LINE’s incoming-message policy explicitly sets it false.
Existing permission contract and repair boundary: LINE documentation separates DM and group senders. The existing migration skips the entire channel, including accounts, when fallback is false; the PR supplies that value without changing runtime admission or adding another configuration writer.
Release check: The v2026.9.4 manifest also lacks LINE’s Doctor capability declaration; the related report supplies a reproduction against the published 2026.9.4 CLI.
Findings None None.
Security None None.

How this fits together

Doctor reads channel metadata to decide which configuration repairs are safe. LINE’s metadata and warning adapter connect those repairs to the permissions its incoming-message handler actually enforces.

flowchart TD
  A[Operator configuration] --> B[Doctor]
  C[LINE capability metadata] --> B
  B --> D[Skip DM permission promotion]
  A --> E[LINE group warning adapter]
  E --> F[Actionable permission warnings]
  D --> G[Preserved group permissions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +199, Tests +396, Config +6, Other 0. Total +601 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 199 0 +199
Tests 3 396 0 +396
Docs 0 0 0 0
Config 1 6 0 +6
Generated 0 0 0 0
Other 1 1 1 0
Total 7 602 1 +601

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/line/src/channel.ts, migration/backfill/repair: extensions/line/src/doctor.ts, unknown-data-model-change: extensions/line/src/doctor.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #146169
Summary: This PR carries a candidate fix for the reported LINE Doctor permission mismatch and incorporates the earlier contribution.

Members:

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

Technical review

Best possible solution:

Keep Doctor aligned with LINE’s existing permission contract, preserving explicit group lists and explaining unresolved group access without granting it.

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

Yes: current source shows that doctor --fix can promote a LINE DM-only allowlist into groupAllowFrom, and supplied CLI observations demonstrate that path; this review did not execute it.

Is this the best way to solve the issue?

Yes: declaring the existing contract through Doctor’s established metadata path avoids a competing repair mechanism, and the supplied fresh-config and upgrade observations support preservation of existing settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4b47d65d295a.

Labels

Label justifications:

  • P0: The existing Doctor repair silently grants group access to DM-only senders, crossing an established authorization boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Supplied isolated built-CLI observations exercise Doctor’s actual configuration-write boundary: DM-only senders remain absent from group permissions, existing lists survive repair, and reference-backed permissions receive checking guidance. The linked published-driver transcript covers upgrade preservation; the latest head only relocates the test.
  • proof: sufficient: Contributor real behavior proof is sufficient. Supplied isolated built-CLI observations exercise Doctor’s actual configuration-write boundary: DM-only senders remain absent from group permissions, existing lists survive repair, and reference-backed permissions receive checking guidance. The linked published-driver transcript covers upgrade preservation; the latest head only relocates the test.

Evidence

What I checked:

  • Current main still lacks the correction: The fetched main manifest has no doctorCapabilities declaration. Doctor defaults groupAllowFromFallbackToAllowFrom to true, whereas LINE’s incoming-message policy explicitly sets it false. (extensions/line/package.json:54, 4b47d65d295a)
  • Existing permission contract and repair boundary: LINE documentation separates DM and group senders. The existing migration skips the entire channel, including accounts, when fallback is false; the PR supplies that value without changing runtime admission or adding another configuration writer. (src/commands/doctor/shared/allowfrom-fallback-migration.ts:174, e5235e0fa5b7)
  • Release check: The v2026.9.4 manifest also lacks LINE’s Doctor capability declaration; the related report supplies a reproduction against the published 2026.9.4 CLI. (extensions/line/package.json:54, 3a9d69db306c)
  • Real CLI and upgrade evidence: The captured PR body reports actual isolated doctor --fix runs preserving absent and existing group lists, plus corrected reference-backed warning output at 88496f0. The linked fix(line): declare the group allowlist contract to Doctor #146171 supplies a published-2026.9.4 → candidate transcript preserving published-produced groupAllowFrom and a fresh-config control. Its manifest correction matches this PR. These are configuration-write and diagnostic observations, not merely unit-test totals. (e212e33bf68e)
  • Re-review continuity: The only change since the previous reviewed head is a byte-identical move of the built-CLI regression from test/scripts to test/e2e. Production behavior and the prior CLI evidence remain applicable. The previous review retained no code findings. (test/e2e/line-doctor-group-allowlist.built-cli.e2e.test.ts:1, e5235e0fa5b7)
  • Behavioral context is unchanged: The fetched main and reviewed head have identical LINE admission, Doctor capability lookup, and fallback-migration modules. The new adapter reuses LINE’s group lookup and normalization helpers; access-group references receive explicitly uncertain guidance. (extensions/line/src/doctor.ts:29, e5235e0fa5b7)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-13T15:24:54.294Z sha da065b2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T15:55:18.314Z sha 88496f0 :: blocked before merge. :: none

@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 147135
head: 88496f0
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 13, 2026 15:45
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 147135
head: e5235e0
scope: owner-review

@obviyus
obviyus merged commit b076a15 into main Sep 13, 2026
192 checks passed
@obviyus
obviyus deleted the bugloop/line-doctor-group-allowlist branch September 13, 2026 16:35
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @edenfunf!

Proof: doctor --fix keeps LINE direct-message and group permissions separate; the CLI cases and 1,093 selected tests pass.

  • Bug: Doctor copied direct-message senders into group access without an explicit group grant.
  • Fix: LINE declares its separate group policy, and Doctor checks effective group lists without claiming reference-backed permissions work.
Before After
Routine repair granted group access to direct-message-only senders. Repair preserves group permissions and reports missing or unchecked sender lists.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…w#147135)

## What Problem This Solves

Doctor silently copies LINE direct-message permissions into group access when an operator runs `doctor --fix` with no group allowlist.

## Scope and existing permissions

- Doctor no longer creates a LINE group allowlist from the direct-message allowlist.
- Existing `groupAllowFrom` values remain unchanged. Doctor cannot tell whether an earlier value was copied by maintenance or deliberately configured by the operator.
- The capability flag uses the existing plugin manifest contract. This change adds no configuration key, schema, migration, protocol, or SDK contract.
- Supersedes openclaw#146171 by @edenfunf and preserves the contributor's three commits and authorship. The original report is openclaw#146169.

## Validation status

- The retained main reproduction shows `doctor --fix` adding the DM-only sender to group access.
- Candidate CLI evidence shows the key remains absent, repeated repair preserves that result, and an existing group list remains unchanged.
- All six committed CLI cases pass for permission separation, normalized-empty sender entries, shadowed group/room aliases, and reference-backed lists. References now receive checking guidance without false working or blocked claims; saved permissions remain unchanged.
- Fresh merge `2af5aed7630e584ef8533d60bbb339b188e385b9`, with candidate parent `88496f01eb4541446bb9d2599f1ce06a1843d6d6` and main parent `8f69e537857fb19d2e15fc3d937ba48cc625b732`, passed 1,093 tests: 1,039 LINE, 48 Doctor discovery/migration/shared-warning, and six CLI cases.
- The final commit only moves the unchanged CLI regression to `test/e2e`. Both routing regressions and all six CLI cases pass at the new path. CI run [34767626917](https://github.com/openclaw/openclaw/actions/runs/34767626917) is green at `e5235e0fa5b7243903e708ba36a21b9d41e68e03`.
- The generated channel catalog matches its owner script's output.

```sh
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run test/e2e/line-doctor-group-allowlist.built-cli.e2e.test.ts
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run test/scripts/test-projects.test.ts -t 'chunks.*broad shell helper'
```

## Consumers

Doctor’s metadata resolver, fallback repair, and warning scanner consume the LINE declaration and adapter. LINE admission, explicit allowlist editing, directory reads, and account inheritance keep their existing contracts. Metadata uses its existing process and refresh lifecycle.

## Limits

- Empty wildcard overrides over a nonempty `groupAllowFrom` and per-group empty lists under `groupPolicy: "open"` remain outside this change.
- The evidence covers Doctor configuration and warning behavior. It does not claim a live LINE message round trip.

Co-authored-by: xuyuanhao <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: line Channel integration: line commands Command implementations maintainer Maintainer-authored PR P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants