openclaw - ✅(Solved) Fix [Bug]:Mattermost "draft preview" streaming feature is hardcoded and always enabled or disabled in different versions [3 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73211Fetched 2026-04-29 06:22:09
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×3labeled ×2referenced ×1renamed ×1

Mattermost 频道实现了一个"草稿预览"流式传输功能(由 PR #47838 引入于2026.4.20),允许 AI:

  1. 通过 POST /posts 创建一个占位消息
  2. 在中间状态变化时(工具活动、思考过程、部分回复)通过 PUT /posts/{id} 原地更新同一条消息
  3. 最终用完整回复替换占位内容

然而,该行为是硬编码且默认开启的 — 目前:

  1. Mattermost schema(config-schema-core.ts)中没有配置项来控制是否启用草稿预览流式传输
  2. 文档中没有任何说明表明此功能是不可配置的、始终开启的

The Mattermost channel implements a "draft preview" streaming feature (introduced in PR #47838 in version 2026.4.20) that allows the agent to:

  1. Create a placeholder post via POST /posts
  2. Update the same post in-place via PUT /posts/{id} as intermediate status changes occur (tool activity, thinking, partial replies)
  3. Finalize the post with the complete reply

However, this behavior is hardcoded and always enabled — there is:

  1. No configuration option in the Mattermost schema (config-schema-core.ts) to control whether draft-preview streaming is active
  2. No mention in the documentation that this feature is non-configurable and always on

Root Cause

Mattermost 频道实现了一个"草稿预览"流式传输功能(由 PR #47838 引入于2026.4.20),允许 AI:

  1. 通过 POST /posts 创建一个占位消息
  2. 在中间状态变化时(工具活动、思考过程、部分回复)通过 PUT /posts/{id} 原地更新同一条消息
  3. 最终用完整回复替换占位内容

然而,该行为是硬编码且默认开启的 — 目前:

  1. Mattermost schema(config-schema-core.ts)中没有配置项来控制是否启用草稿预览流式传输
  2. 文档中没有任何说明表明此功能是不可配置的、始终开启的

The Mattermost channel implements a "draft preview" streaming feature (introduced in PR #47838 in version 2026.4.20) that allows the agent to:

  1. Create a placeholder post via POST /posts
  2. Update the same post in-place via PUT /posts/{id} as intermediate status changes occur (tool activity, thinking, partial replies)
  3. Finalize the post with the complete reply

However, this behavior is hardcoded and always enabled — there is:

  1. No configuration option in the Mattermost schema (config-schema-core.ts) to control whether draft-preview streaming is active
  2. No mention in the documentation that this feature is non-configurable and always on

Fix Action

Fixed

PR fix notes

PR #73251: feat(mattermost): add streaming.draftPreview config option

Description (problem / solution / changelog)

Summary

Add a configurable streaming.draftPreview boolean to the Mattermost channel schema. When set to false, the draft-preview streaming behavior (POST placeholder + PUT updates in place) is completely skipped — only a single final POST is sent.

Defaults to true for backward compatibility.

Example config

{
  channels: {
    mattermost: {
      streaming: {
        draftPreview: false
      }
    }
  }
}

Fixes #73211

Changes

  • extensions/mattermost/src/config-schema-core.ts — add streaming.draftPreview schema field
  • extensions/mattermost/src/mattermost/draft-stream.ts — add createMattermostNoopDraftStream()
  • extensions/mattermost/src/mattermost/monitor.ts — conditionally use noop stream when disabled
  • extensions/mattermost/src/mattermost/draft-stream.test.ts — test noop stream

Changed files

  • extensions/mattermost/src/config-schema-core.ts (modified, +8/-0)
  • extensions/mattermost/src/mattermost/draft-stream.test.ts (modified, +15/-0)
  • extensions/mattermost/src/mattermost/draft-stream.ts (modified, +17/-0)
  • extensions/mattermost/src/mattermost/monitor.ts (modified, +12/-9)

PR #73252: fix(mattermost): honor streaming mode for draft preview

Description (problem / solution / changelog)

Problem

Mattermost draft preview streaming is always active for inbound replies. Users can try to configure channels.mattermost.streaming, but the Mattermost plugin schema did not accept the canonical streaming object and the inbound runtime ignored preview mode entirely.

Root cause

The Mattermost config schema only exposed legacy chunk/block fields, while the inbound monitor unconditionally created the draft preview path, forced disableBlockStreaming: true, registered partial/reasoning/tool draft update callbacks, and attempted final in-place preview edits.

Complete fix boundary

  • Accept the canonical Mattermost streaming object at top-level and account-level config.
  • Resolve Mattermost draft preview mode from streaming.mode, defaulting to current behavior (partial).
  • When streaming.mode is off, skip draft preview update callbacks and bypass preview finalization so final replies use normal delivery.
  • Keep generic block streaming disabled when preview is off unless the account explicitly enables block streaming.
  • Add regression tests for schema input and the downstream final delivery path.

What intentionally did not change

  • Default Mattermost behavior remains draft preview enabled when streaming is omitted.
  • No new draftPreview alias was added; this uses the existing canonical streaming.mode shape used by channel streaming config.
  • Low-level draft stream mechanics, slash replies, button interactions, and model picker replies were not changed because they do not own the inbound draft preview bug.

Tests run

  • pnpm exec vitest run --config test/vitest/vitest.extension-mattermost.config.ts extensions/mattermost/src/config-schema.test.ts extensions/mattermost/src/mattermost/monitor.test.ts
  • pnpm tsgo:extensions
  • pnpm exec oxlint --tsconfig tsconfig.oxlint.extensions.json extensions/mattermost/src/config-schema-core.ts extensions/mattermost/src/config-schema.test.ts extensions/mattermost/src/mattermost/monitor.ts extensions/mattermost/src/mattermost/monitor.test.ts extensions/mattermost/src/types.ts
  • pnpm check:bundled-channel-config-metadata
  • pnpm exec vitest run --config test/vitest/vitest.extension-mattermost.config.ts
  • pnpm test:extensions:package-boundary

Linked issue

Fixes #73211

CI red analysis

Current CI has three red checks:

  • checks-node-core-fast-support: failed in src/acp/persistent-bindings.lifecycle.test.ts around resetAcpSessionInPlace binding lifecycle assertions. This PR does not touch ACP/session binding code; unrelated.
  • checks-node-agentic-control-plane: failed in src/gateway/server-restart-sentinel.test.ts around restart message/sentinel assertions. This PR does not touch gateway restart/sentinel code; unrelated.
  • checks-node-core: aggregate failed because non-dist Node shards failed, caused by the two failures above; unrelated to this diff.

Mattermost-relevant CI passed: check-lint, check-prod-types, check-test-types, check-additional-extension-package-boundary, all checks-node-extensions-*, and Greptile Review. Greptile also reviewed the diff with confidence 5/5 and found no correctness or security concerns.

Changed files

  • extensions/mattermost/src/config-schema-core.ts (modified, +35/-0)
  • extensions/mattermost/src/config-schema.test.ts (modified, +17/-0)
  • extensions/mattermost/src/mattermost/monitor.test.ts (modified, +37/-0)
  • extensions/mattermost/src/mattermost/monitor.ts (modified, +44/-18)
  • extensions/mattermost/src/types.ts (modified, +3/-0)

PR #73265: feat(mattermost): toggle draft-preview streaming via channels.mattermost.streaming.draftPreview (#73211)

Description (problem / solution / changelog)

Fixes #73211.

Diagnosis

The Mattermost channel's "draft preview" streaming feature (introduced in #47838 / 2026.4.20) is hardcoded and always on:

  • `extensions/mattermost/src/mattermost/monitor.ts:1635` unconditionally calls `createMattermostDraftStream`, which creates a placeholder post via `POST /posts` and then updates it in-place via `PUT /posts/{id}` on every intermediate state change (tool activity, thinking, partial replies).
  • The Mattermost config schema has no field controlling this, the docs don't mention it, and any extra `streaming` block in the config is silently dropped by schema validation.

Fix

Add `channels.mattermost.streaming.draftPreview?: boolean` (with the same shape on per-account configs):

```json5 { channels: { mattermost: { streaming: { draftPreview: false }, // channel-level accounts: { ops: { streaming: { draftPreview: true } } // per-account override wins } } } } ```

Default remains `true` (existing behavior preserved). When `false`, the monitor pipeline substitutes a no-op `MattermostDraftStream` stub from `createDisabledMattermostDraftStream()` — the call shape is unchanged but the placeholder/in-place traffic is suppressed; the final reply is delivered by the normal outbound chunker.

Account-level overrides channel-level, consistent with how the existing `blockStreaming` and `replyToMode` knobs resolve.

Files

  • `extensions/mattermost/src/types.ts` — add `streaming?: { draftPreview?: boolean }` to `MattermostAccountConfig`.
  • `extensions/mattermost/src/mattermost/accounts.ts` — surface `draftPreview` on `ResolvedMattermostAccount`; add `"streaming"` to `nestedObjectKeys` so per-account overrides don't fully replace the channel-level block.
  • `extensions/mattermost/src/mattermost/draft-stream.ts` — export a small `createDisabledMattermostDraftStream()` factory.
  • `extensions/mattermost/src/mattermost/monitor.ts` — gate `createMattermostDraftStream` on `account.draftPreview`.
  • `extensions/mattermost/src/mattermost/accounts.test.ts` — 3 new cases (default true; channel-level false; account-level beats channel-level).
  • `extensions/mattermost/src/mattermost/draft-stream.test.ts` — 2 new cases (no-op shape; repeated update calls don't issue requests).
  • `CHANGELOG.md`.

Verification

  • `pnpm vitest run extensions/mattermost/src/mattermost/{draft-stream,accounts,monitor}.test.ts` → 67/67 passing (5 new + 62 existing).

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/mattermost/src/mattermost/accounts.test.ts (modified, +54/-0)
  • extensions/mattermost/src/mattermost/accounts.ts (modified, +13/-1)
  • extensions/mattermost/src/mattermost/draft-stream.test.ts (modified, +29/-1)
  • extensions/mattermost/src/mattermost/draft-stream.ts (modified, +21/-0)
  • extensions/mattermost/src/mattermost/monitor.ts (modified, +16/-9)
  • extensions/mattermost/src/types.ts (modified, +13/-0)

Code Example

{
  channels: {
    mattermost: {
      streaming: {
        draftPreview: false
      }
    }
  }
}

### Actual behavior

在之前的版本中mattermost无法启用streaming效果
在之后的版本中mattermost无法关闭streaming效果
与文档中streaming的描述不符,且schema中不包含streaming字段,会被自动移除

### OpenClaw version

2026.4.25

### Operating system

all

### Install method

npm

### Model

any

### Provider / routing chain

any

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Mattermost 频道实现了一个"草稿预览"流式传输功能(由 PR #47838 引入于2026.4.20),允许 AI:

  1. 通过 POST /posts 创建一个占位消息
  2. 在中间状态变化时(工具活动、思考过程、部分回复)通过 PUT /posts/{id} 原地更新同一条消息
  3. 最终用完整回复替换占位内容

然而,该行为是硬编码且默认开启的 — 目前:

  1. Mattermost schema(config-schema-core.ts)中没有配置项来控制是否启用草稿预览流式传输
  2. 文档中没有任何说明表明此功能是不可配置的、始终开启的

The Mattermost channel implements a "draft preview" streaming feature (introduced in PR #47838 in version 2026.4.20) that allows the agent to:

  1. Create a placeholder post via POST /posts
  2. Update the same post in-place via PUT /posts/{id} as intermediate status changes occur (tool activity, thinking, partial replies)
  3. Finalize the post with the complete reply

However, this behavior is hardcoded and always enabled — there is:

  1. No configuration option in the Mattermost schema (config-schema-core.ts) to control whether draft-preview streaming is active
  2. No mention in the documentation that this feature is non-configurable and always on

Steps to reproduce

在之前的版本中mattermost无法启用streaming效果 在之后的版本中mattermost无法关闭streaming效果 与文档中streaming的描述不符,且schema中不包含streaming字段,会被自动移除

Expected behavior

用户应该能够退出草稿预览流式传输行为,例如: Users should be able to opt out of the draft-preview streaming behavior via configuration, for example:

{
  channels: {
    mattermost: {
      streaming: {
        draftPreview: false
      }
    }
  }
}

### Actual behavior

在之前的版本中mattermost无法启用streaming效果
在之后的版本中mattermost无法关闭streaming效果
与文档中streaming的描述不符,且schema中不包含streaming字段,会被自动移除

### OpenClaw version

2026.4.25

### Operating system

all

### Install method

npm

### Model

any

### Provider / routing chain

any

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Add a configuration option to the Mattermost schema to control whether draft-preview streaming is active.

Guidance

  • Introduce a new configuration field draftPreview under channels.mattermost.streaming in config-schema-core.ts to allow users to opt out of the draft-preview streaming behavior.
  • Update the documentation to reflect the new configuration option and its default value.
  • Consider adding a feature flag or a compatibility mode to ensure a smooth transition for existing users.
  • Verify that the new configuration option is properly validated and handled in the code to prevent any potential issues.

Example

{
  channels: {
    mattermost: {
      streaming: {
        draftPreview: false
      }
    }
  }
}

Notes

The current implementation of the draft-preview streaming feature is hardcoded and always enabled, which may not be desirable for all users. Adding a configuration option will provide more flexibility and control over the feature.

Recommendation

Apply workaround by adding a configuration option to the Mattermost schema, as this will provide a more flexible and user-friendly solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

用户应该能够退出草稿预览流式传输行为,例如: Users should be able to opt out of the draft-preview streaming behavior via configuration, for example:

{
  channels: {
    mattermost: {
      streaming: {
        draftPreview: false
      }
    }
  }
}

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING