Skip to content

fix(doctor): restore LINE and Mattermost account promotion - #136045

Merged
obviyus merged 5 commits into
openclaw:mainfrom
wangmiao0668000666:fix/line-mattermost-promotion-keys
Sep 6, 2026
Merged

obviyus merged 5 commits into
openclaw:mainfrom
wangmiao0668000666:fix/line-mattermost-promotion-keys

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #136854.

What Problem This Solves

Fixes an issue where operators running openclaw doctor --fix with named LINE or Mattermost accounts would leave legacy credentials stranded at the channel root. Ordinary installed plugins could not supply their promotion declarations to Doctor.

Why This Change Was Made

LINE and Mattermost now declare their account credential keys, and Doctor reads those declarations through the same validated setup-entry loader for bundled and installed plugins. Credential-only promotion preserves channel-wide policy.

Doctor also keeps the complete plugin inventory when initializing its registry. Migration planning discovers complete ownership from canonical install records, so an existing partial index cannot cause a later Doctor run to refuse its own migration plan.

User Impact

Doctor moves supported credentials into accounts.default once, preserves named accounts and existing default-account conflicts, and retains root policy and disabled settings. Existing partial plugin indexes recover through the normal Doctor refresh.

Evidence

  • Before: the real CLI completed twice in full-build and official npm-installed layouts while leaving LINE and Mattermost credentials at root. The executed main artifact was d8922d310b00; affected promotion behavior was checked through main 3d602cd4172f.
  • After: compiled candidate 515a6024e90a passes the same full-build and ordinary npm-installed cases. The installed candidate packages were packed from actual compiled plugin output and installed through normal npm-spec commands in an isolated fixture registry.
  • Independent behavior validation: 50 successful Doctor commands across 25 valid scenarios, including varied accounts and URLs, default conflicts, missing/empty accounts, disabled plugins, root policy, Telegram promotion, and Buzz root preservation. Every repeat config is byte-identical; captured output and private logs contain no synthetic credential values.
  • Recovery: a retained 65-record partial index becomes a complete 149-record inventory; two subsequent Doctor calls finish and preserve the repeated config.
  • Source review covers the complete repair and regression tests. The final follow-up removes one stale size-baseline entry and does not change the exercised runtime. Exact-head baseline checks pass for that cleanup.

The proof covers Doctor configuration behavior. It does not claim live channel sends or publication of the candidate plugin packages. Rejected setup fixtures and all earlier failed attempts are retained with the complete private evidence.

Declare singleAccountKeysToMove on the line and mattermost setup
adapters and opt both channels into setupFeatures.configPromotion, so
the doctor single-account promotion resolver can see their
channel-specific account keys (line: channelAccessToken, channelSecret,
tokenFile, secretFile; mattermost: botToken, baseUrl). Without
declarations the resolver treats these as uncovered root keys and
defers the legacy migration whenever a named account exists, leaving
credentials stranded at the channel root. Follows the channel-owned
declaration pattern from openclaw#112293.

Co-Authored-By: Claude <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line channel: mattermost Channel integration: mattermost size: S labels Sep 2, 2026
@wangmiao0668000666
wangmiao0668000666 marked this pull request as ready for review September 2, 2026 06:24
@clawsweeper

clawsweeper Bot commented Sep 2, 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.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 6, 2026, 4:43 PM ET / 20:43 UTC.

ClawSweeper review

What this changes

Restores Doctor’s LINE and Mattermost credential promotion, discovers installed plugins’ existing setup declarations, and preserves complete plugin migration inventories.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix: current main and the latest release lack the required declarations. The updated branch addresses installed-plugin discovery and the earlier TypeBox concern, with recorded Doctor behavior evidence and no identified blocking defect.

Priority: P2
Reviewed head: e8827da6c595bfbbba4a397d078254374f36e028

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant recorded CLI observations and meaningful regression coverage; no blocking defect was found.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured PR body records after-fix Doctor runs through compiled and npm-installed setups, observing credential promotion, preserved policy and conflicts, stable repeats, and partial-index recovery; the subsequent head change is baseline-only.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured PR body records after-fix Doctor runs through compiled and npm-installed setups, observing credential promotion, preserved policy and conflicts, stable repeats, and partial-index recovery; the subsequent head change is baseline-only.
Evidence reviewed 11 items Current main still lacks installed declaration lookup: Current main resolves ordinary promotion declarations through the bundled setup lookup; installed manifests are consulted only for preserve-root.
Latest release remains affected: The inspected v2026.9.2 LINE setup adapter lacks singleAccountKeysToMove and namedAccountPromotionKeys; the released Mattermost adapter also lacks them.
Promotion preserves existing account policy: The existing normalizer skips existing default accounts, defers uncovered undeclared keys, clones promoted values, and preserves named accounts. The added credential-only named-account declarations use that existing boundary.
Findings None None.
Security None None.

