fix(sync): defer reset_runtime_state until codex CLI recovery path is viable#60
Open
chdendi wants to merge 1 commit intotaptap:mainfrom
Open
fix(sync): defer reset_runtime_state until codex CLI recovery path is viable#60chdendi wants to merge 1 commit intotaptap:mainfrom
chdendi wants to merge 1 commit intotaptap:mainfrom
Conversation
… viable
ensure_remote_marketplace previously deleted the existing clone_path and
cache_root before checking that codex CLI is available and supports
'marketplace add'. In offline runs, on legacy CLI versions, or when codex
is missing entirely, this destroyed a recoverable working state without
being able to re-register the marketplace.
Reorder so the destructive reset only fires after has_codex and
resolve_marketplace_cli('add') both succeed. The early-return paths now
explicitly note that the existing clone/cache is preserved when the
state was abnormal but recovery is not currently possible.
Bump sync plugin to 0.1.31 and marketplace metadata to 0.1.41.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
ensure_remote_marketplacepreviously calledreset_runtime_state()(whichrm -rfsclone_pathandcache_root) before verifying the recovery path was viable. In offline runs, on legacy Codex CLI versions, or when codex isn't on PATH at all, this destroyed the user's working clone/cache without being able to re-register the marketplace.has_codexandresolve_marketplace_cli("add")succeed. The early-return paths now explicitly note that the existing clone/cache is preserved when state was abnormal but recovery is not currently possible.plugins/syncto0.1.31(claude + codex plugin.json + marketplace entry) andmarketplace.jsonmetadata.versionto0.1.41per.claude/rules/versioning.md.Failure scenarios this fixes
State must be one of
local_or_mismatched | broken_remote | unknown_cloneto enter the affected branch. Previously, in that branch:addnetwork call fails → clone/cache already gone, user has nothing until the next online session.resolve_marketplace_cli("add")returns[]→ function returns early, but clone/cache already deleted.has_codexcheck, but clone/cache already deleted.After this change, all three paths leave the existing clone/cache intact and surface a warning explaining the situation.
Test plan
bash tests/validate.shpasses locally (all checks PASS).