feat(model-switcher): theme-style split-panel /model picker plugin - #696
Open
12britz wants to merge 5 commits into
Open
feat(model-switcher): theme-style split-panel /model picker plugin#69612britz wants to merge 5 commits into
12britz wants to merge 5 commits into
Conversation
Replaces the core single-pane /model picker with a curated, /theme-like split-panel experience: live preview (provider, context window, description, credential status, pinned agents), pagination, filtering, and Ctrl+E credential editing. Fixes a load-order race where the plugin's /model override was silently replaced by the core handler on first command dispatch: core_commands is now imported before registration so the plugin override wins for the whole session.
Rebuilding a fresh prompt_toolkit Application/Renderer inside the credential-edit loop re-ran the CPR probe and re-entered its own render loop every iteration. Interleaved with the manual alt-screen writes right where the key listener hands stdin back, the CPR reply could be eaten on Terminal.app, causing 'your terminal doesn't support CPR' and a flaky second /model invocation. Mirror theme/picker.py: build one Application, settle 0.05s before each run_async.
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
Adds a theme-style split-panel
/modelpicker plugin (mirrors the/themepicker's look and feel), replacing the core single-pane model picker./model(picker),/model <name>(switch by name),/model show(show active)Bug fix included
The plugin's
/modeloverride was silently replaced by the core handler at first command dispatch:core_commandsis imported lazily on dispatch and re-registered the core/model, clobbering the plugin (registered atcli_runnerimport time). The fix forcesimport code_puppy.command_line.core_commandsbefore the plugin registers, so the override wins for the whole session.Tests
tests/plugins/test_model_switcher_plugin.py(16 tests): command registration/override, by-name switching, filter, pagination, navigation, rendering, empty-catalog handlingruff check+ruff formatcleantests/command_line/suite (1940) still passes