fix(mattermost): pass payload.replyToId as root_id for threaded replies#27744
Conversation
33533d5 to
e07e563
Compare
Greptile SummaryFixed Mattermost threaded replies by correctly passing
Confidence Score: 5/5
Last reviewed commit: e07e563 |
Testing ResultsTested on self-hosted Mattermost Team Edition with OpenClaw 2026.2.25 + this patch applied via Setup: Confirmed working ✅
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
What should I do? The PR is good, it should be merged, it's tested. |
e07e563 to
e1d76d4
Compare
cfedb33 to
e029079
Compare
|
Merged via squash.
Thanks @hnykda! |
| expect( | ||
| resolveMattermostReplyRootId({ | ||
| replyToId: "inbound-post-123", | ||
| }), |
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm (cherry picked from commit 9425209)
…es (openclaw#27744) Merged via squash. Prepared head SHA: e029079 Co-authored-by: hnykda <[email protected]> Co-authored-by: mukhtharcm <[email protected]> Reviewed-by: @mukhtharcm (cherry picked from commit 9425209)
Summary
[[reply_to_current]]and[[reply_to:<id>]]tags are correctly parsed and stripped from outgoing text, but the monitor's deliver callback ignorespayload.replyToIdand hardcodesreplyToId: threadRootId. For top-level messages (no existing thread),threadRootIdisundefined, so replies are never threaded.payload.replyToId || threadRootId(prefer tag-resolved ID, fall back to existing thread root). Added tests at three levels: API clientroot_idpassthrough, reply threading pipeline, and monitor deliver logic.sendMessageMattermost— all already worked correctly.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
[[reply_to_current]]and[[reply_to:<id>]]now produce threaded replies on Mattermost (setsroot_idon POST /api/v4/posts).Security Impact (required)
root_idfield when appropriate)Repro + Verification
Environment
Steps
[[reply_to_current]] some reply textExpected
Actual (before fix)
root_idnot set)Evidence
Tests fail with buggy
return threadRootId(3 failures), pass with fixreturn payload.replyToId || threadRootId.Human Verification (required)
[[reply_to:<id>]], fallback to threadRootId, and precedence when both are present.Compatibility / Migration
Failure Recovery (if this breaks)
Risks and Mitigations
None — the change is a two-line fix using the same
payload.replyToIdthat other channels already consume.