How this fits together

Doctor repairs saved OpenClaw configuration and installation state. It reads plugin-owned migration declarations, moves eligible legacy credentials into account configuration, and preserves the inventory needed for subsequent repairs.

flowchart TD
  A[Saved channel configuration] --> C[Doctor repair]
  B[Plugin manifests and install records] --> D[Setup declarations and migration inventory]
  D --> C
  C --> E{Eligible account promotion}
  E --> F[Credentials in default account]
  E --> G[Preserved policy and existing accounts]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -131, Tests +189, Docs 0, Config +6, Other -1. Total +63 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 9 164 295 -131
Tests 5 271 82 +189
Docs 1 1 1 0
Config 2 6 0 +6
Generated 0 0 0 0
Other 1 0 1 -1
Total 18 442 379 +63

Review metrics

Metric Value Why it matters
Recorded Doctor coverage 25 scenarios, 50 successful commands The submitted real CLI observations cover repeatability, account conflicts, disabled plugins, root policy, and partial-index recovery.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/plugin-registry-migration.ts, migration/backfill/repair: src/plugins/doctor-contract-registry.ts, unknown-data-model-change: src/commands/doctor/shared/plugin-registry-migration.ts, unknown-data-model-change: src/plugins/doctor-contract-registry.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #136854
Summary: This PR is the active candidate fix for the same author’s open account-promotion issue.

Members:

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

Technical review

Best possible solution:

Keep credential ownership in plugin declarations and let Doctor apply them through one validated discovery path while retaining complete migration inventory and existing account policy.

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

Yes: named accounts plus undeclared root credentials reach Doctor’s uncovered-key deferral on current main. Source establishes that path; this review did not execute it.

Is this the best way to solve the issue?

Yes: the branch reuses the existing setup contract and validated loader, and removes the inventory projection responsible for incomplete migration ownership.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs a bounded Doctor migration failure affecting legacy LINE and Mattermost account configurations.
  • 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 (live_output): The captured PR body records after-fix Doctor runs through compiled and npm-installed setups, observing credential promotion, preserved policy and conflicts, stable repeats, and partial-index recovery; the subsequent head change is baseline-only.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body records after-fix Doctor runs through compiled and npm-installed setups, observing credential promotion, preserved policy and conflicts, stable repeats, and partial-index recovery; the subsequent head change is baseline-only.

Evidence

