[PR #3919] [MERGED] fix(setup): deduplicate selected clients before planning #5964

Closed
opened 2026-10-31 01:10:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3919
Author: @Afloat16
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @morluto

Base: main ← Head: fix/setup-client-identity


📝 Commits (1)

  • 587fb22 fix(setup): deduplicate selected clients before planning

📊 Changes

3 files changed (+147 additions, -5 deletions)

View changed files

📝 src/application/Setup.planning.test.ts (+57 -0)
📝 src/application/Setup.ts (+9 -5)
➕ tests/acceptance/setup/repeatedClientSetup.test.ts (+81 -0)

📄 Description

Summary

Repeated --client selections currently produce duplicate setup actions. With --client cursor --client codex --client cursor, the second Cursor configuration can overwrite its reported result, obscuring the operation that actually ran. Normalize selected identities once in runSetupWorkflow, preserving first-selected order before planning, default skill selection, readiness and apply.

Refs https://github.com/morluto/rea/discussions/3847, candidate 20. This is an independently reviewable fix, separate from the other candidates.

Contract and boundary impact

  • Owner: initial client selection in the shared application workflow; covers CLI and direct callers without a downstream repair.
  • Ordinary fix within existing setup authority; no new provider or advance scope decision applies.
  • Existing CLI/MCP shapes and registration formats remain; duplicate selections now produce one ordered action and one truthful result per client.
  • Setup still reads and, only under its existing approval path, writes selected configuration files. Tests use isolated HOME/USERPROFILE paths with skill/Hopper installation disabled. Actual client launches and provider installation were not exercised.
  • Package/release metadata and tracked generated files are unchanged.

Evidence and validation

Node 24.18.0, npm 11.16.0; locked dependencies.

  • New direct-workflow regressions against the base: 2 fail / 23 existing pass, with repeated action IDs. Patched source: 25 pass.
  • Official npm run compile:termux and skill generation pass. The exact test runner then passes 26 tests, including a real compiled CLI dry-run/apply/rerun journey: unique ordered actions, no-write preview, configured statuses and unchanged repeat execution.
  • node --max-old-space-size=3072 node_modules/typescript6/lib/tsc.js --noEmit, npm run lint, npm run knip, npm run metadata:check, npm run verify:architecture-guards, changed-file formatting and git diff --check pass. Test discovery finds all 1,318 files exactly once.
  • Prepared npm pack --dry-run --ignore-scripts passes after the official JavaScript build and skill freshness check (1,671 files). A prepared package-verifier run with process-scoped npm_config_ignore_scripts=true passes archive, isolated installation/update, MCP startup/module loading and discovery stages, then fails during artifact-stage cleanup with ENOTEMPTY. Its remaining setup/uninstall/evidence stages are not verified; the exact owned test directory was subsequently removed successfully.

Gate limitations: standard npm run check, npm run verify:package and ordinary npm pack --dry-run cannot complete here: the pinned native TypeScript 7 compiler panics because /proc/self/exe is unavailable. The full repository format check also fails in untouched HTML workers because uv_resident_set_memory is unavailable; changed TypeScript files pass formatting. A 2 GiB JavaScript typecheck attempt exhausted its heap; the bounded 3 GiB run above passes. These fallback checks do not establish a passing native gate or full package verifier. No real Cursor/Codex application or optional provider run is claimed. Telemetry is disabled for subsequent checks.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3919 **Author:** [@Afloat16](https://github.com/Afloat16) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/setup-client-identity` --- ### 📝 Commits (1) - [`587fb22`](https://github.com/morluto/rea/commit/587fb22e2f58ff031cfcec1ccbcc99d98a48f1ba) fix(setup): deduplicate selected clients before planning ### 📊 Changes **3 files changed** (+147 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/application/Setup.planning.test.ts` (+57 -0) 📝 `src/application/Setup.ts` (+9 -5) ➕ `tests/acceptance/setup/repeatedClientSetup.test.ts` (+81 -0) </details> ### 📄 Description ## Summary Repeated `--client` selections currently produce duplicate setup actions. With `--client cursor --client codex --client cursor`, the second Cursor configuration can overwrite its reported result, obscuring the operation that actually ran. Normalize selected identities once in `runSetupWorkflow`, preserving first-selected order before planning, default skill selection, readiness and apply. Refs https://github.com/morluto/rea/discussions/3847, candidate 20. This is an independently reviewable fix, separate from the other candidates. ## Contract and boundary impact - Owner: initial client selection in the shared application workflow; covers CLI and direct callers without a downstream repair. - Ordinary fix within existing setup authority; no new provider or advance scope decision applies. - Existing CLI/MCP shapes and registration formats remain; duplicate selections now produce one ordered action and one truthful result per client. - Setup still reads and, only under its existing approval path, writes selected configuration files. Tests use isolated HOME/USERPROFILE paths with skill/Hopper installation disabled. Actual client launches and provider installation were not exercised. - Package/release metadata and tracked generated files are unchanged. ## Evidence and validation Node 24.18.0, npm 11.16.0; locked dependencies. - New direct-workflow regressions against the base: **2 fail / 23 existing pass**, with repeated action IDs. Patched source: **25 pass**. - Official `npm run compile:termux` and skill generation pass. The exact test runner then passes **26 tests**, including a real compiled CLI dry-run/apply/rerun journey: unique ordered actions, no-write preview, configured statuses and unchanged repeat execution. - `node --max-old-space-size=3072 node_modules/typescript6/lib/tsc.js --noEmit`, `npm run lint`, `npm run knip`, `npm run metadata:check`, `npm run verify:architecture-guards`, changed-file formatting and `git diff --check` pass. Test discovery finds all 1,318 files exactly once. - Prepared `npm pack --dry-run --ignore-scripts` passes after the official JavaScript build and skill freshness check (1,671 files). A prepared package-verifier run with process-scoped `npm_config_ignore_scripts=true` passes archive, isolated installation/update, MCP startup/module loading and discovery stages, then fails during artifact-stage cleanup with ENOTEMPTY. Its remaining setup/uninstall/evidence stages are **not verified**; the exact owned test directory was subsequently removed successfully. **Gate limitations:** standard `npm run check`, `npm run verify:package` and ordinary `npm pack --dry-run` cannot complete here: the pinned native TypeScript 7 compiler panics because `/proc/self/exe` is unavailable. The full repository format check also fails in untouched HTML workers because `uv_resident_set_memory` is unavailable; changed TypeScript files pass formatting. A 2 GiB JavaScript typecheck attempt exhausted its heap; the bounded 3 GiB run above passes. These fallback checks do not establish a passing native gate or full package verifier. No real Cursor/Codex application or optional provider run is claimed. Telemetry is disabled for subsequent checks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:10:46 +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#5964
No description provided.