Skip to content

fix: restore reads for the installed official Mattermost plugin - #147660

Merged
shakkernerd merged 3 commits into
openclaw:mainfrom
shakkernerd:fix/mattermost-context-reads
Sep 14, 2026
Merged

shakkernerd merged 3 commits into
openclaw:mainfrom
shakkernerd:fix/mattermost-context-reads

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Related: #115367

What Problem This Solves

The official Mattermost plugin can reject history reads from a configured, permitted channel after installation through npm or official ClawHub onboarding. Enabling channels.mattermost.actions.messages and allowing the destination in channels.mattermost.groups does not remove the host's external-plugin restriction.

For example, an agent in one Mattermost channel should be able to read another allowed channel using the same bot account. The bundled plugin already applies Mattermost's channel policy to that request. The installed plugin must also participate in the shared read-authority contract before the host can let that policy decide.

User Impact

Enabled history reads follow the same account and channel access rules for the bundled plugin and verified official installations. Reads stay disabled by default, and an account-level actions.messages: false still disables them for that account. Cross-account requests and disallowed channels remain blocked. Direct operator reads retain their existing behavior; older external adapters and unverified installations retain the exact-current-conversation restriction. Sending messages and adding or removing reactions receive no new authority.

Why This Change Was Made

Mattermost declares only its existing read action for the shared authority mechanism. Its HTTP client captures the current request's assertion and checks it before provider I/O, including after asynchronous DNS and transport preparation. The same client also serves target resolution, so a read cannot continue making lookup requests after its caller or plugin registration expires.

The host remains responsible for withholding stale results and provider errors when the operation completes. Provider admission stays in Mattermost, registration trust stays in the loader, and request lifetime stays in the existing host mechanism. There are no new trust settings, permission defaults, persistence changes, or read actions.

The shared prerequisites #143341 and #147492 are merged. This PR adds no host-eligible actions; its scope is Mattermost's existing read action, its client, documentation, and regression coverage.

Evidence

The regression was reproduced through the registered message tool: the bundled registration read the configured channel, while the installed-style registration rejected the same request with requires the exact current conversation and account. A declaration-only control also failed all five metadata/DNS revocation cases because it still sent subsequent HTTP requests.

The complete change passes all 22 registered-tool/HTTP cases. Its request ledger verifies:

Scenario Observed result
Current or configured allowed channel Expected message result; cross-channel reads check metadata before posts.
Current DM with a separate outbound user target Reads use the native channel ID without a metadata request.
Read disabled or requester/account mismatch Rejected before provider HTTP access.
Disallowed channel Channel metadata may be read; posts are not fetched.
Caller/plugin expires during lookup or DNS preparation No further provider request.
A success or provider error arrives after expiry Rejected without releasing stale content or the provider error.
Direct operator, legacy, and unverified registration Existing permitted reads and exact-current restrictions remain intact.

The fresh remote batch executed on 5b834dffa12c9f42ebe01885d2f969c2396b7776 passed all 916 Mattermost cases across 58 files and all 167 discovery, extension-boundary, and native project-routing cases across three files. The complete channel-surface CI group passed 249 cases across 13 files, including all 22 Mattermost cases, on merge result 216ef8076bd005f4a22464783fe819e46f390345 containing that head. The independently reviewed shared-owner continuation passed 124 selected lifecycle, startup, SQLite, and routing cases on matching owner inputs.

Fresh native npm and official ClawHub installations each passed 17 compiled-consumer cases: 34 probes and 46 native stages in total. They use the actual CLI installers, SQLite install records, and compiled plugin loader, with official registry transport redirected to isolated fixtures. Coverage includes allowed/current/named-account reads, disabled settings and accounts, requester mismatches, disallowed channels and DMs, provider errors, and caller/plugin expiry before requests and before result or error delivery. All 34 registrations were loaded global official installations and declared only read.

The core and Mattermost package were rebuilt from 5b834dffa12c9f42ebe01885d2f969c2396b7776 through canonical release tooling using a test-only 2026.9.5 fixture; no package was published. The core tarball SHA-256 is 77045fdbd3f63dec5a1f8f6f58e206c9aa4a781b40606f859331cb14d3e18079; Mattermost is f08005a09861abbaa2e8944d5e90aeff6a0520a28882308bf89fb483e763030c. The packed manifest and every native installation report openclaw.compat.pluginApi: ">=2026.9.5". Both registry fixtures and every probe server stopped, all process groups joined, and source remained unchanged.

Shared qualification in #143341 also passed four incompatible-core/plugin API rejection controls and the actual published 2026.9.3 and 2026.9.4 updater paths, preserving configuration, install records, and workspace records with four successful post-update reads. Those updater controls used Discord and Slack. Mattermost adds no migration, persisted format, or updater owner.