What I checked:

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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-02T06:32:41.001Z sha 919af7f :: needs changes before merge. :: [P1] Resolve declarations from installed Mattermost plugins
  • reviewed 2026-09-03T02:54:58.756Z sha 919af7f :: blocked before merge. :: none

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Evidence that the P1 describes a pre-existing discovery-layer gap, not a patch-scope defect — this PR's shape is identical to the 11 precedents merged in #112293:

  • Same declaration shape: setupFeatures.configPromotion: true in package.json + singleAccountKeysToMove in the setup contract, e.g. signal (extensions/signal/package.json, extensions/signal/src/setup-core.ts:391) — merged for signal, slack, irc, matrix, tlon, twitch, whatsapp, zalo, imessage, nextcloud-talk, clickclack.
  • Same installed-layout limitation: all 11 sit in the same npm exclusion list (!dist/extensions/<id>/**) and none carries a setupFeatures entry in official-external-channel-catalog.json, so their ordinary declarations are equally invisible to installed-plugin discovery and Doctor equally defers there. Main's only installed-path consumer is QQBot preserve-root (fix(doctor): preserve QQBot multi-account configuration #133948); setup-promotion-discovery.ts:25 reads installed manifests exclusively for === "preserve-root".

Extending installed discovery to ordinary declarations is a core change to the same owner where preserve-root just landed — noted as follow-up when #112474 closed. This slice makes line/mattermost consistent with the merged precedent set, with packaged doctor --fix before/after proof in the body.

Maintainer call: land the precedent-consistent declarations now, or hold for a combined declarations+discovery change.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 3, 2026
@obviyus obviyus self-assigned this Sep 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations labels Sep 6, 2026
@obviyus obviyus changed the title fix(line,mattermost): declare single-account config promotion keys fix(doctor): restore LINE and Mattermost account promotion Sep 6, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 6, 2026
@obviyus
obviyus merged commit 8008469 into openclaw:main Sep 6, 2026
406 of 410 checks passed
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks @wangmiao0668000666!

Proof: Real openclaw doctor --fix runs now promote LINE and Mattermost credentials in full-build and ordinary npm-installed layouts. Independent acceptance passed 50 Doctor calls across 25 scenarios; repeat configs remained unchanged.

  • Bug: Legacy root credentials stayed stranded when named accounts existed. An incomplete plugin inventory could also block a later Doctor run.
  • Fix: Plugin-owned credential declarations use shared validated discovery. Doctor preserves complete inventories and recovers existing partial indexes while retaining migration guards.
Before After
Root credentials remain outside the default account Credentials move once; named accounts, existing defaults, root policy, and disabled settings remain intact
A partial inventory causes a repeated repair to fail Normal Doctor refresh restores the inventory; repeated repairs complete

Exact-head CI passed. Independent code review found no blocking issue. The proof covers configuration repair; no live channel sends or package publication are claimed.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
…ig-ref

* origin/main: (31 commits)
  docs(web): split the Control UI page into task pages (#140437)
  fix: tool_search rejects calls that send both query and queries (#140310)
  fix(update): preserve rollback and truthful serving reports (#140419)
  fix: restore context when CLI recovery starts a fresh session (#140294)
  refactor(tests): retain transport-driven auth dismissal coverage (#140430)
  fix: stop unfinished subagents before resetting a conversation (#140417)
  fix(models): cap configured output at the final context window (#140436)
  refactor(mcp): reuse transport config normalization (#140439)
  test(gateway): preserve saved config in auth reload fixture (#140433)
  fix(plugins): inherit active config for embedded agent runs (#140435)
  refactor(tui): remove test-only shutdown timer hooks (#140432)
  fix(agents): preserve channel silent-reply guidance (#138345)
  fix(tasks): cancel resumed yielded subagent tasks (#140410)
  refactor(doctor): share compaction config traversal (#140330)
  fix(doctor): restore LINE and Mattermost account promotion (#136045)
  docs: remove the empty release-sections nav group (#140427)
  fix(tooling): omit Codex machine squash credit (#140420)
  chore(ui): refresh control ui locales (#140384)
  refactor(plugin-sdk): reuse native approval input contracts (#140415)
  fix: silent model WebSocket streams hang past the idle timeout (#140335)
  ...

# Conflicts:
#	docs/web/control-ui.md
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for the thorough merge writeup and for landing this!

Really appreciate the before/after breakdown — calling out the partial-inventory failure mode alongside the credential-promotion fix made the scope of the repair much clearer. Also glad the precedent-consistent shape landed cleanly; the installed-discovery follow-up is now properly scoped for the owner that already owns preserve-root.

Picking up the installed-path extension as a follow-up to keep line/mattermost discoverable through the same channel as the 11 merged precedents.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…136045)

Restore credential-only account promotion through plugin-owned setup declarations and validated discovery for bundled and installed plugins. Preserve complete Doctor plugin inventory and recover existing partial indexes so repeated repairs finish normally.

Verified full-build and ordinary npm-installed CLI behavior, retained partial-index recovery, and independent behavior acceptance across 50 Doctor runs. Preserve named accounts, default conflicts, root policy, disabled settings, sibling promotion, and secret-free output.

Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa added a commit that referenced this pull request Sep 20, 2026
* fix(doctor): preserve complete plugin inventory

Backport the plugin inventory repair from #136045 without the unrelated LINE and Mattermost setup changes.

* chore: prepare extended-stable 2026.7.35
@wangmiao0668000666
wangmiao0668000666 deleted the fix/line-mattermost-promotion-keys branch October 28, 2026 07:38
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

[Bug]: line and mattermost setup adapters lack singleAccountKeysToMove declarations

2 participants