Skip to content

gut(discord): remove dead model-picker UI — CLI agents own model selection (#2414)#2450

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/2414-discord-model-picker
Apr 21, 2026
Merged

gut(discord): remove dead model-picker UI — CLI agents own model selection (#2414)#2450
alexey-pelykh merged 1 commit intomainfrom
gut/2414-discord-model-picker

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Closes #2414. Removes the Discord model-picker UI that was left dead-but-compile-linked after the #2337 provider cascade — triggered by /model and /models slash 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.mock patterns), leading to a false "zero external importers" premise. The 4 files were actually part of a live call graph reaching extensions/discord/src/channel.ts:450 through monitorDiscordProvider.

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):

  • Remove imports from deleted modules + 5 now-unused imports (Container, StringSelectMenu, TextDisplay, ResolvedAgentRoute, withTimeout)
  • Remove model-picker helpers, handleDiscordModelPickerInteraction, fallback Button/Select classes + factories, and the model-picker gate in run()
  • Preserve createDiscordNativeCommand (provider.ts:301) + createDiscordCommandArgFallbackButton (provider.ts:329)

Scrub scripts/data/zombie-import-allowlist.json: remove 3 stale entries for deleted-file callsites.

Teststest/helpers/extensions/discord-provider.test-support.ts: remove 2 orphan vi.mock entries for deleted fallback exports.

Docs — 3 sources updated to remove Discord-specific interactive-picker sentences:

  • docs/channels/discord.md
  • docs/concepts/models.md
  • docs/tools/slash-commands.md

Verification

  • pnpm check: 0 warnings / 0 errors
  • pnpm test: 7010 passed / 3 skipped / 0 failed (matches main baseline at c6d8440)
  • node scripts/check-no-zombie-imports.mjs: exit 0
  • LIVE smoke: not required (touches src/discord/, not src/middleware/)

Related

Test plan

  • pnpm check green
  • pnpm test green (7010/3/0)
  • zombie-import gate green
  • Discord slash-command infrastructure still compiles
  • CI green on all gates

🤖 Generated with Claude Code

…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>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 21, 2026 09:54
@alexey-pelykh alexey-pelykh merged commit 5286280 into main Apr 21, 2026
15 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/2414-discord-model-picker branch April 21, 2026 10:00
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gut(discord): delete orphaned src/discord/monitor/model-picker + native-command (~3.4k LoC dead code)

1 participant