Repository navigation
fix: safely migrate legacy Pi and OpenCode integration names - #41
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52c8f7ef8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| symlinkPointsTo(legacyNamedPath, [v1.source, legacyV1Source]) || | ||
| isV1Symlink(legacyNamedPath) |
There was a problem hiding this comment.
Remove links to the original OpenCode source
Handle users upgrading directly from the pre-rename installer, which created opencode-tmux.ts pointing to <checkout>/plugin/opencode-tmux.ts. Neither this source list nor isV1Symlink recognizes that historical path, and its checkout used the old opencode-tmux package name. If the old checkout remains after changing the TPM reference, OpenCode keeps loading the old plugin alongside the new one; an in-place upgrade instead leaves a dangling alias.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in the latest commit: migration now recognizes the original plugin/opencode-tmux.ts source, including verified previous checkouts named opencode-tmux or coding-agents-tmux. Added regression coverage for both OpenCode generations, in-place dangling aliases, live/broken previous-checkout links, and preservation when package metadata is missing, malformed, or unrelated. All 284 tests pass.
| # Never traverse a user-managed directory symlink or remove custom files. | ||
| legacy_dir="$pi_dir/extensions/opencode-tmux" | ||
| legacy_target="$legacy_dir/index.ts" | ||
| if [ ! -L "$legacy_dir" ] && [ -L "$legacy_target" ] && [ "$(readlink "$legacy_target")" = "$extension_source" ]; then |
There was a problem hiding this comment.
Migrate Pi links from the previous checkout
Handle the documented migration where changing the TPM plugin reference installs the renamed repository into a new checkout directory. The project-created legacy link still points to <old-checkout>/plugin/pi-tmux.ts, so this exact string comparison rejects it and Pi auto-loads both the legacy extension and the newly installed one. The ownership check needs to recognize a verified managed target from the previous checkout as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in the latest commit: Pi cleanup now resolves the symlink and verifies the exact plugin/pi-tmux.ts path plus checkout package identity (opencode-tmux or coding-agents-tmux), rather than requiring the current checkout path. Regression tests cover previous checkout names, relative and broken links, wrong package/path, missing metadata, user files, and symlinked extension directories. All 284 tests pass.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
extensions/opencode-tmux/index.tssymlink only when it points to this checkout's bundled extension; remove its directory only if emptyplugins/opencode-tmux.tssymlinks only when the target is a verified managed pluginValidation
npm test— 283 tests passednpm run typechecknpm run lintnpm run fmt:checknpm run shell:checknpm run shell:fmt:checkshellcheck --shell=bash coding-agents-tmux.tmuxNo changes have been applied to the live TPM install or user extension directories.