Repository navigation
fix: retain Mattermost model pickers in conversation history - #169255
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR records delivered Mattermost model-picker text and button labels through the shared conversation-history recorder. Example: A Mattermost user invokes /oc_models openai and selects openai/gpt-5.4.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a distinct current-main history gap, and the revised head resolves both prior findings without a remaining actionable defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherMattermost authorizes and routes native commands and clicks, delivers picker posts, and records successful output in the canonical session transcript for history and later model context. flowchart LR
A[Mattermost command or click] --> B[Authorization and routing]
B --> C[Session and model reads]
C --> D[Picker delivery]
D --> E[Shared command recorder]
E --> F[Session transcript]
F --> G[History and model context]
Technical reviewBest possible solution: Retain successful native picker exchanges through the shared recorder while preserving model inheritance and one command identity across selection replies. Do we have a high-confidence way to reproduce the issue? Current-main source shows native picker sends and updates bypassing transcript capture; the body reports baseline failures, but no target code was executed during this read-only review. Is this the best way to solve the issue? Using the existing post-delivery recorder fixes the adapter gap without adding a storage owner, and the revised asynchronous reader preserves the shared resolver's parent-selection contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 926602532b62. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +120, Tests +166, Docs +2, Other -1. Total +287 across 18 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 2:35 PM ET / 18:35 UTC (Revision 2). |
|
Maintainer override: the only red job is checks-node-changed-extensions-bundle-1, the Codex run-attempt.steering-settlement and run-attempt.steering tests (cleanup assertion, hook timeout, database-closing cascade). The same tests fail 3/3 on pure origin/main ac8a432 in matched Linux runs; the same override was used on #169019 (#169019 (comment)). This PR doesn't touch Codex. ClawSweeper on this exact head is ready with zero findings. |
|
Landed in 9630174. Mattermost native command replies are now part of the conversation the agent sees. |
…w#169255) Mattermost native /model and /models replies and model-picker refreshes were visible to the user but never recorded, so the agent could not see them on later turns. This routes them through the shared command-exchange capture owner from openclaw#169026 after confirmed delivery, using worker-owned async session reads (including the derived-parent model). The selection confirmation and the picker refresh now share one command identity, so a selection is recorded once. The command identity helper moved into the command-transcript owner, so core and plugins use the same scoping. Proof is test-only, since there is no Mattermost live harness: 16 registered-handler cases fail on main and pass here, plus a persistence test with one user command and two assistant replies. This completes the slash-command parity work after openclaw#169026 (core and Telegram), openclaw#169200 (Discord) and openclaw#169236 (Slack). Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes Mattermost model-picker replies disappearing from the conversation history and later model context after native
/modelor/modelscommands and picker clicks.Related: #169026, #169200, #169236.
User Impact
Mattermost users can refer to a delivered model/provider picker on the next turn. Picker text, controls, authorization, and command execution stay unchanged; no configuration or migration is required.
Why This Change Was Made
Native picker sends bypass the shared command dispatcher. Record their delivered text and visible button labels through the existing command-exchange owner only after delivery succeeds. Read the selected and parent sessions asynchronously through the session owner. Ordinary native command replies already use shared dispatch; authorization errors and question-tool acknowledgements are not admitted slash-command results.
Parent-model inheritance from both explicit parents and thread-derived parents is preserved, including fresh threads with no child row, retaining the intent of #158937. Selection confirmations and picker refreshes share the existing dispatch command identity, so one click produces one user command with both delivered assistant replies.
Evidence
Registered slash HTTP and model-picker interaction regressions exercise empty catalogs, summaries, provider/model lists, refresh warnings, and selected-model refreshes. They check the delivered representation, conversation-scoped identity, and capture after delivery. Focused tests also cover selected and parent model overrides.
On
d234a68d604(main), the registered-handler suite fails 16 cases because no delivered exchange is recorded (1 unrelated case passes). The same cases pass with the fix.Final focused proof: 45 tests pass across six files, including a real persisted transcript with one user command and both assistant replies. The fresh-thread regression fails on the initial revision and passes after preserving resolver-selected parent reads. The isolated production build passes. Initial Mattermost-targeted Oxlint reported zero warnings and errors; the expanded standalone lint encountered the existing max-lines violation in
dispatch-from-config.choose-route.ts.Proof is test-only: no Mattermost live harness is available, and this PR makes no live Mattermost claim.
Merge danger: two-way door. A revert stops capturing future native picker exchanges; already-recorded history remains. The blast radius is Mattermost native model pickers and their session reads; user-facing sends and other channels are unchanged.