The necessary conflict replays onto 9a5af1b9537045fc2de707fddd34fb25b4054fd6 produce head 9b57b184a79d9aa317a5071313c68aeb3393c176. Five changed files, including all implementation and tests, remain byte-identical to the proven head. The SDK guide preserves main's landed Discord and Matrix wording and adds one Mattermost sentence. Range-diff and owner/input inspection support reuse of the recorded proof; those receipts retain their actual execution identities. Formatting, syntax, and diff preflight passed on the replayed content. All 30 selected checks are accounted for. The remote gate completed 23 stages before its unsplit native lint process was killed; that failure remains recorded. Completed CI stripes cover core, extension, and scripts lint with matching compiler, rules, and relevant inputs, and the remaining guard results are retained individually. The media-download and runtime-sidecar source scanners passed locally in under nine seconds after the shared runner closed, using matching existing dependencies without an install or build. Current-head CI is assessed separately before landing.

@clawsweeper

clawsweeper Bot commented Sep 14, 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 docs Improvements or additions to documentation channel: mattermost Channel integration: mattermost size: M maintainer Maintainer-authored PR labels Sep 14, 2026
@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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 9:33 AM ET / 13:33 UTC (Revision 5).

ClawSweeper review

What this changes

The PR restores permitted history reads for verified official Mattermost installations by connecting the existing read action and HTTP client to shared authority checks, with documentation and regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main still lacks Mattermost’s read-authority opt-in. No actionable correctness or security defect was found, and the recorded production-boundary proof covers permitted, forbidden, and revoked reads.

Priority: P2
Reviewed head: 9b57b184a79d9aa317a5071313c68aeb3393c176

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with strong production-boundary evidence and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded registered-tool and compiled-installation runs exercise the real Mattermost client against isolated HTTP fixtures, showing allowed reads, forbidden-account/channel rejection, and revocation before subsequent I/O or delivery; the relevant files match the proven revision.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded registered-tool and compiled-installation runs exercise the real Mattermost client against isolated HTTP fixtures, showing allowed reads, forbidden-account/channel rejection, and revocation before subsequent I/O or delivery; the relevant files match the proven revision.
Evidence reviewed 8 items Current main still needs the adapter opt-in: Fetched main declares providerOwnedReadGates for read but does not declare readAuthorityActions in Mattermost’s adapter. The existing host dispatcher requires both declarations plus verified registration authority for installed provider-owned reads.
Authority is checked at the HTTP boundary: The client captures the invocation assertion and passes it as beforeRequest. The shared guarded-fetch owner invokes that synchronous callback after DNS and dispatcher preparation, immediately before transport invocation.
Existing access policy remains authoritative: Mattermost’s read owner checks the current provider and account, allows the current native conversation, and requires configured channel access plus an ordinary channel type for other delegated destinations. Direct operator behavior remains separate.
Findings None None.
Security None None.

How this fits together

OpenClaw’s shared message tool dispatches history requests to the selected Mattermost plugin. The host verifies caller and plugin authority, while Mattermost checks account and channel access before fetching posts.

flowchart TD
  A[Agent history request] --> B[Host caller and plugin checks]
  B --> C[Mattermost account and channel policy]
  C --> D[HTTP client authority check]
  D --> E[Mattermost API]
  E --> F[Host completion check]
  F --> G[Messages or visible rejection]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +9, Tests +439, Docs +2. Total +450 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 10 1 +9
Tests 2 439 0 +439
Docs 2 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 451 1 +450

Review metrics

Metric Value Why it matters
Authority scope 1 existing read action; 0 new settings or host-eligible actions The adapter joins the existing contract without expanding the shared action vocabulary or configuration surface.
Production versus regression coverage Production net +9 lines; contract tests +438 lines; test routing +1 line The production growth is justified by transport-boundary checks, while the tests exercise observable request and revocation behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #115367
Summary: This PR addresses the Mattermost portion of the broader installed-plugin read restriction; merged prerequisites supply shared authority and routing support.

Members:

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

Technical review

Best possible solution:

Keep Mattermost on the existing host authority contract, preserve provider-owned access rules, and distribute it through the coordinated core/plugin release tooling.

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

Yes: current main’s missing adapter declaration selects the exact-current restriction for installed Mattermost reads, and the supplied registered-tool evidence records that failure. This read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes: adopting the already-merged authority contract repairs the installation discrepancy without duplicating trust policy, changing saved settings, or adding another permission mechanism.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs enabled history reads for official Mattermost installations with a bounded channel-specific change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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): Recorded registered-tool and compiled-installation runs exercise the real Mattermost client against isolated HTTP fixtures, showing allowed reads, forbidden-account/channel rejection, and revocation before subsequent I/O or delivery; the relevant files match the proven revision.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded registered-tool and compiled-installation runs exercise the real Mattermost client against isolated HTTP fixtures, showing allowed reads, forbidden-account/channel rejection, and revocation before subsequent I/O or delivery; the relevant files match the proven revision.

