fix(install): skip duplicate Codex MCP registration on repeat init - #117
Open
syf2211 wants to merge 1 commit into
Open
fix(install): skip duplicate Codex MCP registration on repeat init#117syf2211 wants to merge 1 commit into
syf2211 wants to merge 1 commit into
Conversation
Wire `codex mcp list --json` as ListArgv and parse the JSON output so repeat `guild init --yes` runs detect an existing guild entry and skip re-adding it, matching Claude/Cursor idempotency. Fixes mathomhaus#14. Includes regression tests for JSON parsing and the Codex skip path.
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
Wire
codex mcp list --jsoninto the MCP install pre-check so repeatguild init --yesruns detect an existingguildentry and skip re-adding it, matching Claude/Cursor idempotency.Fixes #14
Motivation
Codex's
mcp addsucceeds on duplicate entries (unlikeclaude mcp add, which errors with "already exists"). Without a list probe,guild initcould registerguildtwice in Codex's MCP config.Changes
ListArgvfor Codex (codex mcp list --json) inclients.goscanGuildFromCodexJSON, integrated intoscanForGuildEntryTests
go test ./internal/install/... -count=1All install package tests pass (including new
TestScanForGuildEntry_CodexJSONandTestMCPInstall_Run_SkipsAlreadyRegistered_Codex).Notes
guildentries are detected as registered but return an empty command path, so they fall through to install (same as unparseable human-format lines). This is unlikely fromguild init, which always registers a stdio launcher.