Skip to content

refactor(line,mattermost): declare single-account config promotion keys - #112474

Closed
wangmiao0668000666 wants to merge 3 commits into
openclaw:mainfrom
wangmiao0668000666:pr-line-mattermost-config-promotion
Closed

wangmiao0668000666 wants to merge 3 commits into
openclaw:mainfrom
wangmiao0668000666:pr-line-mattermost-config-promotion

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Part 2 of #112238 follow-up. The line and mattermost channel plugins were missed in #112293, which moved hardcoded single-account promotion keys into per-channel plugin declarations. Both plugins have channel-specific config keys that need explicit declaration for single-account promotion but lacked singleAccountKeysToMove and setupFeatures.configPromotion in their package manifests.

Why This Change Was Made

  • Declares singleAccountKeysToMove on the line setup adapter (channelAccessToken, channelSecret, tokenFile, secretFile) and the mattermost setup adapter (botToken, baseUrl). defineChannelSetupContract forwards these declarations onto the published setupContract, so they stay visible after both channels moved from the legacy setup adapter to the owned setup contract.
  • Adds setupFeatures.configPromotion: true to both package.json files so doctor can read the declarations from the lightweight bundled setup artifact.
  • These channel-specific keys are not in the common promotion key set, so without explicit declaration they are invisible to the doctor migration path.
  • Doctor side (new): openclaw doctor processes never load the runtime plugin registry, so declarations from externally installed channel plugins were invisible and single-account promotion deferred forever on packaged installs (Mattermost ships outside the npm openclaw package). The doctor promotion path now composes the same read-only installed-plugin discovery the rest of doctor uses, with the bundled lookup as last-ditch fallback. Discovery resolves the promotion surface with the same setupContract ?? setup precedence the channel contract, the runtime registry lookup (setup-promotion-helpers.ts), and the bundled lookup (setup-promotion-bundled.ts) already use — so current plugins that publish only setupContract (as line and mattermost do on main) are seen correctly, and legacy setup-only plugins keep working. An installed plugin's setup surface is authoritative for its channel id — when it declares no promotion keys, promotion stays deferred (fail-closed) rather than borrowing bundled declarations the installed plugin did not sanction.

Follows the same pattern as the channels migrated in #112293 (slack, signal, irc, imessage, nextcloud-talk, tlon, whatsapp, zalo, telegram, matrix) and the follow-up #112367 (googlechat, zalouser).

User Impact

Single-account migration for line and mattermost channels now correctly identifies all account-scoped keys for promotion into accounts.default. Named-account configs won't risk flattening channel-root policy keys alongside account credentials. No runtime behavior, config shape, or credential handling changes.

Evidence

PR branch rebased onto current origin/main (d8a1ebbb492); exact-head proof below was run after the rebase on head d4652683b7e.

Packaged external-install Doctor proof (post-fix, packaged path, npm install semantics)