Evidence

What I checked:

  • Current main still needs the adapter opt-in: Fetched main declares providerOwnedReadGates for read but does not declare readAuthorityActions in Mattermost’s adapter. The existing host dispatcher requires both declarations plus verified registration authority for installed provider-owned reads. (extensions/mattermost/src/channel.ts:339, 8638c54e15f8)
  • Authority is checked at the HTTP boundary: The client captures the invocation assertion and passes it as beforeRequest. The shared guarded-fetch owner invokes that synchronous callback after DNS and dispatcher preparation, immediately before transport invocation. (extensions/mattermost/src/mattermost/client.ts:210, 9b57b184a79d)
  • Existing access policy remains authoritative: Mattermost’s read owner checks the current provider and account, allows the current native conversation, and requires configured channel access plus an ordinary channel type for other delegated destinations. Direct operator behavior remains separate. (extensions/mattermost/src/mattermost/read.ts:115, 9b57b184a79d)
  • Host lifetime and result fencing: The dispatcher uses host-held registration authority; the shared invocation scope composes parent authority, checks completion for both results and errors, and invalidates retained callbacks when the action finishes. (src/shared/channel-read-authority.ts:16, 9b57b184a79d)
  • Recorded real transport and installation evidence: The supplied complete PR body records 22 registered-message-tool/HTTP cases and 34 compiled-consumer probes across actual npm and official ClawHub installation paths using isolated registry/provider fixtures. Its request ledger covers allowed reads, account/provider mismatch, disallowed destinations, lookup/DNS revocation, and withheld late results/errors. Execution is attributed to 5b834dffa12c9f42ebe01885d2f969c2396b7776; this review did not rerun it. Captured context sourceRevision: 41fc6a89d5e6728c25956307fffffdda881ba1895a8b1954d8f5c0fd24c99083. (5b834dffa12c)
  • Proof reuse independently checked: GitHub’s complete tree for the proven revision matches current-head blob identities for both production files, the complete contract test, its routing entry, and the Mattermost documentation. Local comparison initially lacked the older commit object; the GitHub tree check established file identity without treating a three-dot comparison as endpoint equivalence. (src/channels/plugins/contracts/mattermost-read-authority.contract.test.ts:1, 9b57b184a79d)

Likely related people:

  • metaforismo: Raw commit cc8fd57 adds extensions/mattermost/src/mattermost/read.ts:42 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cc8fd57a0125; files: extensions/mattermost/src/mattermost/read.ts)
  • JC: Raw commit 1b30587 adds src/shared/channel-read-authority.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1b305870b325; files: src/shared/channel-read-authority.ts)

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 (4 earlier review cycles)
  • reviewed 2026-09-14T01:28:24.796Z sha fcf05975849bb70dcfa07419e1e56a62c82ca8d0 :: blocked before merge. :: none
  • reviewed 2026-09-14T02:47:58.461Z sha cf8358460052096eba275bb84e5262ba397fb5d5 :: blocked before merge. :: none
  • reviewed 2026-09-14T09:36:27.243Z sha 5b834dffa12c9f42ebe01885d2f969c2396b7776 :: blocked before merge. :: none
  • reviewed 2026-09-14T11:59:45.134Z sha 9b57b18 :: needs maintainer review before merge. :: none

@shakkernerd
shakkernerd force-pushed the fix/mattermost-context-reads branch from cf83584 to 5b834df Compare September 14, 2026 09:20
@shakkernerd
shakkernerd requested a review from a team as a code owner September 14, 2026 09:20
@shakkernerd
shakkernerd changed the base branch from stack/official-plugin-reads to main September 14, 2026 09:20
@shakkernerd
shakkernerd force-pushed the fix/mattermost-context-reads branch from 5b834df to ed7ee04 Compare September 14, 2026 11:39
@shakkernerd
shakkernerd force-pushed the fix/mattermost-context-reads branch from ed7ee04 to 9b57b18 Compare September 14, 2026 11:49
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 14, 2026
@shakkernerd shakkernerd self-assigned this Sep 14, 2026
@shakkernerd
shakkernerd merged commit 89fc81e into openclaw:main Sep 14, 2026
311 of 315 checks passed
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: enabled Mattermost history reads can access permitted channels after npm or official ClawHub installation.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
…claw#147660)

Restore configured channel history reads for the official Mattermost plugin installed through npm or ClawHub while preserving existing account, channel, and action settings. Revalidate active read authority before provider requests.

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

Labels

channel: mattermost Channel integration: mattermost docs Improvements or additions to documentation maintainer Maintainer-authored PR 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: 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