Skip to content

fix(uninstall): preserve layered OpenCode registrations - #7969

Merged
morluto merged 4 commits into
mainfrom
codex/opencode-layered-uninstall-7321
Oct 29, 2026
Merged

morluto merged 4 commits into
mainfrom
codex/opencode-layered-uninstall-7321

Conversation

@morluto

@morluto morluto commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Problem and change

Fixes #7321. Removing an owned OpenCode registration from one user configuration layer could activate a foreign fallback in another layer. An upper foreign entry can also depend on fields inherited from the owned lower entry. Uninstall now preflights the effective layered configuration using the existing removal and merge owners and refuses before changes when removing an owned fragment would alter a foreign or unresolved effective registration.

Validation

  • 71 focused CLI, filesystem and lifecycle tests passed on macOS with Node 24.22.1. They cover foreign fallback, inherited foreign fragments, unchanged self-contained foreign entries, absent fallback, and refusal before changes or backups to other selected clients.
  • npm run check:fast and git diff --check passed. An independent controlled reproduction confirmed the foreign merged-fragment case remains unchanged.
  • No OpenCode client was launched. Concurrent changes to a peer layer between preflight and publication were not verified.

Review follow-up: the layered preflight also applies when removing an owned V1 entry beside a V2 table. The new legacy/foreign-fragment regression failed before the fix and passes now; 72 focused tests and check:fast passed. An independent controlled reproduction confirmed the effective foreign entry and both files remain unchanged. Real OpenCode and concurrent peer-layer edits remain unverified.

Author readiness

Human owner: NOT_ENOUGH_INFO

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T02:06:55.922019Z 3167609 New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge, with no new blocking findings.

Summary

Uninstall now checks OpenCode’s combined configuration before removing owned registrations.

  • OpenCode uninstall keeps layered foreign registrations unchanged.

No new actionable issues were found. Source review confirms the previous legacy-removal finding is fixed. Tests were inspected, not run. Whether another PR supersedes this one could not be checked because GitHub access was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Inspect selected configurations] --> B[Compare combined OpenCode registration before and after removal]
  B --> C{Foreign registration activated or changed?}
  C -->|Yes| D[Refuse before changes or backups]
  C -->|No| E[Finish all remaining checks]
  E --> F[Remove owned entries with backups]
Loading

Reviews (3) · Last reviewed commit: "Merge branch 'main' into codex/opencode-..." · Reviewed by Greptile

Comment thread src/application/Uninstall.ts Resolved
@morluto
morluto merged commit 953a768 into main Oct 29, 2026
4 checks passed
@morluto
morluto deleted the codex/opencode-layered-uninstall-7321 branch October 29, 2026 02:07
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Uninstall misses the OpenCode V1 fallback preflight when entries occupy different user files

1 participant