Skip to content

fix(cli): abort install/uninstall when existing config cannot be parsed - #35

Merged
Dhravya merged 2 commits into
mainfrom
Dhravya/pr-34-review-cleaner-fix
Aug 8, 2026
Merged

fix(cli): abort install/uninstall when existing config cannot be parsed#35
Dhravya merged 2 commits into
mainfrom
Dhravya/pr-34-review-cleaner-fix

Conversation

@Dhravya

@Dhravya Dhravya commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Abort install / uninstall when existing config.toml or hooks.json cannot be parsed, instead of rewriting from an empty object (fixes data-loss risk in Install/uninstall can overwrite Codex config when config parsing fails #33).
  • Keep the normal path: parse the user's file, merge our keys in, write back.
  • Apply the same fail-closed behavior when writing supermemory.json install defaults.
  • Validate Codex config files before install/uninstall mutations begin.
  • Publish to npm automatically on merges to main (patch bump + publish; no tag/release trigger).

Supersedes the approach in #34 with a simpler parse-and-merge + abort-on-parse-fail fix.

Test plan

  • npm test (includes new regression tests)
  • Manually: break ~/.codex/config.toml syntax → install exits non-zero and leaves the file untouched
  • Manually: valid config with extra keys → install merges codex_hooks without dropping other settings
  • After merge: confirm Publish Package workflow bumps patch, publishes to npm, and pushes chore(release): x.y.z
  • Confirm npm trusted publishing is allowed for the main branch workflow (not only v* tags)

Parse and merge into the user's Codex config instead of silently rewriting from empty on TOML/JSON errors, and apply the same fail-closed write path for supermemory.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Dhravya Dhravya changed the title Read legacy OpenCode memory containers fix(cli): abort install/uninstall when existing config cannot be parsed Aug 8, 2026

Dhravya commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Replace tag-triggered publishes with a main-branch workflow that bumps the patch version, publishes, and commits the bump back.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Dhravya
Dhravya merged commit 26bbfa5 into main Aug 8, 2026
3 checks passed
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