[GH-ISSUE #1164] [Bug] Malformed client configuration does not stop uninstall's later removals #407

Closed
opened 2026-10-15 18:24:49 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1164

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Setup, packaging, or upgrade

Observed behavior

docs/installation.md says malformed client configuration stops rea uninstall. When one client's configuration is malformed, uninstall instead reports that client as failed and keeps going: it removes other clients' REA registrations, the bundled skill directory, and (with --purge-data) REA's cache and state, then returns an overall failed status. The user is left with a partially uninstalled environment after an operation the documentation says would have stopped.

Exit 1 with "status": "failed" and these items:

{"name":"codex","status":"failed","detail":"Configuration is not valid TOML and was not changed. Repair it, then rerun uninstall."}
{"name":"cursor","status":"removed","detail":"Removed registration from $TRIAL_HOME/.cursor/mcp.json."}
{"name":"skill","status":"removed","detail":"Removed $TRIAL_HOME/.agents/skills/reverse-engineer-anything."}
{"name":"cache","status":"removed","detail":"Removed $TRIAL_HOME/.rea/cache."}
{"name":"state","status":"removed","detail":"Removed $TRIAL_HOME/.rea/state."}

Cursor's rea entry is gone (other remains), and all three marker files are deleted. The malformed Codex file is left unchanged. Reproduced twice in fresh trial homes on the npm release and once on the main build, with identical results.

Reproduction

Run in a disposable home:

TRIAL_HOME="$(mktemp -d)"
rea_trial() { env -u CLAUDE_CONFIG_DIR -u CODEX_HOME -u COPILOT_HOME -u OPENCODE_CONFIG -u XDG_CONFIG_HOME -u GROK_HOME -u SAND_DATA_ROOT HOME="$TRIAL_HOME" npx -y rea-agents@6.1.0 "$@"; }
mkdir -p "$TRIAL_HOME/.codex" "$TRIAL_HOME/.cursor" "$TRIAL_HOME/.agents/skills/reverse-engineer-anything" "$TRIAL_HOME/.rea/cache" "$TRIAL_HOME/.rea/state"
printf '[mcp_servers.rea]\ncommand = [broken\n' > "$TRIAL_HOME/.codex/config.toml"
printf '%s\n' '{"mcpServers":{"rea":{"command":"npx","args":["-y","rea-agents@6.1.0","mcp"]},"other":{"command":"echo","args":["hello"]}}}' > "$TRIAL_HOME/.cursor/mcp.json"
echo skill > "$TRIAL_HOME/.agents/skills/reverse-engineer-anything/marker.txt"
echo cache > "$TRIAL_HOME/.rea/cache/marker.txt"
echo state > "$TRIAL_HOME/.rea/state/marker.txt"
rea_trial uninstall --purge-data --json; echo "exit=$?"
cat "$TRIAL_HOME/.cursor/mcp.json"
ls "$TRIAL_HOME/.agents/skills" "$TRIAL_HOME/.rea"

Expected behavior

docs/installation.md (uninstall section): "Purging removes only REA's cache and state under ~/.rea; malformed client configuration or purge-path symlinks stop the operation." With malformed Codex TOML present, uninstall should stop without removing the Cursor registration, the skill, or the cache and state, and report the malformed file so the user can repair it and rerun.

Impact and scope

A failure the documentation says stops the operation instead leaves a partially uninstalled environment; every removal is within the scope the user asked to uninstall, so nothing outside REA is lost.

Workaround: Repairing or moving aside the malformed client configuration before running uninstall avoids the partial state; the files involved are user-visible and the error names the file.

REA version

rea-agents@6.1.0 from npm, and main at 089bbf58f3 built locally with npm ci && npm run build:cached.

Runtime and platform

Node v24.21.0, macOS 27.0.1 (26A434), arm64.

Target and artifact context

Client configurations (Codex TOML malformed, Cursor JSON valid), bundled skill, ~/.rea cache/state

Interface

Package or setup

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

  • Expected source: docs/installation.md, uninstall section, the sentence quoted under Expected behavior (unchanged on the main build).
  • Failure source: the uninstall JSON and filesystem state quoted under Observed behavior.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Typed outcome or recovery expected

Failing now: with the fixture above, uninstall exits 1 and the Cursor registration, skill marker, and cache/state markers are gone. Restored: uninstall stops on the malformed Codex file, reports it, and the Cursor registration, skill marker, and cache/state markers remain in place. Control: with valid configurations, uninstall --purge-data still removes every REA registration, the skill, and cache/state while preserving unrelated servers and skills.

Analysis or suspected cause

Source-derived, not verified by a patch: src/application/Uninstall.ts, runUninstall, loops over every client, then calls the skill removal and optional purge, and only afterwards derives the overall status from the collected items.

Additional context

Found while exercising typical REA workflows on macOS with rea-agents@6.1.0; each case was reproduced on the npm release and on a local build of main, and re-checked on main at 6a1e558db3 just before filing.

Originally created by @coygeek on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1164 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Setup, packaging, or upgrade ### Observed behavior `docs/installation.md` says malformed client configuration stops `rea uninstall`. When one client's configuration is malformed, uninstall instead reports that client as failed and keeps going: it removes other clients' REA registrations, the bundled skill directory, and (with `--purge-data`) REA's cache and state, then returns an overall `failed` status. The user is left with a partially uninstalled environment after an operation the documentation says would have stopped. Exit 1 with `"status": "failed"` and these items: ```json {"name":"codex","status":"failed","detail":"Configuration is not valid TOML and was not changed. Repair it, then rerun uninstall."} {"name":"cursor","status":"removed","detail":"Removed registration from $TRIAL_HOME/.cursor/mcp.json."} {"name":"skill","status":"removed","detail":"Removed $TRIAL_HOME/.agents/skills/reverse-engineer-anything."} {"name":"cache","status":"removed","detail":"Removed $TRIAL_HOME/.rea/cache."} {"name":"state","status":"removed","detail":"Removed $TRIAL_HOME/.rea/state."} ``` Cursor's `rea` entry is gone (`other` remains), and all three marker files are deleted. The malformed Codex file is left unchanged. Reproduced twice in fresh trial homes on the npm release and once on the `main` build, with identical results. ### Reproduction Run in a disposable home: ```sh TRIAL_HOME="$(mktemp -d)" rea_trial() { env -u CLAUDE_CONFIG_DIR -u CODEX_HOME -u COPILOT_HOME -u OPENCODE_CONFIG -u XDG_CONFIG_HOME -u GROK_HOME -u SAND_DATA_ROOT HOME="$TRIAL_HOME" npx -y rea-agents@6.1.0 "$@"; } mkdir -p "$TRIAL_HOME/.codex" "$TRIAL_HOME/.cursor" "$TRIAL_HOME/.agents/skills/reverse-engineer-anything" "$TRIAL_HOME/.rea/cache" "$TRIAL_HOME/.rea/state" printf '[mcp_servers.rea]\ncommand = [broken\n' > "$TRIAL_HOME/.codex/config.toml" printf '%s\n' '{"mcpServers":{"rea":{"command":"npx","args":["-y","rea-agents@6.1.0","mcp"]},"other":{"command":"echo","args":["hello"]}}}' > "$TRIAL_HOME/.cursor/mcp.json" echo skill > "$TRIAL_HOME/.agents/skills/reverse-engineer-anything/marker.txt" echo cache > "$TRIAL_HOME/.rea/cache/marker.txt" echo state > "$TRIAL_HOME/.rea/state/marker.txt" rea_trial uninstall --purge-data --json; echo "exit=$?" cat "$TRIAL_HOME/.cursor/mcp.json" ls "$TRIAL_HOME/.agents/skills" "$TRIAL_HOME/.rea" ``` ### Expected behavior `docs/installation.md` (uninstall section): "Purging removes only REA's cache and state under `~/.rea`; malformed client configuration or purge-path symlinks stop the operation." With malformed Codex TOML present, uninstall should stop without removing the Cursor registration, the skill, or the cache and state, and report the malformed file so the user can repair it and rerun. ### Impact and scope A failure the documentation says stops the operation instead leaves a partially uninstalled environment; every removal is within the scope the user asked to uninstall, so nothing outside REA is lost. Workaround: Repairing or moving aside the malformed client configuration before running uninstall avoids the partial state; the files involved are user-visible and the error names the file. ### REA version `rea-agents@6.1.0` from npm, and `main` at 089bbf58f3561e3f465c544bbcf8c307287b1256 built locally with `npm ci && npm run build:cached`. ### Runtime and platform Node v24.21.0, macOS 27.0.1 (26A434), arm64. ### Target and artifact context Client configurations (Codex TOML malformed, Cursor JSON valid), bundled skill, `~/.rea` cache/state ### Interface Package or setup ### Earliest failure stage Cleanup, cancellation, or lifecycle ### Relevant output or evidence - Expected source: `docs/installation.md`, uninstall section, the sentence quoted under Expected behavior (unchanged on the `main` build). - Failure source: the uninstall JSON and filesystem state quoted under Observed behavior. - Evidence provenance: observed - Local verification: reproduced - Reproduction completeness: complete ### Typed outcome or recovery expected Failing now: with the fixture above, uninstall exits 1 and the Cursor registration, skill marker, and cache/state markers are gone. Restored: uninstall stops on the malformed Codex file, reports it, and the Cursor registration, skill marker, and cache/state markers remain in place. Control: with valid configurations, `uninstall --purge-data` still removes every REA registration, the skill, and cache/state while preserving unrelated servers and skills. ### Analysis or suspected cause Source-derived, not verified by a patch: `src/application/Uninstall.ts`, `runUninstall`, loops over every client, then calls the skill removal and optional purge, and only afterwards derives the overall status from the collected items. ### Additional context Found while exercising typical REA workflows on macOS with `rea-agents@6.1.0`; each case was reproduced on the npm release and on a local build of `main`, and re-checked on `main` at 6a1e558db3ec2b69561e91ea817f1c2065dfc676 just before filing.
bsakaguchi 2026-10-15 18:24:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#407
No description provided.