Skip to content

fix(pi): make supervision model picker searchable and scrollable - #3099

Merged
kunchenguid merged 6 commits into
mainfrom
fm/fm-supervision-model-picker-ux-r1
Aug 26, 2026
Merged

kunchenguid merged 6 commits into
mainfrom
fm/fm-supervision-model-picker-ux-r1

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner

Intent

Fix the /supervision-model picker UX in Firstmate's Pi supervision-branch extension (.pi/extensions/fm-branch-supervision.ts) so its model list scrolls and is searchable, matching Pi's own /model picker, instead of overflowing the screen.

Captain-reported problem: running /supervision-model rendered a very long model list that overflowed the terminal with no way to search or filter it. Root cause: the command built its chooser with the generic ctx.ui.select(), whose ExtensionSelectorComponent renders every option at once with no search box.

What was asked and decided:

  • Investigate Pi's real API first and prefer reusing Pi's own exported component/primitive over hand-rolling a scroller. Pi's ModelSelectorComponent must NOT be reused: its own selection handler writes the captain's default model through Pi's settings manager, which would move main's conversation as a side effect of pinning the supervision branch, and it has no room for the 'Follow main' row or Firstmate's branch-runtime eligibility filter. The picker is therefore drawn with Pi's own SelectList (the bounded scrolling primitive behind /model), Pi's own Input for the search box, Pi's own fuzzyFilter for ranking, and DynamicBorder framing, through the extension context's ui.custom surface. Ordering and filtering live in a UI-free lib (.pi/extensions/lib/fm-branch-model-picker.ts) so they stay testable without a terminal.
  • Invariants that must not regress: 'Follow main' stays the FIRST choice (kept first even when Pi's fuzzy ranking would rank a model higher); the eligibility filter is unchanged (only models the isolated supervision-branch runtime can run with configured credentials appear - the catalog is not widened); picking a model pins ONLY the supervision branch and never changes the captain's own conversation model.
  • Non-TUI modes (rpc/json/print) have no custom-component surface, so they deliberately keep Pi's generic selector; terminal overflow is not a problem there.
  • The effort/thinking step was deliberately left as-is: its menu is a handful of Pi thinking levels, so it does not overflow and does not need a search box.
  • Out of scope by explicit instruction: no Bearings work; only the /supervision-model picker UX.

Tests: a headless driver test in tests/fm-pi-branch-extension.test.sh runs the real picker component through a scripted ui.custom, asserting the bounded visible count, 'Follow main' first, the eligibility filter, that typing narrows the list, that cancelling changes nothing, and that pinning writes only the branch config and never touches a main-model setter; a unit test of the lib's ordering/filtering including a rank-reversing filter proves 'Follow main' stays first; and a real-package guard (self-skipping when the npm package is absent) imports the installed Pi's SelectList/Input/fuzzyFilter/DynamicBorder, renders a 42-row catalog through the real SelectList, asserts it stays bounded, and fails naming the installed Pi version if a primitive disappears. Docs: docs/configuration.md (the operator-facing owner) describes the bounded searchable list and the branch-only guarantee; docs/verification/runtime-backends.md records the dated evidence. The picker component's own rendering/scrolling/key handling is Pi's code, covered by that real-package guard rather than by unit tests of Pi internals.

IMPORTANT branch state - this head is FINAL and already carries every fix this pipeline's own earlier runs applied on this branch: the stock macOS bash 3.2 compatibility rewrite of the changed test file, the escaped \0 'follow main' sentinel instead of a raw NUL byte in the source, the documentation wording, and the docs/verification wording tweak. Those earlier runs were cancelled only because each auto-fix push moved the head after the PR-body attestation was written, leaving 'PR must be raised via no-mistakes' red while every other check passed. No code was ever hand-edited. This run's purpose is to re-validate the unchanged head and re-bind the attestation to it; no further content changes are expected or wanted, and cosmetic rewording of already-accurate documentation is not a needed fix.

Delivery: no-mistakes pipeline, yolo OFF - the captain owns the merge. Escalate any ask-user finding rather than answering it.

What Changed

  • Render the TUI supervision model picker with Pi’s bounded SelectList, searchable Input, fuzzy filtering, and existing branch-runtime eligibility rules.
  • Keep “Follow main” first, preserve branch-only model pinning, and retain the generic selector for non-TUI modes.
  • Add picker ordering, filtering, interaction, and real Pi primitive coverage, plus updated operator and verification documentation.

Risk Assessment

✅ Low: The change is well-bounded, preserves eligibility and branch-only model persistence, and implements searchable bounded rendering through Pi’s supported primitives with behavior-focused coverage.

Testing

Inspected the target diff, ran the focused branch-extension regression including the real Pi-package primitive guard, and exercised the actual Pi 0.82.0 TUI end to end. The picker displayed a bounded 10-row window, filtered 16 choices to four after typing “mini,” kept Follow main first, and cancellation persisted no model or effort pin.

Evidence: Raw ANSI transcript from the real Pi TUI session

Source: Raw ANSI transcript from the real Pi TUI session

�[?2004h�[>7u�[?u�[c�[?25l�]0;π - 01M0YK48T4DXMKG3SV5C92JZ38��[?2026h�[0m�]8;;�

�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[0m�]8;;�

�[7m �[0m                                                                                                   �[0m�]8;;�

�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[38;5;182m─�[39m�[0m�]8;;�

�[38;5;60m~/.no-mistakes/worktrees/52b07e9083e7/01M0YK48T4DXMKG3SV5C92JZ38 (detached)�[39m�[0m�]8;;�

�[38;5;60m$0.000 (sub) 0.0%/272k (auto)�[39m�[38;5;60m                                     (openai-codex) gpt-5.6-luna • high�[39m�[0m�]8;;��[?2026l�[3A�[1G�[?25l�[1G�[?25l�[?2026h�[1A
�[2K�[38;5;174m────────────────────────────────────────────────────────────────────────────────────────────────────�[39m�[0m�]8;;�

�[2K �[38;5;174m�[1mSupervision branch model (now: follows main)�[22m�[39m                                                       �[0m�]8;;�

�[2K> �[7m �[27m                                                                                                 �[0m�]8;;�

�[2K�[38;5;174m→ Follow main (openai-codex/gpt-�[0m  current�[39m�[0m�]8;;�

�[2K  kimi-coding/k3�[0m�]8;;�

�[2K  kimi-coding/kimi-for-coding�[0m�]8;;�

�[2K  kimi-coding/kimi-for-coding-highspeed�[0m�]8;;�

�[2K  kimi-coding/k3-256k�[0m�]8;;�

�[2K  openai-codex/gpt-5.3-codex-spark�[0m�]8;;�

�[2K  openai-codex/gpt-5.4�[0m�]8;;�

�[2K  openai-codex/gpt-5.4-mini�[0m�]8;;�

�[2K  openai-codex/gpt-5.5�[0m�]8;;�

�[2K  openai-codex/gpt-5.6-luna�[0m�]8;;�

�[2K�[38;5;103m  (1/16)�[39m�[0m�]8;;�

�[2K �[38;5;103mtype to search - up/down navigate - enter select - esc cancel�[39m                                      �[0m�]8;;�

�[2K�[38;5;174m────────────────────────────────────────────────────────────────────────────────────────────────────�[39m�[0m�]8;;�

�[2K�[38;5;60m~/.no-mistakes/worktrees/52b07e9083e7/01M0YK48T4DXMKG3SV5C92JZ38 (detached)�[39m�[0m�]8;;�

�[2K�[38;5;60m$0.000 (sub) 0.0%/272k (auto)�[39m�[38;5;60m                                     (openai-codex) gpt-5.6-luna • high�[39m�[0m�]8;;��[?2026l�[15A�[3G�[?25l�[?2026h
�[2K> mini�[7m �[27m                                                                                             �[0m�]8;;�

�[2K�[38;5;174m→ Follow main (openai-codex/gpt-�[0m  current�[39m�[0m�]8;;�

�[2K  openai-codex/gpt-5.4-mini�[0m�]8;;�

�[2K  kimi-coding/kimi-for-coding�[0m�]8;;�

�[2K  kimi-coding/kimi-for-coding-highspeed�[0m�]8;;�

�[2K �[38;5;103mtype to search - up/down navigate - enter select - esc cancel�[39m                                      �[0m�]8;;�

�[2K�[38;5;174m────────────────────────────────────────────────────────────────────────────────────────────────────�[39m�[0m�]8;;�

�[2K�[38;5;60m~/.no-mistakes/worktrees/52b07e9083e7/01M0YK48T4DXMKG3SV5C92JZ38 (detached)�[39m�[0m�]8;;�

�[2K�[38;5;60m$0.000 (sub) 0.0%/272k (auto)�[39m�[38;5;60m                                     (openai-codex) gpt-5.6-luna • high�[39m�[0m�]8;;�

�[2K

�[2K

�[2K

�[2K

�[2K

�[2K

�[2K�[7A�[?2026l�[8A�[7G�[?25l�[7G�[?25l
Evidence: Manual verification result

Source: Manual verification result

Real Pi 0.82.0 TUI: /supervision-model opened 16 eligible choices in a 10-row scrolling window; typing "mini" narrowed it to 4 rows with Follow main first; Escape left both branch pin files absent.

Real Pi 0.82.0 TUI: /supervision-model opened 16 eligible choices in a 10-row scrolling window; typing "mini" narrowed it to 4 rows with Follow main first; Escape left both branch pin files absent.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • git status --short && git diff --stat 07bf0c8556c70b5241516efad0e51f802484c748..5878f44b7cd56122119ea91f3a67493e15416a5f
  • bash tests/fm-pi-branch-extension.test.sh
  • pi --offline --list-models
  • Real Pi 0.82.0 TUI launched in a 100×30 pseudo-terminal; opened /supervision-model, typed mini, pressed Escape, and asserted both supervision branch pin files remained absent.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (8): Last reviewed commit: "no-mistakes: apply CI fixes" | Re-trigger Greptile

Pi's generic extension selector renders every option at once with no
search box, so a real eligible catalog ran off the top of the terminal.
The model step now draws the same rows through Pi's own SelectList - the
bounded scrolling primitive behind Pi's /model picker - with Pi's own
Input and fuzzy filter above it for search, keeping 'Follow main' first,
the branch-runtime eligibility filter intact, and the pick branch-only.

Pi's ModelSelectorComponent is deliberately not reused: its selection
handler writes the captain's default model through Pi's settings manager,
which would move main's conversation as a side effect of pinning the
branch. The effort step's menu is a handful of levels and stays on Pi's
plain selector dialog.
@kunchenguid
kunchenguid force-pushed the fm/fm-supervision-model-picker-ux-r1 branch from a12df8f to 903bb86 Compare August 26, 2026 08:05
@kunchenguid kunchenguid changed the title fix(pi): make supervision model picker bounded and searchable fix(pi): make supervision model picker searchable and bounded Aug 26, 2026
@kunchenguid kunchenguid changed the title fix(pi): make supervision model picker searchable and bounded fix(pi): make supervision model picker searchable and scrollable Aug 26, 2026
@kunchenguid
kunchenguid force-pushed the fm/fm-supervision-model-picker-ux-r1 branch from 6359ae2 to 5878f44 Compare August 26, 2026 19:06
@kunchenguid
kunchenguid merged commit 5aed873 into main Aug 26, 2026
27 of 28 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-supervision-model-picker-ux-r1 branch August 26, 2026 19:49