Conversation
…t on every start The legacy-dir migration renamed ~/.pi/agent, ~/.pi/mom and <cwd>/.pi into the branded layout on every launch. On a machine that also runs upstream pi, each `senpi`/`omo` start silently emptied the real pi install, so the two could not coexist. Official .pi directories are now copied once (missing entries only, nothing overwritten), gated by a `.migrated-from-pi` marker in the destination. This matches the rule brand-dir-migration.ts already applies to ~/.senpi. Leftovers nested inside the fork's own config directory keep the move behaviour, since no other install reads them.
TykanN
force-pushed
the
fix/keep-official-pi-dir
branch
from
September 9, 2026 16:32
a7d38e6 to
5ba4db6
Compare
4 tasks
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.
Problem
legacy-senpi-dir-migration.tsruns on every start (runMigrations) andrenameSyncs~/.pi/agent,~/.pi/momand<cwd>/.piinto the branded layout (~/.senpi/agent,~/.omo/agent, …). When the destination already exists it moves every entry that is missing there.On a machine that also runs upstream pi (
@earendil-works/pi-coding-agent), this empties the real pi install:omolaunch →~/.pi/agent/{extensions,skills,models.json,auth.json,…}are moved to~/.omo/agent/, leaving~/.pi/agentempty. mtimes are preserved, so it is a rename, not a copy.~/.pi/agentis moved again on the next launch../.pi→./.omo.So pi and a branded fork cannot coexist.
brand-dir-migration.tsalready states the opposite rule for~/.senpi→ brand dir: "COPIED once - never moved - because the same machine may keep running the engine standalone, and a move would silently empty that install." The.pipath just never got the same treatment. From the history (1ea83112b,9a71aae8) the move was meant for the fork's own pre-rename state in~/.pi, not for upstream pi users.Fix
.pisources (~/.pi/agent,~/.pi/mom,<cwd>/.pi) are now copied once: missing entries only, nothing overwritten, and a.migrated-from-pimarker written into the destination short-circuits later starts. The original directory is left untouched.<config>/.pi/agent,<config>/.pi/mom,<cwd>/<config>/.pi) keep the existing move behaviour; nobody else reads those.brand-dir-migration.ts.Tests
senpi-migration.test.ts: the first case now asserts copy-once semantics (originals still exist, nested extension dir copied, marker written in all three destinations).~/.pi/agentfiles.changes.mdentry added per the fork contract.Behaviour change to be aware of
Users who relied on the migration moving their
~/.piinto the branded dir will now get a copy and keep the original. That is the intended outcome of this PR; if the maintainers would rather gate the copy on something (e.g. only when the brand dir does not exist yet), happy to adjust.Summary by cubic
Fixes the legacy directory migration so branded agents copy official
~/.pistate into the branded layout once instead of moving it on every start, letting upstream pi and branded forks coexist on one machine..pidirectories are now copied once and left untouched; a.migrated-from-pimarker skips later starts.~/.pidirectory.Written for commit 5ba4db6. Summary will update on new commits.