Skip to content

feat: expand nuke into a full codedb uninstall#239

Merged
justrach merged 3 commits intomainfrom
feat/nuke-uninstall
Apr 11, 2026
Merged

feat: expand nuke into a full codedb uninstall#239
justrach merged 3 commits intomainfrom
feat/nuke-uninstall

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

  • turn codedb nuke into a real uninstall path that removes the installed binary, snapshots, cache data, and MCP registrations
  • strip codedb entries from Claude, Gemini, Cursor, and Codex config files while leaving other MCP servers intact
  • add focused tests and document the stronger uninstall behavior in the README

Verification

  • zig build
  • zig test src/tests.zig --test-filter 'nuke:'\n- zig test src/tests.zig --test-filter 'issue-150:'\n- zig build test\n- disposable HOME end-to-end run of codedb nuke verifying binary/cache/snapshot/config cleanup\n\n## Notes\n- stacked on fix: restore help CLI build and exit behavior #238 so CI includes the help/-h regression fix already under review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60860cef48

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

src/main.zig Outdated
Comment on lines +962 to +964
const line = std.mem.trimRight(u8, content[line_start..line_end], "\r");
if (std.mem.eql(u8, line, header)) {
var remove_start = line_start;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match Codex table header after trimming TOML whitespace

The uninstall parser only removes the Codex block when a line is exactly [mcp_servers.codedb], because it compares line verbatim after trimming only \r. Valid TOML headers can include leading spaces or inline comments (for example [mcp_servers.codedb] # local override), so those real-world configs will not be deregistered and codedb nuke leaves a stale MCP entry pointing to a removed binary.

Useful? React with 👍 / 👎.

src/main.zig Outdated
Comment on lines +893 to +896
const content = std.fs.cwd().readFileAlloc(allocator, path, 64 * 1024) catch |err| switch (err) {
error.FileNotFound => return false,
else => return err,
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove fixed 64 KiB cap when reading integration configs

Config reads are hard-limited to 64 * 1024 bytes, so any larger integration file returns error.FileTooBig; that error is then swallowed by callers (catch false), which silently skips deregistration. In those cases codedb nuke reports success but leaves codedb entries in user config, so integrations remain broken after uninstall.

Useful? React with 👍 / 👎.

@justrach
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@justrach justrach changed the base branch from fix/help-compile-regression to main April 11, 2026 15:27
@justrach justrach force-pushed the feat/nuke-uninstall branch from 5e0100a to 9381fd7 Compare April 11, 2026 15:37
@github-actions
Copy link
Copy Markdown

Benchmark Regression Report

Threshold: 10.00%

Tool Base (ns) Head (ns) Delta Status
codedb_bundle 690854 708250 +2.52% OK
codedb_changes 107447 107888 +0.41% OK
codedb_deps 30701 29996 -2.30% OK
codedb_edit 21410 18520 -13.50% OK
codedb_find 138780 146662 +5.68% OK
codedb_hot 146402 148241 +1.26% OK
codedb_outline 447952 427536 -4.56% OK
codedb_read 175908 154557 -12.14% OK
codedb_search 295329 301797 +2.19% OK
codedb_snapshot 4252316 4266844 +0.34% OK
codedb_status 256951 251757 -2.02% OK
codedb_symbol 62064 62011 -0.09% OK
codedb_tree 92983 87235 -6.18% OK
codedb_word 89737 90192 +0.51% OK

@justrach justrach merged commit 6a7408b into main Apr 11, 2026
1 check passed
@justrach justrach deleted the feat/nuke-uninstall branch April 11, 2026 15:39
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9381fd74c1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

while (remove_end < content.len) {
const next_end = std.mem.indexOfScalarPos(u8, content, remove_end, '\n') orelse content.len;
const next_line = trimTomlLineForHeader(content[remove_end..next_end]);
if (next_line.len > 0 and next_line[0] == '[') break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove nested codedb tables when stripping Codex config

removeCodexMcpServerBlock stops deleting as soon as it sees the next TOML header, so a config that includes nested sections like [mcp_servers.codedb.env] leaves those blocks behind. In TOML, nested headers implicitly recreate mcp_servers.codedb, so codedb nuke can still leave a live/stale codedb registration in ~/.codex/config.toml for users who added nested settings under the codedb server.

Useful? React with 👍 / 👎.

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