Repository navigation
fix(pi): restore the session's mode after OMP session switches - #1050
Merged
DietrichGebert merged 2 commits intoOct 13, 2026
Merged
Conversation
Contributor
Author
|
A review-only companion PR with the identical diff is at andrebrait#1. |
This was referenced Oct 6, 2026
andrebrait
force-pushed
the
fix/pi-extension-omp-compat
branch
from
October 8, 2026 08:37
a019912 to
6e8823a
Compare
andrebrait
added a commit
to andrebrait/ponytail
that referenced
this pull request
Oct 8, 2026
… session switches Squashed from origin/fix/pi-extension-omp-compat (6e8823a) onto upstream/main.
OMP keeps Pi's legacy session_switch and session_branch events instead of re-emitting session_start on /new, /resume, /fork and /branch, so a new session inherited the previous session's mode. Restore the mode on those events, like session_tree.
andrebrait
force-pushed
the
fix/pi-extension-omp-compat
branch
from
October 10, 2026 07:25
6e8823a to
f8a7c60
Compare
andrebrait
added a commit
to andrebrait/ponytail
that referenced
this pull request
Oct 10, 2026
… session switches Squashed from origin/fix/pi-extension-omp-compat (f8a7c60) onto upstream/main.
Owner
|
Thanks! Tested it over RPC with OMP 18.10.3 and pi 0.73.1: on main a new OMP session kept the old level, with this PR it starts at the default and switching back restores the old one; pi behaves the same as before. Merged, will be in the next release. |
Merged
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
The shared Pi extension loads in oh-my-pi (OMP), but after
/new,/resumeor/forka session keeps the previous session's mode. Pi re-emitssession_starton those transitions. OMP emits only the legacysession_switchandsession_branchevents, which the extension ignored.This registers those two events next to the existing
session_treehandler. All three call the samerestoreSessionMode. Nothing else changes, and no OMP-only code is added.Pi compatibility
Pi 0.85.1 never emits
session_switchorsession_branch(its changelog says it replaced them withsession_startplus areason), so the new handlers do nothing there. Older Pi versions that still emitsession_switchget the same fix. The restore is idempotent and appends no entries.Verification
session_switchandsession_branchrestore the target session's mode, including the default for an empty new session. It fails without the fix.node --test tests/*.test.jspasses 127 tests, andnpm test --prefix pi-extensionpasses 29./ponytail lite, prompt,new_session, prompt, switch back to the first session, prompt. The table shows the level injected into each prompt.