You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(claude): extract uninstallMcpServer + cover the file-deletion edge cases (#629)
* feat(claude): gx claude install auto-registers the gx MCP server in .mcp.json
The gx mcp agent radar only helps if agents have it registered; manual
`claude mcp add` per machine meant nobody turned it on. Now `gx claude install`
wires it into the repo alongside settings/hooks/commands.
- installMcpServer merges { mcpServers.gx: { command: gx, args: [mcp, serve] } }
into the target .mcp.json without clobbering other servers; idempotent.
- --no-mcp opts out.
- gx claude check warns when missing; doctor (check --fix) repairs via install.
- gx claude uninstall removes the gx server (drops .mcp.json if only ours).
- AGENTS.md repo-wiring bullet + usage updated.
Tests: 4 new (create/merge/idempotent/dry-run) in claude-install.test.js, 18/18;
no-new-failures vs base.
* test(claude): extract uninstallMcpServer + cover the file-deletion edge cases
Addresses review note: the uninstall path (the error-prone 'delete file only if
it held nothing but ours' guard) had no coverage. Extracted uninstallMcpServer
so it is unit-testable; added 4 tests including the {$schema, mcpServers:{gx}}
case where an unrelated top-level key must block file deletion. 22/22 pass.
---------
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
This change is complete only when **all** of the following are true:
4
+
5
+
- Every checkbox below is checked.
6
+
- The agent branch reaches `MERGED` state on `origin` and the PR URL + state are recorded in the completion handoff.
7
+
- If any step blocks (test failure, conflict, ambiguous result), append a `BLOCKED:` line under section 4 explaining the blocker and **STOP**. Do not tick remaining cleanup boxes; do not silently skip the cleanup pipeline.
8
+
9
+
## Handoff
10
+
11
+
- Handoff: change=`agent-claude-gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56`; branch=`agent/<your-name>/<branch-slug>`; scope=`TODO`; action=`continue this sandbox or finish cleanup after a usage-limit/manual takeover`.
12
+
- Copy prompt: Continue `agent-claude-gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56` on branch `agent/<your-name>/<branch-slug>`. Work inside the existing sandbox, review `openspec/changes/agent-claude-gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56/tasks.md`, continue from the current state instead of creating a new sandbox, and when the work is done run `gx branch finish --branch agent/<your-name>/<branch-slug> --base dev --via-pr --wait-for-merge --cleanup`.
13
+
14
+
## 1. Specification
15
+
16
+
-[x] 1.1 Finalize proposal scope and acceptance criteria for `agent-claude-gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56`.
17
+
-[x] 1.2 Define normative requirements in `specs/gx-claude-install-auto-registers-gx-mcp-server-in-target-mcp-json/spec.md`.
18
+
19
+
## 2. Implementation
20
+
21
+
-[x] 2.1 Implement scoped behavior changes.
22
+
-[x] 2.2 Add/update focused regression coverage.
23
+
24
+
## 3. Verification
25
+
26
+
-[x] 3.1 Run targeted project verification commands.
27
+
-[x] 3.2 Run `openspec validate agent-claude-gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56 --type change --strict`.
28
+
-[x] 3.3 Run `openspec validate --specs`.
29
+
30
+
## 4. Cleanup (mandatory; run before claiming completion)
31
+
32
+
-[ ] 4.1 Run the cleanup pipeline: `gx branch finish --branch agent/<your-name>/<branch-slug> --base dev --via-pr --wait-for-merge --cleanup`. This handles commit -> push -> PR create -> merge wait -> worktree prune in one invocation.
33
+
-[ ] 4.2 Record the PR URL and final merge state (`MERGED`) in the completion handoff.
34
+
-[ ] 4.3 Confirm the sandbox worktree is gone (`git worktree list` no longer shows the agent path; `git branch -a` shows no surviving local/remote refs for the branch).
0 commit comments