Skip to content

gut(mattermost): remove model-picker slash-http + monitor handlers (parallel to #2414) #2449

@alexey-pelykh

Description

@alexey-pelykh

Summary

Gut the Mattermost model-picker UI. Parallel pattern to the Discord gut in #2414 — both are triggered by /model and /models slash commands and depended on model-provider data sources that were removed during the #2337 cascade. Per Middleware Boundary Principle, model selection is owned by CLI runtimes, not RemoteClaw middleware.

Mattermost is a published extension package (@remoteclaw/mattermost) with a live slash-http integration. This gut removes the model-picker handler path while preserving the rest of the channel plugin.

Current state

Model-picker surface in Mattermost:

  • extensions/mattermost/src/mattermost/model-picker.ts (360 LoC) — defines resolveMattermostModelPickerEntry, resolveMattermostModelPickerCurrentModel, parseMattermostModelPickerContext, MattermostModelPickerState, MattermostModelPickerEntry, etc.
  • extensions/mattermost/src/mattermost/model-picker.test.ts (155 LoC) — tests for above
  • extensions/mattermost/src/mattermost/slash-http.ts:30-32, 388 — imports + calls resolveMattermostModelPickerEntry(commandText) in slash-command flow
  • extensions/mattermost/src/mattermost/monitor.ts:56, 496, 760-880parseMattermostModelPickerContext import, handleModelPickerInteraction handler, buildModelPickerProps, updateModelPickerPost, plus handleInteraction: handleModelPickerInteraction wiring

Files

File LoC Disposition
extensions/mattermost/src/mattermost/model-picker.ts 360 DELETE
extensions/mattermost/src/mattermost/model-picker.test.ts 155 DELETE
extensions/mattermost/src/mattermost/slash-http.ts MODIFY — remove resolveMattermostModelPickerEntry import + the call at line 388 + any branch that handles the resolved entry
extensions/mattermost/src/mattermost/monitor.ts MODIFY — remove parseMattermostModelPickerContext import, handleModelPickerInteraction handler, buildModelPickerProps, updateModelPickerPost, and the handleInteraction: handleModelPickerInteraction wiring near line 496

Protocol

  1. Delete model-picker.ts + model-picker.test.ts
  2. Strip model-picker code paths from slash-http.ts/model and /models will fall through to normal slash-command handling (verify the resulting behavior: likely unknown-command response, which is correct)
  3. Strip model-picker code paths from monitor.ts — stale model-picker buttons in old Mattermost posts will no longer have a handler; they fall to default interaction handling (acknowledge/noop)
  4. Run pnpm check + pnpm test + node scripts/check-no-zombie-imports.mjs
  5. Scrub scripts/data/zombie-import-allowlist.json if any stale entries reference the deleted paths

AC

  • 2 files deleted (model-picker.ts, model-picker.test.ts)
  • slash-http.ts + monitor.ts modified — grep ModelPicker|model-picker|modelPicker in extensions/mattermost/ returns only migration/detection comments, no live references
  • pnpm check passes
  • pnpm test passes
  • node scripts/check-no-zombie-imports.mjs passes
  • CI zombie-import-gate passes
  • Mattermost channel adapter still functional — monitor still runs, slash-http still handles non-model commands, no new throwing-stub callers introduced

Rationale

Per Middleware Boundary Principle, model selection is a CLI-agent concern — Claude, Gemini, Codex, and OpenCode each handle their own model choice. The model-picker UI was inherited from the Pi-era provider catalog (gutted in #2337 across src/agents/model-catalog.ts, src/gateway/server-methods/models.ts, etc.). The Mattermost channel UI is the last surface in this repo holding onto the pattern and should be removed for consistency.

Relation to #2414

#2414 handles the Discord parallel (dead but compile-linked model-picker inside src/discord/monitor/). This issue is filed as a sibling — same pattern, different channel package, independent blast radius. Should land after #2414 or alongside it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gutRemoving dead upstream subsystems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions