pi-better-model-select 0.1.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ ## 0.3.0
4
+
5
+ ### Added
6
+
7
+ - `/bms-options` for direct access to result placement, write mode, and provider visibility.
8
+ - Above-prompt result placement, with the best match nearest search. Below-prompt placement remains the default.
9
+ - Ctrl+O Actions menu with access to model management, defaults, options, and usage reset.
10
+ - Visible **Save configuration** and **Back** actions in forms, alongside Ctrl+S and Esc.
11
+
12
+ ### Changed
13
+
14
+ - Replaced the model list with aligned MODEL, PROVIDER, CONTEXT, USES, and STATUS columns, a full-row selection highlight, and up to six visible results.
15
+ - Moved search into a prompt-style field in Pi's editor area. Shortcut hints and the result count follow result placement.
16
+ - Replaced model-edit questionnaires with draft forms. Changes are saved explicitly; leaving a modified form asks whether to discard them.
17
+ - Organized Pi and subagent defaults into a table with model, effort, and source information.
18
+ - Preserved search and selection across submenus. Returning from an Actions submenu restores the selected action.
19
+ - Kept non-search menus top-to-bottom regardless of result placement.
20
+ - Styled shortcut keys separately from action descriptions and omitted whole hints at narrow widths.
21
+ - Made destructive confirmations cancel-first and explicit about write scope.
22
+
23
+ ### Fixed
24
+
25
+ - Restored the same form draft and selection after closing a child dialog, without losing it when Pi restores its editor.
26
+
27
+ ## 0.2.0
28
+
29
+ ### Added
30
+
31
+ - Default model and thinking effort configuration for Pi, the subagent fallback, and individual agent roles.
32
+ - `/bms-defaults`, Ctrl+D for the Pi default, and Ctrl+G for the defaults menu.
33
+ - User/project scope selection, effective-value sources, and warnings about higher-priority overrides.
34
+ - Provider-reported effort capability hints, editable supported levels, and per-model preferred effort.
35
+ - Active-model and saved-default markers in the picker.
36
+
37
+ ### Fixed
38
+
39
+ - Discovery of pi-subagents roles with the newer bundled entry-point layout, checked against pi-subagents 0.82.1 after the original 0.79.0 integration.
40
+
41
+ ## 0.1.4
42
+
43
+ - Added BMS options and provider filters.
44
+
45
+ ## 0.1.3
46
+
47
+ - Renamed the package to `pi-better-model-select`.
48
+
49
+ ## 0.1.2
50
+
51
+ - Persisted deletion of inherited models in the personal overlay.
52
+
53
+ ## 0.1.1
54
+
55
+ - Added a personal model overlay so local edits can remain separate from Pi's model configuration.
package/README.md CHANGED
@@ -1,12 +1,6 @@
1
1
  # pi-better-model-select
2
2
 
