Skip to content

fix(uninstall): protect ZCode fallback registrations - #7970

Merged
morluto merged 1 commit into
mainfrom
codex/zcode-uninstall-fallback
Oct 29, 2026
Merged

morluto merged 1 commit into
mainfrom
codex/zcode-uninstall-fallback

Conversation

@morluto

@morluto morluto commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Problem and change

When uninstall removes the last REA-owned native ZCode server, ZCode can switch to its fallback server table. A foreign or unrelated server in that table can become active even though uninstall reported success. The preflight now checks the whole fallback table before removing the last native entry and refuses before writes when retained servers would become active or the fallback cannot be interpreted. Owned-only fallback removal and nonempty native tables remain supported.

Found during the related OpenCode fallback review in #7969; no separate issue was found.

Validation

  • 32 focused ZCode filesystem tests passed on macOS with Node 24.22.1, covering foreign REA and unrelated fallback servers, malformed fallback, unaffected native entries, and preflight before other client changes or backups.
  • npm run check:fast and git diff --check passed. Independent source review found no material defect.
  • Tests use real local configuration files but no real ZCode client. Concurrent fallback edits between preflight and publication were not verified.

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-29T01:56:22.776699Z 19ccaa6 PR opened
ℹ️ 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 changed code appears safe to merge; no blocking defect was found.

Summary

This PR checks ZCode’s fallback table before uninstall removes its last native server.

  • ZCode uninstall checks the fallback before removing its last native server.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Inspect ZCode removal] --> B{Removing last native server?}
  B -->|No| F[Continue existing preflight]
  B -->|Yes| C[Read fallback table]
  C -->|Missing| F
  C -->|Cannot read or parse| E[Refuse before writes]
  C -->|Parsed| D{Servers remain after owned REA removal?}
  D -->|Yes| E
  D -->|No| F
  F --> G{Any preflight failure?}
  G -->|Yes| E
  G -->|No| H[Remove owned registrations with backups]
Loading

Reviews (1) · Last reviewed commit: "fix(uninstall): preserve inactive ZCode ..." · Reviewed by Greptile

@morluto
morluto merged commit 3dcb40d into main Oct 29, 2026
3 of 5 checks passed
@morluto
morluto deleted the codex/zcode-uninstall-fallback branch October 29, 2026 02:05
@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.

1 participant