Skip to content

fix: safely migrate legacy Pi and OpenCode integration names - #41

Merged
corwinm merged 2 commits into
mainfrom
fix/legacy-integration-cleanup
Oct 12, 2026
Merged

corwinm merged 2 commits into
mainfrom
fix/legacy-integration-cleanup

Conversation

@corwinm

@corwinm corwinm commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove the legacy Pi extensions/opencode-tmux/index.ts symlink only when it points to this checkout's bundled extension; remove its directory only if empty
  • Remove old-name OpenCode plugins/opencode-tmux.ts symlinks only when the target is a verified managed plugin
  • Preserve custom files, unrelated links, and symlinked Pi directories
  • Document migration behavior and the need to restart existing Pi sessions

Validation

  • npm test — 283 tests passed
  • npm run typecheck
  • npm run lint
  • npm run fmt:check
  • npm run shell:check
  • npm run shell:fmt:check
  • shellcheck --shell=bash coding-agents-tmux.tmux
  • Regression tests cover migration, idempotence, relative and broken OpenCode links, preservation of user files and unrelated links, and symlinked Pi directories

No changes have been applied to the live TPM install or user extension directories.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T02:18:23.361086Z 1abcb53 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/core/opencode-install.ts Outdated
Comment on lines +161 to +162
symlinkPointsTo(legacyNamedPath, [v1.source, legacyV1Source]) ||
isV1Symlink(legacyNamedPath)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread coding-agents-tmux.tmux Outdated
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@corwinm

corwinm commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 1abcb535be

ℹ️ 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".

@corwinm
corwinm merged commit 48ebbbd into main Oct 12, 2026
1 check passed
@corwinm
corwinm deleted the fix/legacy-integration-cleanup branch October 12, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant