gut(discord): remove dead model-picker UI — CLI agents own model selection (#2414)#2450
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
…ction (#2414) The Discord model-picker UI was dead-but-compile-linked after the #2337 provider cascade. Triggered by /model and /models slash commands that are not registered in the live command registry — reach is unreachable, but native-command.ts still imported 11 symbols from model-picker.ts keeping ~2.3k LoC of gutted Pi-era UI wiring alive at compile time. Per Middleware Boundary Principle (product/strategy.md), model selection is owned by CLI runtimes (Claude, Gemini, Codex, OpenCode). RemoteClaw does not route model choice through its infrastructure. Changes: - Delete src/discord/monitor/model-picker{,-preferences,.test,.test-utils}.ts - Remove 697 LoC of model-picker helpers, handler, gate, fallback button/select classes, and 5 unused imports from native-command.ts - Preserve createDiscordNativeCommand + createDiscordCommandArgFallbackButton (live slash-command infrastructure called from provider.ts:301,329) - Scrub 3 stale zombie-import-allowlist entries referencing deleted files - Remove 2 orphan vi.mock entries for deleted fallback exports from test/helpers/extensions/discord-provider.test-support.ts - Strip Discord-specific /model/ /models interactive-picker sentences from 3 docs sources (discord.md, slash-commands.md, models.md) Non-scope: Mattermost parallel (extensions/mattermost/src/mattermost/ model-picker.ts) tracked as #2449. Broader /model docs referencing a command not registered in this fork are out of scope — separate gut if needed. pnpm check: 0 warnings / 0 errors pnpm test: 7010 passed / 3 skipped / 0 failed (baseline maintained) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 tasks
alexey-pelykh
added a commit
that referenced
this pull request
Apr 21, 2026
…election (#2449) The Mattermost model-picker UI was dead-but-compile-linked after the #2337 provider cascade — /model and /models slash commands routed to a picker whose data source had been gutted, so the handler only returned "No models available." while keeping ~520 LoC of picker UI wiring alive at compile time. Per Middleware Boundary Principle (product/strategy.md), model selection is owned by CLI runtimes (Claude, Gemini, Codex, OpenCode). RemoteClaw does not route model choice through its infrastructure. Parallel to Discord gut in #2450 (merged 2026-04-21), which applied the same rationale. Changes: - Delete extensions/mattermost/src/mattermost/model-picker{,.test}.ts (515 LoC) - Remove picker-entry branch + 5 picker imports from slash-http.ts - Remove picker handler wiring, 3 helper functions, and 4 now-orphan imports (parseMattermostModelPickerContext, authorizeMattermostCommandInvocation, buildButtonProps, updateMattermostPost, MattermostInteractionResponse) from monitor.ts - Stale picker buttons on old Mattermost posts fall through to default interaction handling — verified graceful no-op at interactions.ts:558 where handleInteraction is guarded Closes #2449 (Mattermost gut). Also closes #2415 (superseded — the "fresh product rationale" it called for is provided here by the Middleware Boundary Principle, matching bullet 1 of its "Alternative: Gut" path). pnpm check: 0 warnings / 0 errors pnpm test: 7010 passed / 3 skipped / 0 failed (matches #2450 baseline at c6d8440) zombie-import / throwing-stub / stub-debt / obsolescence gates: all exit 0 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
alexey-pelykh
added a commit
that referenced
this pull request
Apr 21, 2026
…election (#2449) (#2451) The Mattermost model-picker UI was dead-but-compile-linked after the #2337 provider cascade — /model and /models slash commands routed to a picker whose data source had been gutted, so the handler only returned "No models available." while keeping ~520 LoC of picker UI wiring alive at compile time. Per Middleware Boundary Principle (product/strategy.md), model selection is owned by CLI runtimes (Claude, Gemini, Codex, OpenCode). RemoteClaw does not route model choice through its infrastructure. Parallel to Discord gut in #2450 (merged 2026-04-21), which applied the same rationale. Changes: - Delete extensions/mattermost/src/mattermost/model-picker{,.test}.ts (515 LoC) - Remove picker-entry branch + 5 picker imports from slash-http.ts - Remove picker handler wiring, 3 helper functions, and 4 now-orphan imports (parseMattermostModelPickerContext, authorizeMattermostCommandInvocation, buildButtonProps, updateMattermostPost, MattermostInteractionResponse) from monitor.ts - Stale picker buttons on old Mattermost posts fall through to default interaction handling — verified graceful no-op at interactions.ts:558 where handleInteraction is guarded Closes #2449 (Mattermost gut). Also closes #2415 (superseded — the "fresh product rationale" it called for is provided here by the Middleware Boundary Principle, matching bullet 1 of its "Alternative: Gut" path). pnpm check: 0 warnings / 0 errors pnpm test: 7010 passed / 3 skipped / 0 failed (matches #2450 baseline at c6d8440) zombie-import / throwing-stub / stub-debt / obsolescence gates: all exit 0 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2414. Removes the Discord model-picker UI that was left dead-but-compile-linked after the #2337 provider cascade — triggered by
/modeland/modelsslash commands not registered in the live command registry, with ~2.3k LoC of gutted Pi-era wiring kept alive only by compile-time imports.Per Middleware Boundary Principle (
product/strategy.md), model selection is owned by CLI runtimes (Claude, Gemini, Codex, OpenCode). RemoteClaw does not route model choice through its infrastructure.Scope correction
The original issue grep missed 3 categories of imports (relative siblings, parent re-exports,
vi.mockpatterns), leading to a false "zero external importers" premise. The 4 files were actually part of a live call graph reachingextensions/discord/src/channel.ts:450throughmonitorDiscordProvider.Revised scope — 4 files deleted + 6 files modified — preserves the slash-command infrastructure (
createDiscordNativeCommand,createDiscordCommandArgFallbackButton) while removing the dead model-picker path. Full call-graph audit posted as issue comment: #2414 (comment)Changes
Delete (1,583 LoC):
src/discord/monitor/model-picker.ts(940)src/discord/monitor/model-picker.test.ts(631)src/discord/monitor/model-picker.test-utils.ts(5)src/discord/monitor/model-picker-preferences.ts(7)Modify
src/discord/monitor/native-command.ts(−697 LoC):Container,StringSelectMenu,TextDisplay,ResolvedAgentRoute,withTimeout)handleDiscordModelPickerInteraction, fallback Button/Select classes + factories, and the model-picker gate inrun()createDiscordNativeCommand(provider.ts:301) +createDiscordCommandArgFallbackButton(provider.ts:329)Scrub
scripts/data/zombie-import-allowlist.json: remove 3 stale entries for deleted-file callsites.Tests —
test/helpers/extensions/discord-provider.test-support.ts: remove 2 orphanvi.mockentries for deleted fallback exports.Docs — 3 sources updated to remove Discord-specific interactive-picker sentences:
docs/channels/discord.mddocs/concepts/models.mddocs/tools/slash-commands.mdVerification
pnpm check: 0 warnings / 0 errorspnpm test: 7010 passed / 3 skipped / 0 failed (matches main baseline atc6d8440)node scripts/check-no-zombie-imports.mjs: exit 0src/discord/, notsrc/middleware/)Related
Test plan
🤖 Generated with Claude Code