Skip to content

fix: retain Mattermost model pickers in conversation history - #169255

Merged
obviyus merged 2 commits into
mainfrom
fix/mattermost-command-parity
Oct 11, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/mattermost-command-parity

Conversation

@obviyus

@obviyus obviyus commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes Mattermost model-picker replies disappearing from the conversation history and later model context after native /model or /models commands 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.

@clawsweeper

clawsweeper Bot commented Oct 11, 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 labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The picker is visible in Mattermost but missing from conversation history.
  • After: History retains the picker and one selection command with its confirmation and refreshed picker.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent adapter repair with both prior defects resolved and focused harness evidence, but limited production-entry-point confidence.
Proof confidence 🦐 gold shrimp (3/6) The explicit maintainer-authored classification exempts the ordinary contributor proof gate; supplied handler tests mock recording, while a separate harness exercises real persistence, and the body expressly claims no live Mattermost proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Delivered Mattermost model pickers disappear from conversation history and later model context.
Reason: The source demonstrates the adapter gap, an existing recorder owns the solution, and the explicit maintainer-authored classification establishes direction.

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
Reviewed head: 744ae6143d9b7a96e65087b25d79cda146295efc

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The persistence harness bypasses Mattermost ingress and delivery; no shipped-entry-point run shows retained picker exchanges in the next model request.
Agent review details

How this fits together

Mattermost 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]
Loading

Technical review

Best 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

  • Native picker delivery and selection changes intended behavior with a stated reason (4f08dcc: Mattermost: add interactive model picker #38767 established owner-scoped browsing updates and normal command dispatch for selections.)
  • Selected-session catalog facts keeps the original intent (7764767: fix(channels): honor pinned accounts in Mattermost model menus #144880 requires latest selected-session facts so menus honor pinned accounts.)
  • Parent model resolution keeps the original intent (323334f: refactor(channels): deslop remaining channel plugins third pass #158937 consolidated session reads while retaining explicit and derived parent lookups.)
  • Command identity ownership keeps the original intent (289d859: Scope command identities by channel, account, and conversation to deduplicate delivered replies; relocation preserves the serialization and migrates both callers.)
  • Mock-export baseline keeps the original intent (unknown: Historical baseline content is not prefetched; the inspected original and revised factories independently verify that the removed entry now preserves real exports.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 289d859 adds src/config/sessions/command-transcript.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 289d859c2bab; files: src/config/sessions/command-transcript.ts)
  • Muhammed Mukhthar CM: Raw commit 4f08dcc adds extensions/mattermost/src/mattermost/model-picker.ts:256 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4f08dcccfd71; files: extensions/mattermost/src/mattermost/model-picker.ts)
  • Peter Steinberger: Raw commit 3923174 adds extensions/mattermost/src/mattermost/monitor-model-picker.ts:174 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 39231741d8c0; files: extensions/mattermost/src/mattermost/monitor-model-picker.ts)
  • joshavant: Raw commit 5453504 adds extensions/mattermost/src/mattermost/monitor-model-picker.ts:258 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 545350488a07; files: extensions/mattermost/src/mattermost/monitor-model-picker.ts)

PR surface

Source +120, Tests +166, Docs +2, Other -1. Total +287 across 18 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 9 207 87 +120
Tests 4 174 8 +166
Docs 4 6 4 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 18 387 100 +287

Review metrics

Metric Value Why it matters
Production versus test changes Production +207/-87; tests +174/-8 Growth implements native delivery capture and asynchronous session reads, with adapter regressions and persisted exchange coverage.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The SDK runtime seam gains an additive command-identity helper; the supplied maintainer-authored direction covers this change, and existing signatures and serialized identities remain intact.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The missing history affects a limited Mattermost native-picker workflow.
  • merge-risk: 🚨 compatibility: The SDK runtime seam gains an additive command-identity helper; the supplied maintainer-authored direction covers this change, and existing signatures and serialized identities remain intact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Exercise the registered Mattermost slash and selection handlers with the real recorder, then verify one selection command and both replies through history and the next model request.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T18:00:01.615Z sha ab18b82 :: needs changes before merge. :: [P2] Preserve parent overrides derived from thread session keys | [P2] Use one command identity for selection and picker refresh

Reviewed October 11, 2026, 2:35 PM ET / 18:35 UTC (Revision 2).

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@obviyus
obviyus merged commit 9630174 into main Oct 11, 2026
134 of 139 checks passed
@obviyus
obviyus deleted the fix/mattermost-command-parity branch October 11, 2026 18:41
@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 9630174. Mattermost native command replies are now part of the conversation the agent sees.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…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]>
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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