feat: expand nuke into a full codedb uninstall#239
Conversation
There was a problem hiding this comment.
💡 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
| const line = std.mem.trimRight(u8, content[line_start..line_end], "\r"); | ||
| if (std.mem.eql(u8, line, header)) { | ||
| var remove_start = line_start; |
There was a problem hiding this comment.
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
| const content = std.fs.cwd().readFileAlloc(allocator, path, 64 * 1024) catch |err| switch (err) { | ||
| error.FileNotFound => return false, | ||
| else => return err, | ||
| }; |
There was a problem hiding this comment.
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 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
5e0100a to
9381fd7
Compare
Benchmark Regression ReportThreshold: 10.00%
|
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
codedb nukeinto a real uninstall path that removes the installed binary, snapshots, cache data, and MCP registrationscodedbentries from Claude, Gemini, Cursor, and Codex config files while leaving other MCP servers intactVerification
codedb nukeverifying 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/-hregression fix already under review