Skip to content

feat(model-switcher): theme-style split-panel /model picker plugin - #24

Open
12britz wants to merge 1 commit into
mpfaffenberger:mainfrom
12britz:feat/model-switcher-plugin
Open

feat(model-switcher): theme-style split-panel /model picker plugin#24
12britz wants to merge 1 commit into
mpfaffenberger:mainfrom
12britz:feat/model-switcher-plugin

Conversation

@12britz

@12britz 12britz commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a theme-style split-panel /model picker plugin (mirrors the /theme picker's look and feel), replacing the core single-pane model picker.

  • Left pane: paginated, filterable model list
  • Right pane: live preview — provider, context window, description, credential status, pinned agents
  • Interactions: ↑/↓ navigate, PgUp/PgDn page, type to filter, Enter to apply, Ctrl+E to edit credentials, Esc to cancel
  • Commands: /model (picker), /model <name> (switch by name), /model show (show active)

This is the rework of mpfaffenberger/code_puppy#696, moved to the dedicated plugins repository as requested. The plugin registers over the core /model entry so /m lands here too.

Bug fix included

The plugin's /model override was silently replaced by the core handler at first command dispatch: core_commands is imported lazily on dispatch and re-registered the core /model, clobbering the plugin. The fix forces import code_puppy.command_line.core_commands before the plugin registers, so the override wins for the whole session.

Tests

  • tests/test_model_switcher_plugin.py (16 tests): command registration/override, by-name switching, filter, pagination, navigation, rendering, empty-catalog handling
  • ruff check + ruff format --check clean

Adds a /model switch plugin mirroring the /theme picker's split-panel
look and feel: left pane is a paginated, filterable model list; right
pane is a live preview of provider, context window, description,
credential status, and pinned agents.

Commands:
  /model            interactive split-panel picker
  /model <name>     switch by name
  /model show       show the active model

The plugin registers over the core /model entry so the /m alias lands
here too. Forces the core_commands import at registration time so the
override survives lazy command dispatch (core /model would otherwise be
re-registered and clobber the plugin on first dispatch).

Adds 16 tests covering command registration/override, by-name switching,
filtering, pagination, navigation, rendering, and empty-catalog handling.
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.

1 participant