Repository navigation
feat(pi): select OhMyPi model presets per thread - #80
Conversation
OhMyPi presets set every role model, but neither Pi RPC nor ACP exposes them. Pi discovery now lists omp presets as models, and a thread on a preset starts omp with a per-session --config overlay, so switching presets never touches omp's global config.
Preset thinking 'auto' now applies, literal model ids win over thinking suffixes, invalid thinking levels drop the preset, config reads honor --profile and time out on their own.
Message dispatch never consults planSelectionTransition, so preset switches from the composer could not rely on a session restart. Every omp session now launches with its own overlay, which the adapter rewrites when the selected preset changes. Presets need a default role.
The overlay's preset is tracked separately from the applied model, so returning to the previous selection after a failed set_model clears or rewrites the overlay. Context-window lookups only answer for the applied preset.
…ssion A preset without a level falls back to the session's configured level, a switch marks thinking unknown so Pi default can restore it after a partial failure, and resume or rollback forget the applied preset.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks for adding thread-local OhMyPi presets and covering the recovery paths alongside normal model switching. OverviewSummaryThis adds preset discovery to the Pi model catalog, applies role configuration through per-session overlays rather than global config, and lets background generation use a preset's main model. I recommend requesting changes for three boundary cases affecting session startup, context budgeting, and discovery fallback. Good points🟢 The failed-switch regression verifies that a rejected Main Issues⚫️ Bound overlay filenames — ⚫️ Resolve preset capacity before budgeting — ⚫️ Separate discovery deadlines — Additional NotesValidation was limited to static inspection; tests were not run. |
Probing the binary with --version added a process that Pi replay fixtures do not expect, and per-session overlay names could exceed NAME_MAX. omp reads overlays from PI_CONFIG_FILES and plain Pi ignores it, so every session gets a short-named overlay there with no probe.
Thread registration on a preset maps every preset to its main model, so handoff budgeting sees the right capacity before startTurn applies the preset. Adds a regression for long session ids, whose overlay names are now bounded.
A preset read that started late in the 30-second discovery window could be cut off by it, discarding the discovered models. Presets are now read after discovery succeeds, under their own soft timeout.
|
Thanks for tightening the session-overlay launch path and addressing the filename-length issue from the earlier review. OverviewSummaryThis follow-up bounds overlay filenames and moves overlay configuration from Good points🟢 Main IssuesNo new findings to add for this push. Additional NotesValidation was limited to static inspection; tests were not run. |
|
Thanks, @Fryuni, for following up on overlay startup and first-turn context budgeting. OverviewSummaryThis push bounds overlay filenames, passes overlays through Good points🟢 Preset mappings are populated during registration and consulted by capacity lookups before a preset runs ( Main IssuesNo new issues identified in this push. Previously reported issues outside the push scope are not repeated here. Additional NotesValidation was limited to static inspection; tests were not run. |
|
Thanks for following through on the earlier feedback and adding regressions for the boundary cases. OverviewSummaryThis push addresses the three earlier concerns: bounded overlay filenames ( Good points🟢 The pre-turn context-window regression checks a different preset from the initially selected one, covering lookup before either preset is applied ( Main IssuesNone found in this follow-up push. Additional NotesValidation was limited to static inspection; tests were not run. |
|
Thanks for following through on the remaining context-budgeting and discovery-timeout fixes, and for adding targeted regression coverage. OverviewSummaryThis follow-up resolves preset-to-model mappings during thread registration, before the first turn, and moves optional preset discovery outside the RPC discovery deadline. These changes address the two remaining requests from the earlier review. I found no new blockers and recommend merging based on static inspection. Good points🟢 Main IssuesNo new actionable findings in this push. Additional NotesValidation was limited to static inspection; tests were not run. |
Problem
OhMyPi (
omp) model presets set the model for every role (default,task,plan,smol, …) plus a thinking level, but neither the Pi RPC bridge nor omp's ACP mode exposes them. Inside T3 Code, an omp thread could only change its main model. omp's own/modelpreset switchwrites the user's global config, and every running omp reloads it, so using it would switch every thread and the user's terminal at once.Change
All within
packages/provider-pi; no contract, client, or orchestration changes.omp/<version>, discovery readsomp config get modelPresets --jsonand lists each preset as a modelpreset:<name>with a "Preset" qualifier. Its Thinking select comes from the preset's main model, with "Auto" for omp'sauto. Config reads pass the instance's--profileand time out on their own, so a slow read loses only the presets, not the discovered models. Presets omp would reject, or that have nodefaultrole, are left out.PI_CONFIG_FILES. omp reads it like--config, and plain Pi ignores it. It stays empty until a turn selects a preset. Selecting a preset re-reads it from omp and rewrites the overlay (atomic rename). The overlay holds the preset's roles,nulltombstones for roles it leaves out (as/modelpreset switchclears them), and its thinking level. The turn then sets the main model and thinking over RPC. Selecting a plain model empties the overlay. omp's global config is never written.message.dispatchnever consultsplanSelectionTransition. Overlay state is tracked separately from the applied model, so a failed switch is repaired by the next selection.docs/user/providers-pi.mdgains an "OhMyPi Model Presets" section.Out of scope, filed as #79: omp slash-command autocomplete and
command_outputrendering in the Pi provider.Scope and approval
Requested by the maintainer (@Fryuni). The design (Pi RPC rather than ACP or a native provider, per-thread overlay, presets as picker entries) was agreed in a grilling session before implementation.
Verification
Focused tests in
presets.test.ts,status.test.ts,textGeneration.test.ts, andadapter.test.tscover:autothinking, thinking abbreviations, and the configured-level fallback after a resume;--profileforwarding and the stalled-read timeout.All 141 provider-pi tests pass, and
vp run check:changedis green.Live checks against the maintainer's omp 18.5.1, with
~/.omp/agent/config.ymlchecksum unchanged afterwards:--configand viaPI_CONFIG_FILES.All 8 Pi replay fixtures in
PiReplayFixtures.integration.test.tspass locally.Reviewed in five rounds by GPT-6.1 Sol reviewers; the final round was confident on every slice.
Not checked: a real T3 client rendering the picker (no UI code changed; existing
subProviderrendering is reused), Windows, and omp aliases (@slow) as a preset's main model, which fail with a clear error by design.Known limit: omp reloads a rewritten overlay about 200ms later. The main model and thinking switch immediately over RPC, and role models switch from the next role lookup.
Implemented by Claude Opus 5.5 in Claude Code (T3 Code harness), reviewed by GPT-6.1 Sol via Codex.
🤖 Generated with Claude Code