3
- A searchable, usage-ranked model picker for [pi](https://pi.dev).
4
-
5
- `/bms` opens the effective model list from `models.json` plus the optional BMS-owned
6
- `models.bms.json` overlay, sorted by how often you pick each model. Start
7
- typing to filter; press enter to switch the session to the highlighted model.
8
- Add, update and delete live on ctrl-chords so plain keystrokes always go to the
9
- search box.
3
+ A searchable model picker for [Pi](https://pi.dev). Switch models, edit model definitions, and save default models and thinking effort. Models you pick most often appear first.
10
4
 
11
5
  ## Install
12
6
 
@@ -14,121 +8,92 @@ search box.
14
8
  pi install npm:pi-better-model-select
15
9
  ```
16
10
 
17
- If you installed the package under its old name, migrate with:
11
+ Run `/bms`, type to filter by name, model ID, or provider, then press Enter to switch models for the current session.
18
12
 
19
- ```bash
20
- pi remove npm:@msenebald/better-model-select
21
- pi install npm:pi-better-model-select
22
- ```
13
+ ## Compact TUI
14
+
15
+ ![BMS model search, forms, defaults, and result placement](docs/demo/showcase.gif)
23
16
 
24
- ## Commands
17
+ The picker uses aligned model, provider, context, usage, and status columns. Type in the search field in Pi's editor area. Results appear below search by default, matching Pi command completion. Choose **Options → Result placement → Above prompt** for bottom-up results with the best match nearest the search line.
25
18
 
26
- | Command | What it does |
27
- | ---------- | --------------------------------------------------- |
28
- | `/bms` | Open the searchable, usage-ranked picker |
29
- | `/bms-add` | Jump straight to the add-a-model flow |
19
+ Add and edit use one form. Review the fields, press Enter to change a value, then choose **Save configuration** or press Ctrl+S to save. Text and numeric fields currently open a Pi input dialog; choices use the compact table. Esc goes back; unsaved changes require a discard confirmation. Options also stay in a draft until saved.
30
20
 
31
- ## Keys
21
+ ## Commands and shortcuts
32
22
 
33
- | Key | Action |
34
- | ---------- | --------------------------------------------------- |
35
- | `↑` `↓` | Move through the list |
36
- | *type* | Fuzzy filter by display name, model id or provider |
37
- | `enter` | Load the highlighted model |
38
- | `ctrl+a` | Add a model |
39
- | `ctrl+u` | Update the highlighted model |
40
- | `ctrl+x` | Delete the highlighted model |
41
- | `ctrl+o` | Open BMS options |
42
- | `ctrl+r` | Reset usage statistics |
43
- | `esc` | Close |
23
+ | Command | Action |
24
+ | --- | --- |
25
+ | `/bms` | Open the model picker |
26
+ | `/bms-add` | Add a model |
27
+ | `/bms-options` | Open result placement, write mode, and provider options |
28
+ | `/bms-defaults` | Configure Pi and subagent defaults |
44
29
 
45
- ## Options
30
+ Inside `/bms`:
46
31
 
47
- Press `ctrl+o` in `/bms` to configure:
32
+ | Key | Action |
33
+ | --- | --- |
34
+ | ↑ / ↓ | Move through models |
35
+ | Enter | Use the selected model for this session |
36
+ | Ctrl+D | Choose effort, save as the Pi default, and use it now |
37
+ | Ctrl+G | Open the defaults menu |
38
+ | Ctrl+A / Ctrl+U / Ctrl+X | Add / update / delete a model |
39
+ | Ctrl+O | Open actions, including options and defaults |
40
+ | Ctrl+R | Reset usage ranking |
41
+ | Esc | Close |
48
42
 
49
- - **Write mode.** Overlay mode keeps Pi's `models.json` unchanged and stores
50
- BMS edits in `models.bms.json`. Direct mode writes add, update and delete
51
- operations to `models.json`.
52
- - **Provider filters.** Enable or disable providers in the `/bms` model list.
53
- These filters do not change Pi's `/model` picker or either model file.
43
+ The status column identifies the active model and saved default. Only Enter selections count toward usage ranking. Returning from a submenu preserves your search and selection. Plain menus always browse top-to-bottom; only searchable result lists reverse in above-prompt mode. Esc goes back one level, including back to Actions when that is where you entered a submenu.
54
44
 
55
- BMS stores these choices in `<agent-dir>/bms-settings.json`.
45
+ ## Default models and effort
56
46
 
57
- ## Ranking
47
+ Save a model and thinking effort for Pi, a subagent fallback, or an individual agent role.
58
48
 
59
- Every model loaded through `/bms` increments a counter in
60
- `<agent-dir>/bms-usage.json`. The list sorts by count, then by most recent use,
61
- then alphabetically — so an unused config starts in plain alphabetical order and
62
- drifts toward your habits.
49
+ - Use Ctrl+D in `/bms` for the main Pi default.
50
+ - Use `/bms-defaults` for all defaults. The menu starts in user scope; select the scope row to switch to a trusted project's settings.
51
+ - Agent model and effort overrides are independent. You can inherit the parent model while choosing a different effort.
63
52
 
64
- Only `/bms` selections count. Switching via `/model`, `ctrl+p` cycling, or a
65
- session restore does not, which keeps the ranking a record of deliberate choices
66
- rather than of how often you restart pi.
53
+ Removing an override restores the agent's own definition and fallback rules. Effort `off` is explicit, not inheritance. The menu shows saved settings and their sources, not running-child state.
67
54
 
68
- Stats for models that disappear from the effective configuration are pruned
69
- when the picker opens. `ctrl+r` clears everything.
55
+ Run `/reload` after changing agent defaults or per-model effort preferences. Existing children stay unchanged. Test Pi startup defaults in a fresh session, since resumed sessions restore their recorded model and effort.
70
56
 
71
- ## Metadata discovery
57
+ ### Optional pi-subagents integration
72
58
 
73
- When adding or updating, the extension tries to fill in context window, output
74
- cap, reasoning support and input modalities from, in order:
59
+ [pi-subagents](https://github.com/nicobailon/pi-subagents) is a separate extension. Install it only if you want subagents:
75
60
 
76
- 1. `GET {baseUrl}/model/info` — LiteLLM proxies
77
- 2. `GET {baseUrl}/models/{id}` — OpenAI-style, plus proxy-specific fields
78
- 3. The public LiteLLM model cost map on GitHub
61
+ ```bash
62
+ pi install npm:pi-subagents
63
+ ```
79
64
 
80
- Each step is best-effort. A plain OpenAI-compatible endpoint usually yields
81
- nothing from steps 1 and 2, and the flow falls back to name-based heuristics
82
- with editable defaults. Choose the default write mode from `ctrl+o` in `/bms`. Overlay mode writes to
83
- `models.bms.json`; direct mode edits Pi's `models.json`. The selected file is re-read immediately before the
84
- write so a concurrent edit in another pi session is not clobbered.
65
+ BMS discovers its agent roles and edits their saved model and effort defaults. It does not install `pi-subagents` automatically. External runner roles are read-only because their model settings belong to the runner.
85
66
 
86
- ## Paths
67
+ If discovery fails, **Agent discovery details** shows the error. Pi defaults work without this integration. See the configuration reference for compatibility details.
87
68
 
88
- All files resolve through pi's `getAgentDir()`, so `PI_CODING_AGENT_DIR` and
89
- rebranded distributions work without special handling:
69
+ ### Supported effort levels
90
70
 
91
- - `<agent-dir>/models.json` is Pi's documented compatible-endpoint configuration.
92
- - `<agent-dir>/models.bms.json` is the optional overlay owned and loaded by BMS.
93
- - `<agent-dir>/bms-settings.json` stores the write mode and provider filters.
94
- - `<agent-dir>/bms-usage.json` stores selection counters.
71
+ BMS uses provider-reported effort lists when available and Pi's capability restrictions where supplied. Otherwise it offers Pi's standard levels, marked as provider support unverified:
95
72
 
96
- Pi does not load `models.bms.json` itself. In overlay mode, BMS merges it over
97
- `models.json` by provider and model id, then registers the merged providers
98
- through Pi's extension API. If the same model exists in both files, fields from
99
- `models.bms.json` win. Existing `models.local.json` overlays from BMS 0.1.x are
100
- renamed to `models.bms.json` automatically.
73
+ ```text
74
+ off · minimal · low · medium · high · xhigh · max
75
+ ```
101
76
 
102
- Deleting a model that exists only in `models.json` leaves that file untouched.
103
- BMS writes `{ "id": "...", "bmsDeleted": true }` to the overlay instead.
104
- This tombstone keeps generated or externally managed model entries hidden across
105
- restarts. Delete it from `models.bms.json` to restore the inherited model.
77
+ Add/update also lets you edit supported levels and set a per-model preferred effort. These hints do not change Pi's provider adapters. If Pi clamps an effort, BMS asks before saving the applied level. No paid model probes are made.
106
78
 
107
- Writes are atomic using a temporary file and rename, so an interrupted write
108
- cannot truncate either configuration file.
79
+ ## Where changes are saved
109
80
 
110
- ## Development
81
+ Open Ctrl+O → Options to select the model write mode:
111
82
 
112
- ```bash
113
- npm install
114
- npm run typecheck
115
- node --experimental-strip-types --test extensions/lib/picker.test.ts
116
- pi -e . -p "say OK" # load the extension without installing it
117
- ```
83
+ | Mode | Behavior |
84
+ | --- | --- |
85
+ | Overlay, the default | Save model edits in `models.bms.json`; leave `models.json` unchanged |
86
+ | Direct | Write model edits to Pi's `models.json` |
118
87
 
119
- ## Publishing
88
+ Defaults always go into native Pi `settings.json`, regardless of write mode. User files normally live in `~/.pi/agent`; project defaults use `.pi/settings.json`. BMS respects `PI_CODING_AGENT_DIR` and shows the selected settings paths.
120
89
 
121
- Set the new version in `package.json` and `package-lock.json`, then run:
90
+ Provider filters hide entries only in `/bms`, not Pi's `/model` picker. Default-assignment menus also include authenticated Pi registry models.
122
91
 
123
- ```bash
124
- make publish
125
- ```
92
+ ## Further documentation
126
93
 
127
- The target runs the full package gate, checks npm authentication, opens npm's
128
- browser login when needed, skips the upload if that exact version already
129
- exists, publishes the public scoped package, and waits for npm to expose the
130
- new version. npm can take several minutes to process a package. If verification
131
- times out, rerun `make verify-publish`; do not publish the same version again.
94
+ - [Changelog](CHANGELOG.md): changes by version.
95
+ - [Configuration reference](docs/configuration.md): file paths, precedence, overlays, metadata, and integration limits.
96
+ - [Development and testing](docs/development.md): local loading, isolated tests, checks, and publishing.
132
97
 
133
98
  ## License
134
99
 
@@ -0,0 +1,111 @@
1
+ # Configuration reference
2
+
3
+ See the [README](../README.md) for installation and shortcuts.
4
+
5
+ ## Files
6
+
7
+ `<agent-dir>` is normally `~/.pi/agent`. BMS uses Pi's `getAgentDir()`, so it respects `PI_CODING_AGENT_DIR`.
8
+
9
+ | File | Contents |
10
+ | --- | --- |
11
+ | `<agent-dir>/models.json` | Pi model definitions |
12
+ | `<agent-dir>/models.bms.json` | BMS model overlay |
13
+ | `<agent-dir>/bms-settings.json` | Write mode, result placement, and provider filters |
14
+ | `<agent-dir>/bms-usage.json` | Selection counts and recency |
15
+ | `<agent-dir>/bms-model-metadata.json` | Effort capability hints and their source |
16
+ | `<agent-dir>/settings.json` | User defaults and per-model effort preferences |
17
+ | `<project>/.pi/settings.json` | Project defaults |
18
+
19
+ ## Model write modes
20
+
21
+ Choose the write mode through Ctrl+O → Options in `/bms`, then Ctrl+S to save.
22
+
23
+ - Overlay mode, the default, leaves `models.json` unchanged and writes edits to `models.bms.json`.
24
+ - Direct mode writes add, update, and delete operations to `models.json`.
25
+
26
+ Pi does not load the overlay itself. BMS merges it over `models.json` by provider and model ID, then registers the merged providers through Pi's extension API. Overlay fields win for duplicate models. BMS automatically renames its old `models.local.json` overlay to `models.bms.json`.
27
+
28
+ Deleting an inherited model in overlay mode writes a tombstone:
29
+
30
+ ```json
31
+ { "id": "model-id", "bmsDeleted": true }
32
+ ```
33
+
34
+ Remove that entry from `models.bms.json` to restore the inherited model. Model files are re-read before writes and saved through a temporary file and rename. This does not provide a shared lock against other applications.
35
+
36
+ Provider filters affect only `/bms`. They do not change Pi's `/model` picker or model definitions. Default-assignment menus ignore the filters and also include authenticated Pi registry models.
37
+
38
+ ## Picker layout
39
+
40
+ `bms-settings.json` accepts `resultPlacement: "below"` or `"above"`. Missing or invalid values use `"below"`, matching Pi command completion. In above mode the best match is the bottom row, immediately above search; arrow keys follow physical screen direction. Searchable assignment menus use the same preference. Forms retain their normal top-to-bottom field order.
41
+
42
+ The search field is part of a temporary custom interaction in Pi's editor area. BMS does not replace the normal editor factory. Enter loads the selected model; Esc returns to the editor. Up to six results are shown at a time, with scrolling for the rest.
43
+
44
+ ## Defaults and precedence
45
+
46
+ Default settings are independent of the model write mode.
47
+
48
+ | Setting | Native Pi settings field |
49
+ | --- | --- |
50
+ | Pi model | `defaultProvider`, `defaultModel` |
51
+ | Pi effort | `defaultThinkingLevel` |
52
+ | Per-model preferred effort | `modelThinkingLevels["provider/model"]` |
53
+ | Subagent fallback | `subagents.defaultModel`, `subagents.defaultThinking` |
54
+ | Role override | `subagents.agentOverrides.<name>.model` and `.thinking` |
55
+
56
+ The defaults menu starts in user scope. Project scope requires a trusted project. Pi defaults use the working directory's `.pi/settings.json`. Agent defaults use the project root resolved by `pi-subagents`, which may differ in nested repositories. The menu shows the paths.
57
+
58
+ Project settings and provider-specific role overrides may take precedence. BMS shows override sources and warns when a saved Pi default would be shadowed. Saving a Pi default removes the selected model's per-model effort preference in the same scope, so it cannot override the new default.
59
+
60
+ For agent roles:
61
+
62
+ - **Inherit parent model** writes `model: "inherit"`.
63
+ - **Remove model override** restores agent-definition and fallback rules.
64
+ - **Automatic** or **Remove effort override** removes that scope's effort preference. It does not force parent effort inheritance. `pi-subagents` has no separate persistent setting for that.
65
+ - **Off** is an explicit effort level, not inheritance.
66
+
67
+ Changing the Pi default also switches the main session. Subagent assignments do not switch it or increment usage counts. Cancelled or failed model switches leave saved defaults unchanged. If Pi clamps an effort, BMS asks before saving the applied level.
68
+
69
+ Run `/reload` after changing agent defaults or per-model effort preferences. Running children keep their existing configuration, and subagent model-scope policies still apply at launch. Resumed Pi sessions restore their recorded model and effort. Test startup defaults in a fresh session without CLI model or effort overrides.
70
+
71
+ Settings writes preserve unrelated fields, reject malformed JSON, and use atomic rename. A `.bms-lock` file serializes BMS settings writers only. After a crash, remove a stale lock only after checking that no BMS writer is active. Updates across model definitions, settings, and capability metadata are not a multi-file transaction.
72
+
73
+ ## Effort levels and metadata
74
+
75
+ BMS uses explicit provider effort lists when supplied, then native Pi capability restrictions where available. Otherwise it offers Pi's standard levels and labels provider support as unverified:
76
+
77
+ ```text
78
+ off, minimal, low, medium, high, xhigh, max
79
+ ```
80
+
81
+ The metadata adapter recognizes `supported_reasoning_efforts`, `supported_thinking_levels`, and `reasoning_efforts` containing Pi effort names. A generic reasoning flag or `supported_parameters: ["reasoning_effort"]` does not specify supported levels.
82
+
83
+ Add/update lets you edit the available levels and choose an optional per-model preferred effort. Non-reasoning models offer only `off`; correct the reasoning flag first if the endpoint metadata is wrong. BMS makes no paid model probes.
84
+
85
+ Capability hints guide menus. They do not change provider adapters or prove an endpoint honors a level. Pi may clamp effort or map it to a token budget. Provider errors remain visible rather than triggering a model fallback.
86
+
87
+ BMS blocks capability edits that conflict with directly pinned defaults in the inspected user/project settings. Update those defaults first. This check does not audit every inherited agent definition or settings file elsewhere on disk.
88
+
89
+ When adding or updating models, BMS tries these metadata sources in order:
90
+
91
+ 1. `GET {baseUrl}/model/info` for LiteLLM proxies.
92
+ 2. `GET {baseUrl}/models/{id}` for OpenAI-style and proxy-specific fields.
93
+ 3. The public LiteLLM model cost map on GitHub.
94
+
95
+ These requests are best-effort. Missing metadata falls back to name-based heuristics and editable defaults for context window, output limit, reasoning support, and input types.
96
+
97
+ ## Optional pi-subagents integration
98
+
99
+ [pi-subagents](https://github.com/nicobailon/pi-subagents) is a separate Pi extension. BMS configures its saved model and effort defaults; it does not install it or launch agents to discover roles.
100
+
101
+ Discovery was originally tested with `0.79.0` and has now been checked against `0.82.1`. BMS supports both the older root entry point and the newer `bundle/index.js` package layout. Discovery still uses internal discovery/runtime modules because the public agents API does not expose role discovery. Future incompatible versions may need an adapter update.
102
+
103
+ The package must be resolvable from BMS or `<agent-dir>/npm/node_modules`. Discovery includes built-in, package, user, project, and runtime roles when supported by the installed API. Untrusted project agents and settings are excluded. External runner roles are shown read-only; configure their models through the runner's own settings.
104
+
105
+ If discovery fails, the menu offers **Agent discovery details** with the error. Main Pi defaults remain usable.
106
+
107
+ ## Usage ranking
108
+
109
+ Only models loaded with Enter in `/bms` count toward ranking. BMS sorts by selection count, then recency, then alphabetically. Default assignments, `/model`, model cycling, and session restores do not count.
110
+
111
+ BMS prunes statistics for models missing from the effective configuration when the picker opens. Ctrl+R clears all usage statistics.
@@ -0,0 +1,104 @@
1
+ # Development and testing
2
+
3
+ Run these commands from the repository checkout:
4
+
5
+ ```bash
6
+ npm ci
7
+ npm run gate
8
+ npm run test:smoke # optional: installed Pi, Python 3 and a POSIX PTY required
9
+ pi --no-extensions -e ./extensions/bms.ts # temporary load; no install or publish
10
+ ```
11
+
12
+ ## Temporary local testing
13
+
14
+ Use a fresh terminal in this checkout. The command above disables installed
15
+ extensions to avoid loading two copies of BMS. It still uses your real Pi settings,
16
+ so default changes persist. For an isolated test, use a scratch agent directory
17
+ and project directory instead:
18
+
19
+ ```bash
20
+ REPO="$PWD"
21
+ SANDBOX="$(mktemp -d -t bms-local)"
22
+ mkdir -p "$SANDBOX/agent" "$SANDBOX/project/.pi"
23
+ printf '{}\n' > "$SANDBOX/project/.pi/settings.json"
24
+ # Optional: copy your model definitions. Review literal credentials in this file.
25
+ cp "${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}/models.json" "$SANDBOX/agent/models.json"
26
+ cd "$SANDBOX/project"
27
+ PI_CODING_AGENT_DIR="$SANDBOX/agent" pi --no-extensions -e "$REPO/extensions/bms.ts"
28
+ ```
29
+
30
+ Provider API-key environment variables remain available. The isolated directory
31
+ has no login credentials; use `/login` there if needed. Do not commit credentials
32
+ or scratch settings. To test agent roles, load your installed pi-subagents entry
33
+ explicitly with another `-e` and make the package resolvable in the scratch agent's
34
+ `npm/node_modules`, or use your real agent directory with backups. For the standard
35
+ Pi npm install layout with pi-subagents 0.82.1, before launching:
36
+
37
+ ```bash
38
+ REAL_AGENT="${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}"
39
+ ln -s "$REAL_AGENT/npm" "$SANDBOX/agent/npm"
40
+ PI_CODING_AGENT_DIR="$SANDBOX/agent" pi --no-extensions \
41
+ -e "$REPO/extensions/bms.ts" -e "$REAL_AGENT/npm/node_modules/pi-subagents/bundle/index.js"
42
+ ```
43
+
44
+ This symlinks installed package code, not your settings or auth files. Do not run
45
+ package installation/update commands in this sandbox, since they would modify the
46
+ shared package directory.
47
+
48
+ The automated `npm run test:smoke` uses an unreachable dummy endpoint and
49
+ throwaway settings. It checks command registration, the real TUI default-save
50
+ flow, the defaults shortcut, and restoration in a fresh Pi process. No model
51
+ prompts are sent. The regular test suite uses mocked provider metadata and UI.
52
+
53
+ Manual checks:
54
+
55
+ 1. `/bms`: filter and use Enter. Only the current session should change.
56
+ 2. Reopen `/bms`, press Ctrl+D, choose effort and confirm. Check both markers,
57
+ the footer effort, and the scratch `agent/settings.json`.
58
+ 3. Cancel the effort dialog and confirmation. Neither should change defaults.
59
+ 4. `/bms-defaults`: select a Pi model, then select the same model again to change
60
+ only its default effort. Test user and trusted-project scope.
61
+ 5. Configure a subagent fallback and a role model/effort. Confirm the parent
62
+ session stays unchanged. Test explicit model inheritance and removal of each
63
+ override, then `/reload` and inspect `/subagents-models reviewer`.
64
+ 6. Add/update a model. Check provider-reported effort lists, the unverified Pi
65
+ fallback, manual levels, and the preferred effort. Try removing a level that
66
+ a directly pinned default uses; BMS should block the conflicting edit.
67
+ 7. Exit and start a fresh Pi session with the same scratch paths. Confirm startup
68
+ model and effort. Do not use `--continue`, `--resume`, or CLI model/effort overrides.
69
+ 8. Test a narrow terminal and verify the list, wrapped hints, and search still work.
70
+
71
+ Quit Pi before deleting the sandbox with `rm -rf "$SANDBOX"`, then return to the
72
+ checkout with `cd "$REPO"`. The test commands do not publish or install BMS.
73
+
74
+ ## Publishing
75
+
76
+ Publish from `main` after the feature PR is reviewed and merged. Do not publish from the unmerged feature branch.
77
+
78
+ For the current `0.2.0` release:
79
+
80
+ ```bash
81
+ git switch main
82
+ git pull --ff-only origin main
83
+ npm ci
84
+ npm run gate
85
+ npm run test:smoke
86
+ npm pack --dry-run
87
+ ```
88
+
89
+ Check that the working tree is clean, both package manifests say `0.2.0`, and the package contains `README.md`, `docs/configuration.md`, and `docs/development.md`. Tests and the internal PR draft must not be included. The README links point to `main`, so merge the documentation before publishing.
90
+
91
+ Then publish to the public npm registry:
92
+
93
+ ```bash
94
+ make publish
95
+ ```
96
+
97
+ For later releases, update both manifests with `npm version <version> --no-git-tag-version`, and include that change in a reviewed PR before publishing.
98
+
99
+ The target runs the full package gate, checks npm authentication, opens npm's
100
+ browser login when needed, skips the upload if that exact version already
101
+ exists, publishes the public package, and waits for npm to expose the
102
+ new version. npm can take several minutes to process a package. If verification
103
+ times out, rerun `make verify-publish`; do not publish the same version again.
104
+