fix(mattermost): read replyTo param in plugin handleAction send#41176
fix(mattermost): read replyTo param in plugin handleAction send#41176mukhtharcm merged 2 commits intoopenclaw:mainfrom
Conversation
|
Manually verified on a self-hosted v2026.3.8 instance:
Both the API response and the Mattermost UI confirm threaded replies work correctly after this fix. |
Greptile SummaryThis PR fixes a parameter name mismatch in the Mattermost plugin that caused
Confidence Score: 4/5
Last reviewed commit: 39cf1d8 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d739f2eb65
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const revision = state?.revision ?? 0; | ||
| if (state) { | ||
| pruneExpired(state, nowMs); |
There was a problem hiding this comment.
Return post-prune revision from pending drain
drainNodePendingWork snapshots revision before calling pruneExpired, but pruneExpired increments state.revision when expired items are removed. In the common polling path where only expiration changed the queue, the method returns a stale revision, so clients that rely on revision changes can miss that pending work mutated and keep operating on outdated state.
Useful? React with 👍 / 👎.
| if (noProxyValue === "*") { | ||
| return true; |
There was a problem hiding this comment.
Recognize wildcard no_proxy entries during bypass check
The bypass helper only treats wildcard as valid when the entire env var is exactly "*". When no_proxy is provided as a list (for example "*,api.telegram.org"), the * entry is not recognized, so Telegram is misclassified as proxied. That disables sticky IPv4 fallback for env-proxy mode even though the request is actually direct via NO_PROXY, which can leave Telegram fetches failing on dual-stack/IPv6-unreachable networks.
Useful? React with 👍 / 👎.
d739f2e to
2fe21ea
Compare
The Mattermost plugin's handleAction reads params.replyToId for the send action, but the message tool passes the reply target as params.replyTo. The core handleSendAction (message-action-runner.ts) extracts params.replyTo into a local variable and passes it to executeSendAction, but never writes it back onto the params object as replyToId. Since the plugin intercepts before executeSendAction runs, it always sees replyToId as undefined. This causes message(replyTo=<id>) to create top-level Mattermost posts with root_id="" instead of threaded replies. Fix: check both params.replyToId and params.replyTo in the plugin's send handler. Fixes openclaw#40924
2fe21ea to
33cac4c
Compare
|
Merged via squash.
Thanks @hnykda! |
|
Appreciated! |
* main: (43 commits) docs: add openclaw#42173 to CHANGELOG — strip leaked model control tokens (openclaw#42216) Agents: align onPayload callback and OAuth imports docs: add Tengji (George) Zhang to maintainer table (openclaw#42190) fix: strip leaked model control tokens from user-facing text (openclaw#42173) Changelog: add unreleased March 9 entries chore: add .dev-state to .gitignore (openclaw#41848) fix(agents): avoid duplicate same-provider cooldown probes in fallback runs (openclaw#41711) fix(mattermost): preserve markdown formatting and native tables (openclaw#18655) feat(acp): add resumeSessionId to sessions_spawn for ACP session resume (openclaw#41847) ACPX: bump bundled acpx to 0.1.16 (openclaw#41975) mattermost: fix DM media upload for unprefixed user IDs (openclaw#29925) fix(msteams): use General channel conversation ID as team key for Bot Framework compatibility (openclaw#41838) fix(mattermost): read replyTo param in plugin handleAction send (openclaw#41176) fix(sandbox): pass real workspace to sessions_spawn when workspaceAccess is ro (openclaw#40757) fix(ui): replace Manual RPC text input with sorted method dropdown (openclaw#14967) CI: select Swift 6.2 toolchain for CodeQL (openclaw#41787) fix(agents): forward memory flush write path (openclaw#41761) fix(telegram): move network fallback to resolver-scoped dispatchers (openclaw#40740) fix(security): harden replaceMarkers() to catch space/underscore boundary marker variants (openclaw#35983) fix(web-search): recover OpenRouter Perplexity citations from message annotations (openclaw#40881) ...
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…claw#41176) Merged via squash. Prepared head SHA: 33cac4c Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
Summary
The Mattermost plugin's
handleActionreadsparams.replyToIdfor the send action, but the message tool passes the reply target asparams.replyTo. This causesmessage(replyTo=<id>)to create top-level posts (root_id: "") instead of threaded replies.Root cause
replyToparameterhandleSendAction(message-action-runner.ts) readsparams.replyTointo a local variablereplyToIdtryHandleWithPluginActionis called, passing the rawparamsobject to the pluginhandleActionreadsparams.replyToId— which isundefinedbecause the property is namedreplyTo, notreplyToIdsendMessageMattermostis called withreplyToId: undefined→ post created with emptyroot_idThe core path (non-plugin) works correctly because
executeSendActionreceives the extractedreplyToIdas a separate argument.Fix
Check both
params.replyToIdandparams.replyToin the Mattermost plugin's send handler.Testing
Tested on a self-hosted v2026.3.8 instance:
message(replyTo=<id>)→root_id: ""(top-level post)message(replyTo=<id>)→root_id: <id>(threaded reply, confirmed via API and UI)Fixes #40924