Repository navigation
fix(opencode): preserve user files and skill ownership on reinstall - #1914
Merged
tmchow merged 4 commits intoOct 28, 2026
Merged
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. |
Merged
tmchow
added a commit
to Quinnod345/compound-engineering-plugin
that referenced
this pull request
Oct 28, 2026
…-1916 Resolves the conflict with EveryInc#1914 in src/targets/opencode.ts: config is backed up (and a failed backup still throws) only when the merged config differs from the file on disk, and command files are backed up and rewritten only when their content changed.
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.
Fixes #1913.
OpenCode reinstalls can currently modify files through a nested user symlink, replace an existing config after its backup failed, or stop updating a skill whose source directory was loaded twice. This fixes the three ownership/preservation gaps in the existing CLI install path:
..revieware distinguished from a..traversal segment.opencode.jsonbefore cleanup or replacement. Keep normal merging and recovery from a backed-up malformed config; remove the unconditionaluser settings preservedmessage.The changes follow the preservation contract in #1094/#1100 and the config-preservation intent of #125. They do not change the native OpenCode loader or the install-manifest format.
Validation
f8d4990f, including Linux tests/typecheck, Windows, macOS, acpx contracts, docs audit, and PR title. The separate docs build also passed.bun run test: passed through the repository's built-in timeout recovery. First pass: 4,713 passed, 10 skipped, oneTimeoutErrorince-work-workspace-harness; its fresh-process rerun passed all 10 tests. Skips are the nine opt-in acpx contract cases and the unavailableompCLI.bun run typecheck,bun run release:validate, strict marketplace/plugin validation with the CI-pinned Claude Code 2.1.220, andgit diff --check: passed.c49122a4(runtime code unchanged at the final head), from a local NTFS copy: all writer/component-path cases passed (32 passed, 5 skipped: two POSIX-permission cases and three file-symlink cases unavailable in this Windows environment). The broader two-file run had 46 passes, 5 skips, and one existing repository-tree assertion failure: it expects/where WindowsBun.Globreturns\\. Replacing all five changed files with upstream00d0a5bbreproduces the same failure. An earlier run over the WSL share also timed out in two existing cases; the local-copy run completed without those timeouts. These results do not claim a fully passing native Windows suite.Security Disclosure
Extends the existing realpath containment checks to individual artifact mutations and stops OpenCode config replacement when its backup is unavailable. The tests use temporary user-file fixtures and real directory symlinks/junctions. No permission or dependency changes.
Agent Disclosure