Built the npm tarball from this head (scripts/package-openclaw-for-docker.mjs; note dist/extensions/mattermost/** is excluded from the published package, so on real installs Mattermost only exists as an externally installed plugin), installed it into an isolated prefix with an isolated $OPENCLAW_HOME, built the Mattermost plugin npm runtime from this branch (scripts/check-plugin-npm-runtime-builds.mts --package extensions/mattermost) and installed it via openclaw plugins install npm-pack:<tarball> — real npm install semantics, so the plugin's runtime dependencies (zod, ws) resolve from its own package exactly like a registry install — then ran the packaged openclaw doctor --fix against a legacy config with leftover root keys plus an existing named account:

// $OPENCLAW_HOME/.openclaw/openclaw.json (before)
{
  channels: {
    mattermost: {
      enabled: true,
      botToken: "mm-<redacted>",
      baseUrl: "https://mattermost.example.com",
      dmPolicy: "pairing",
      accounts: {
        work: { botToken: "mm-<redacted>", baseUrl: "https://mattermost-work.example.com" },
      },
    },
  },
  plugins: { entries: { mattermost: { enabled: true } } },
}

Verified the installed plugin artifact actually carries the declaration before running doctor:

$ grep -rh 'singleAccountKeysToMove' $OPENCLAW_HOME/.openclaw/npm/projects/openclaw-mattermost-*/node_modules/@openclaw/mattermost/dist/*.js
	singleAccountKeysToMove: ["botToken", "baseUrl"],
$ openclaw doctor --fix
◇  Doctor changes ─────────────────────────────────────────────────╮
│                                                                  │
│  Moved channels.mattermost single-account top-level values into  │
│  channels.mattermost.accounts.default.                           │
│                                                                  │
├──────────────────────────────────────────────────────────────────╯
Updated config: $OPENCLAW_HOME/.openclaw/openclaw.json
// $OPENCLAW_HOME/.openclaw/openclaw.json (after — channels.mattermost)
{
  "enabled": true,
  "accounts": {
    "work": { "botToken": "mm-<redacted>", "baseUrl": "https://mattermost-work.example.com" },
    "default": {
      "botToken": "mm-<redacted>",
      "baseUrl": "https://mattermost.example.com",
      "dmPolicy": "pairing"
    }
  }
}

Root botToken/baseUrl/dmPolicy moved into accounts.default, the existing accounts.work is preserved, and enabled stays at root. This run exercises the exact packaged path the earlier review flagged — declarations discovered from the externally installed plugin through its published setupContract, not from bundled artifacts and not from the legacy setup field — and supersedes the older bundled-layout transcript below.

Real behavior proof (focused test execution on current head)

$ node scripts/run-vitest.mjs extensions/line/src/setup-surface.test.ts -t "config-promotion"
 ✓ |extension-line| line setup wizard > exposes config-promotion declarations on the setup adapter 702ms
 Test Files  1 passed (1)
      Tests  1 passed | 13 skipped (14)

$ node scripts/run-vitest.mjs extensions/mattermost/src/setup.test.ts -t "config-promotion"
 ✓ |extension-mattermost| mattermost setup > exposes config-promotion declarations on the setup adapter
 Test Files  1 passed (1)
      Tests  1 passed | 12 skipped (13)

Discovery precedence regression coverage (new)

src/channels/plugins/setup-promotion-discovery.test.ts covers the installed-plugin contract surface directly: a plugin publishing only setupContract resolves its declared keys; setupContract wins when both surfaces exist; the deprecated setup adapter still resolves when no contract exists; an installed surface with no declarations stays authoritative (fail-closed deferral); bundled fallback still covers channels with no installed setup entry. src/commands/doctor-legacy-config.migrations.test.ts exercises the full normalizer path with an externally installed plugin whose declaration arrives via setupContract (promote) and with an empty contract (defer).

Doctor migration proof (actual resolver with real setup adapters)

The PR's declarations are consumed by the real doctor single-account promotion resolver (src/channels/plugins/setup-promotion-helpers.ts). Running the resolver with representative legacy channel configs and the actual bundled setup adapters:

$ npx tsx proof-line-mattermost-promotion.ts

Line legacy root keys:
[
  "channelAccessToken",
  "channelSecret",
  "tokenFile",
  "secretFile",
  "enabled"
]

Line keys promoted to default account:
[
  "channelAccessToken",
  "channelSecret",
  "tokenFile",
  "secretFile"
]

Line shouldDeferPromotion:
false

Mattermost legacy root keys:
[
  "botToken",
  "baseUrl",
  "enabled"
]

Mattermost keys promoted to default account:
[
  "botToken",
  "baseUrl"
]

Mattermost shouldDeferPromotion:
false

---
Line promotion correct: true
Mattermost promotion correct: true
  • Line: all 4 declared account-scoped keys are promoted to accounts.default; channel-root policy keys like enabled remain at root; migration is not deferred.
  • Mattermost: both declared account-scoped keys are promoted to accounts.default; channel-root policy stays at root; migration is not deferred.

End-to-end Doctor migration proof (openclaw doctor --fix)

Installed Node 24.18.0 and ran the packaged Doctor migration against a representative legacy config with named accounts plus leftover single-account root keys:

// $OPENCLAW_HOME/.openclaw/openclaw.json (before)
{
  "agents": { "entries": { "main": { "default": true } } },
  "memory": { "search": { "enabled": false, "rememberAcrossConversations": false } },
  "channels": {
    "line": {
      "enabled": true,
      "channelAccessToken": "line-token",
      "channelSecret": "line-secret",
      "tokenFile": "/path/to/token",
      "secretFile": "/path/to/secret",
      "accounts": { "alerts": { "enabled": true } }
    },
    "mattermost": {
      "enabled": true,
      "botToken": "mm-token",
      "baseUrl": "https://mattermost.example.com",
      "accounts": { "alerts": { "enabled": true } }
    }
  }
}
$ openclaw doctor --fix --yes --non-interactive
...
◇  Doctor changes ──────────────────────────────────────────────────────╮
│                                                                       │
│  Moved channels.line single-account top-level values into             │
│  channels.line.accounts.default.                                      │
│  Moved channels.mattermost single-account top-level values into       │
│  channels.mattermost.accounts.default.                                │
│                                                                       │
├───────────────────────────────────────────────────────────────────────╯
...
└  Doctor complete.
// $OPENCLAW_HOME/.openclaw/openclaw.json (after — channels only)
{
  "channels": {
    "line": {
      "enabled": true,
      "accounts": {
        "alerts": { "enabled": true },
        "default": {
          "channelAccessToken": "line-token",
          "channelSecret": "line-secret",
          "tokenFile": "/path/to/token",
          "secretFile": "/path/to/secret"
        }
      }
    },
    "mattermost": {
      "enabled": true,
      "accounts": {
        "alerts": { "enabled": true },
        "default": {
          "botToken": "mm-token",
          "baseUrl": "https://mattermost.example.com"
        }
      }
    }
  }
}

This confirms the full packaged Doctor path: artifact discovery, resolver key selection, and persisted config write all preserve channel-root policy while moving only the declared account-scoped keys into accounts.default.

Declaration verification

// lineSetupAdapter.singleAccountKeysToMove:
["channelAccessToken", "channelSecret", "tokenFile", "secretFile"]

// mattermostSetupAdapter.singleAccountKeysToMove:
["botToken", "baseUrl"]

// line package.json setupFeatures: { "configPromotion": true }
// mattermost package.json setupFeatures: { "configPromotion": true }

The doctor migration resolver reads singleAccountKeysToMove from each channel's setup artifact surface during openclaw doctor --fix. Line declares 4 account-scoped keys; Mattermost declares 2. Both manifests enable configPromotion so the doctor migration can discover these declarations through the lightweight bundled setup artifact. defineChannelSetupContract forwards the adapter declarations onto lineSetupContract / mattermostSetupContract, which is the only setup surface these plugins publish on current main.

  • extensions/mattermost/src/setup.test.ts — declaration test passes (1 new, 14 passed).
  • extensions/line/src/setup-surface.test.ts — declaration test passes (1 new, 13 passed; 1 pre-existing wizard timeout failure unchanged).
  • oxfmt --check passed for all 4 changed source files.

Scope

@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line channel: mattermost Channel integration: mattermost size: XS labels Jul 22, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 22, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@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 Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 2:19 PM ET / 18:19 UTC.

ClawSweeper review

What this changes

This PR declares Line and Mattermost account-scoped legacy settings and makes Doctor discover that metadata from installed channel plugins during config migration.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 3 items remain

Keep open: the central Doctor migration gap remains on current main, but this branch now conflicts with a newer promotion-policy design and needs reconciliation before merge.

Priority: P1
Reviewed head: d4652683b7e575afe9f294cb58f2db557103cffd

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The branch has strong packaged-path proof and a coherent fix, but current merge conflicts leave its compatibility with the newer migration policy unresolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied exact-head terminal transcript exercises the changed Doctor owner through a packaged install with an externally installed Mattermost plugin, then observes promotion while preserving an existing named account and root enabled setting; it is strong branch proof, though not proof of the future merge head.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied exact-head terminal transcript exercises the changed Doctor owner through a packaged install with an externally installed Mattermost plugin, then observes promotion while preserving an existing named account and root enabled setting; it is strong branch proof, though not proof of the future merge head.
Evidence reviewed 5 items Current-main gap: Current main has neither the Line/Mattermost promotion declarations nor their manifest opt-in; uncovered credential keys therefore defer the legacy migration when named accounts exist.
Current-main migration behavior: Doctor passes a fallback promotion resolver into the shared helper, which defers migration for uncovered keys without a declared promotion surface.
Newer policy conflict: Current main’s resolver preserves root settings for owners declaring the newer preserve-root policy; the PR replaces that resolver shape, so a mechanical conflict resolution could discard current behavior.
Findings None None.
Security None None.

How this fits together

Doctor converts legacy channel-root settings into per-account configuration when named accounts already exist. It consumes lightweight plugin setup metadata to decide which settings move and which remain channel-wide.

flowchart LR
A[Legacy channel settings] --> B[Doctor migration]
B --> C[Plugin setup metadata]
C --> D[Promotion policy]
D --> E[Default account settings]
D --> F[Channel-root settings]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is merge-conflicted against current main; its older resolver would replace newer preserve-root handling unless the rebase intentionally retains it.
  • Resolve merge risk (P1) - This bug-fix branch adds production code (+80/-4) for migration discovery; the rebase should integrate the external-plugin path into the current resolver rather than retain parallel policy paths.
  • Resolve merge risk (P1) - No pinned test merge is available, so the supplied exact-head proof does not establish behavior of the eventual merge result.
Agent review details

Security

None.

PR surface

Source +70, Tests +246, Config +6. Total +322 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 5 74 4 +70
Tests 5 262 16 +246
Docs 0 0 0 0
Config 2 6 0 +6
Generated 0 0 0 0
Other 0 0 0 0
Total 12 342 20 +322

Review metrics

Metric Value Why it matters
Production vs test delta production +80/-4; tests +262/-16 The added external-plugin discovery path is material migration logic; its positive production growth needs integration into the current canonical resolver.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/legacy-config-core-normalizers.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #112474
Summary: This PR is the remaining Line/Mattermost follow-up to the merged channel promotion-key refactor.

Members:

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

Merge-risk options

Maintainer options:

  1. Reconcile the current Doctor policy before merge (recommended)
    Rebase the branch onto current main, preserve the current preserve-root behavior, and rerun the packaged Doctor migration against the resulting merge head.
  2. Pause this branch
    Keep it open without merging if the promotion-policy reconciliation cannot be established from the current owner contracts.

Technical review

Best possible solution:

Rebase onto current main, retain its preserve-root policy while adding the missing Line/Mattermost external-plugin metadata path, then prove the exact merge head preserves named accounts, root enabled settings, and declared-empty/deferred cases.

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

Yes—source-reproducible: current main lacks declarations for Line-specific credential keys and Mattermost baseUrl, and the shared migration helper defers uncovered keys when named accounts exist. I did not execute the untrusted branch.

Is this the best way to solve the issue?

No, not mergeable as-is: its owner-boundary approach is sound, but it must be rebased into the newer preserve-root promotion protocol rather than replace it.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Current Line and Mattermost configurations with named accounts can leave legacy credential settings stranded at channel root.
  • merge-risk: 🚨 compatibility: This changes upgrade-time config migration and currently conflicts with a newer policy that protects root-scoped settings.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied exact-head terminal transcript exercises the changed Doctor owner through a packaged install with an externally installed Mattermost plugin, then observes promotion while preserving an existing named account and root enabled setting; it is strong branch proof, though not proof of the future merge head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied exact-head terminal transcript exercises the changed Doctor owner through a packaged install with an externally installed Mattermost plugin, then observes promotion while preserving an existing named account and root enabled setting; it is strong branch proof, though not proof of the future merge head.

Evidence

What I checked:

  • Current-main gap: Current main has neither the Line/Mattermost promotion declarations nor their manifest opt-in; uncovered credential keys therefore defer the legacy migration when named accounts exist. (extensions/line/src/setup-core.ts:54, 01ea77ec3dae)
  • Current-main migration behavior: Doctor passes a fallback promotion resolver into the shared helper, which defers migration for uncovered keys without a declared promotion surface. (src/commands/doctor/shared/legacy-config-core-normalizers.ts:154, 01ea77ec3dae)
  • Newer policy conflict: Current main’s resolver preserves root settings for owners declaring the newer preserve-root policy; the PR replaces that resolver shape, so a mechanical conflict resolution could discard current behavior. (src/channels/plugins/setup-promotion-discovery.ts:15, 01ea77ec3dae)
  • Promotion architecture provenance: The merged channel-owned promotion-key architecture originates with the prior merged refactor; later commits introduced the preserve-root policy that this branch must retain. (e1d5d3dc16f0)
  • Branch proof and coverage: The supplied exact-head packaged Doctor transcript exercises an externally installed Mattermost plugin and reports preservation of the named account and root enabled setting; added tests cover contract precedence and defer behavior. (src/channels/plugins/setup-promotion-discovery.test.ts:28, d4652683b7e5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Eden: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase while preserving the current preserve-root behavior.
  • Post redacted packaged Doctor output from the exact merge head, covering Line, Mattermost, named accounts, and deferred/declared-empty behavior.

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 (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-04T05:06:09.922Z sha b91df4bccb71c06041fbcc21ba2f9732d7646117 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-12T06:26:08.482Z sha b91df4bccb71c06041fbcc21ba2f9732d7646117 :: needs real behavior proof before merge. :: [P1] Move Mattermost promotion into its external Doctor path
  • reviewed 2026-08-14T07:09:04.216Z sha 013ef294cf16a4e359159534e4acce39d9ccb143 :: found issues before merge. :: [P1] Read the preferred setup contract from discovered plugins
  • reviewed 2026-08-14T08:39:41.925Z sha d465268 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T09:26:05.041Z sha d465268 :: needs maintainer review before merge. :: none
  • reviewed August 15, 2026, 8:55 AM ET / 12:55 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed August 18, 2026, 8:10 PM ET / August 19, 2026, 00:10 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T00:51:56.346Z sha d465268 :: needs maintainer review before merge. :: none

@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-line-mattermost-config-promotion branch from 8c6a294 to d1ee2f0 Compare July 27, 2026 01:57
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Rebased onto latest origin/main and added real behavior proof (focused test execution with terminal output showing declarations and manifest verification). @clawsweeper re-review

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-line-mattermost-config-promotion branch from d1ee2f0 to fd948bd Compare July 29, 2026 15:35
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

  • Added real doctor-migration proof: ran the actual resolveSingleAccountPromotion resolver from src/channels/plugins/setup-promotion-helpers.ts with the real bundled lineSetupAdapter and mattermostSetupAdapter plus representative legacy configs.
  • Output confirms Line promotes the 4 declared account-scoped keys to accounts.default without deferral, and Mattermost promotes the 2 declared account-scoped keys to accounts.default without deferral. Channel-root policy keys (enabled) remain at root.
  • Updated PR body with the migration transcript.

Head: fd948bd057.

@clawsweeper

clawsweeper Bot commented Jul 29, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed 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. labels Jul 29, 2026
@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-line-mattermost-config-promotion branch from fd948bd to b91df4b Compare July 30, 2026 01:15
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 30, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 3, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 12, 2026
@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. labels Aug 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M and removed size: XS labels Aug 14, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the packaged-path P1:

  • Doctor single-account promotion now discovers declarations from externally installed channel plugins via the same read-only installed-plugin resolution the rest of doctor uses, with the bundled lookup as last-ditch fallback (src/channels/plugins/setup-promotion-discovery.ts). An installed plugin surface stays authoritative for its channel id; undeclared surfaces keep deferring (fail-closed).
  • Added the requested packaged proof: built the npm tarball from this head, installed it into an isolated prefix + isolated $OPENCLAW_HOME, installed the Mattermost plugin built from this branch (the npm package excludes dist/extensions/mattermost/**, so this is the real external-plugin path), and ran packaged openclaw doctor --fix. Root botToken/baseUrl/dmPolicy moved into channels.mattermost.accounts.default, existing accounts.work preserved, enabled kept at root. Redacted transcript in the PR body ("Packaged external-install Doctor proof").
  • Also pinned OPENCLAW_LOCALE=en in the line/mattermost setup tests (test-only) so wizard prompt assertions are locale-independent.

Head: 013ef294cf1.

@clawsweeper

clawsweeper Bot commented Aug 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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 Aug 14, 2026
wangmiao0668000666 and others added 3 commits August 14, 2026 15:52
Declare singleAccountKeysToMove on both channel setup adapters and add
configPromotion setupFeature to their package manifests, completing the
per-channel migration started in openclaw#112293.

Co-Authored-By: Claude <[email protected]>
…alled channel plugins

Doctor single-account promotion consulted only bundled setup surfaces, so
external channel plugins (Mattermost, imessage) deferred promotion forever
on packaged installs. Compose the same read-only installed-plugin discovery
doctor already uses with the bundled lookup as last-ditch fallback.

Refs openclaw#112474.
Wizard copy is localized at module evaluation time, so prompt assertions
failed on machines with a zh locale. Pin OPENCLAW_LOCALE=en via vi.hoisted
(before imports) and restore afterwards.
@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-line-mattermost-config-promotion branch from 013ef29 to d465268 Compare August 14, 2026 08:31
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the setupContract P1 on a rebased branch:

  • Rebased onto current main (d8a1ebbb492); the conflict is resolved. The promotion declarations now live on the setup adapters that defineChannelSetupContract forwards onto lineSetupContract/mattermostSetupContract — the only setup surface these plugins publish on current main.
  • Doctor discovery now resolves the promotion surface with setupContract ?? setup (src/channels/plugins/setup-promotion-discovery.ts), the same precedence as the existing runtime registry lookup (setup-promotion-helpers.ts) and the bundled lookup (setup-promotion-bundled.ts). Current contract-only plugins are seen; legacy setup-only plugins keep working.
  • New regression coverage: discovery tests for contract-only resolution, contract-over-adapter precedence, and legacy-adapter fallback; doctor migration tests now drive the external installed-plugin path through setupContract (promote + defer branches). setup-promotion-discovery.test.ts 8/8, setup-promotion-helpers.test.ts 17/17, doctor-legacy-config.migrations.test.ts 79/79, line/mattermost setup suites green.
  • Reran the packaged proof on this exact head, this time through real npm install semantics: built the openclaw tarball from this head, isolated prefix + isolated $OPENCLAW_HOME, built the Mattermost npm runtime from this branch, installed via plugins install npm-pack:<tarball> (deps zod/ws resolve from the plugin package like a registry install), verified the installed artifact carries singleAccountKeysToMove: ["botToken", "baseUrl"], then packaged openclaw doctor --fix moved root botToken/baseUrl/dmPolicy into accounts.default, preserved accounts.work, kept enabled at root. Redacted transcript in the PR body.

Head: d4652683b7e.

@clawsweeper

clawsweeper Bot commented Aug 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed 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 Aug 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 1, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Closing this in favor of the declarations-only slice: #136045.

Why: since this branch was written, main landed the preserve-root promotion protocol (#132226, #133948) and src/channels/plugins/setup-promotion-discovery.ts in an evolved form. The last ClawSweeper review (2026-09-01) confirmed the underlying gap is still real on main but judged this PR not mergeable as-is — a mechanical rebase would replace the newer preserve-root resolver shape. Rather than rebasing the whole branch, the uncontroversial part (the line/mattermost singleAccountKeysToMove declarations + setupFeatures.configPromotion opt-in, zero core changes) now lives in #136045 with fresh before/after openclaw doctor --fix proof on current main.

What remains unique to this PR: doctor reading promotion declarations from externally installed channel plugins (npm packaged installs, where line/mattermost — like the external channels declared in #112293 — ship outside the openclaw package and the bundled lookup cannot see their declarations). If that discovery path is still wanted, it needs a fresh implementation on top of the current preserve-root protocol; this branch is preserved for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: line Channel integration: line channel: mattermost Channel integration: mattermost commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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.

1 participant