[PR #1504] [MERGED] fix(setup): honor active client configuration and skill roots #2924

Closed
opened 2026-10-17 21:11:52 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: codex/fix-client-profile-resolution


📝 Commits (7)

  • 225c730 refactor(setup): resolve skill destinations per client
  • 1a5a0ee fix(setup): honor active client configuration and skill roots
  • 15aa970 merge: integrate Pi and Hermes client support from main
  • 5a810ee fix(setup): validate effective client scopes and Gemini trust
  • b7f5440 merge: update client integration fixes with main
  • dfe448f fix(setup): treat empty OpenCode overrides as unset
  • 137d3eb Merge remote-tracking branch 'origin/main' into codex/fix-client-profile-resolution

📊 Changes

14 files changed (+1562 additions, -61 deletions)

View changed files

📝 docs/installation.md (+30 -7)
📝 scripts/verify-package-environment.mjs (+4 -0)
📝 src/application/ClientConfigurationDocument.ts (+42 -0)
➕ src/application/ClientConfigurationFiles.ts (+108 -0)
📝 src/application/ClientRegistrationStatus.ts (+59 -12)
➕ src/application/GeminiClientSettings.ts (+202 -0)
📝 src/application/SetupClientConfiguration.ts (+65 -1)
📝 src/application/SetupHost.ts (+12 -6)
📝 src/application/SupportedClients.ts (+157 -27)
📝 src/application/Uninstall.ts (+75 -3)
📝 tests/acceptance/setup/piClientSetup.test.ts (+13 -3)
➕ tests/boundary/cli/clientProfiles.test.ts (+786 -0)
📝 tests/boundary/filesystem/ompClientConfiguration.test.ts (+2 -2)
📝 tests/fixtures/clientEnvironment.ts (+7 -0)

📄 Description

Summary

Setup could report ready after writing configuration or skills the selected client never reads. Doctor could overlook a higher-priority disabled or managed registration, and uninstall could expose an older registration. This corrects the confirmed client integration failures from the maintainer audit; no separate issue was opened for the grouped correction.

Problem and expected behavior

GEMINI_CLI_HOME=/profiles/work must select that home's settings and skills. OpenCode must inspect its normal global files even with OPENCODE_CONFIG_DIR set, then apply explicit/custom-file precedence. Gemini must account for trusted workspace policies and same-name system server overrides before reporting readiness.

Setup plans and changes user-owned registration files only. A conflicting immutable registration or blocking policy returns needs_human with no planned/applied actions and a source-specific remediation. Doctor reports the conflict rather than aligned. Uninstall removes owned OpenCode registrations from every applicable user file.

Change and scope

  • Honor Gemini's selected home and skill root; consolidate user/default/system/trusted-workspace MCP allow/exclude policies. Evaluate persisted folder trust, explicit trust/restricted-mode overrides and effective folder-trust settings without granting trust.
  • Treat Gemini mcpServers as a shallow merge: a winning workspace/system entry replaces the entire user entry. Block a conflicting definition; accept an identical one; retain the source path.
  • Preserve OpenCode's normal XDG global configuration with custom directories, its JSON/JSONC and explicit-file precedence, malformed-source failures, and multi-file owned cleanup.
  • Correct empty Codex/Grok home overrides, relative OMP directories, Devin XDG selection, and Antigravity's personal skill destination.
  • Match downloaded Grok's actual enablement behavior: entry-level disabled=true is ignored; enabled=false and the root denylist still disable it.
  • Integrate current main, including merged Pi/Hermes support. Adapt Pi assertions to the shared relative OMP path rather than assuming doctor has exactly one registration.

No new client adapter, model request, analysis-provider change, or dependency change. MiniMax was inspected separately below; this PR does not advertise automatic MiniMax registration.

Contract and boundary impact

  • Semantic owner and earliest changed stage: supported-client path metadata and source-aware configuration/trust loading.
  • CLI and MCP/tool-catalog contract: existing setup/doctor/uninstall commands and client identifiers; no analysis-tool/catalog changes.
  • Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; existing platform selection retained.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: planned approval, backups, idempotency and owned uninstall retained. Workspace/system settings and trust are read-only.
  • Generated metadata, package, or installation impact: corrected active configuration/skill roots; no version bump or generated artifacts committed.

Evidence and regression coverage

  • Public CLI regression journeys cover seven affected integrations, Gemini policy consolidation/managed definitions/persisted and explicit trust, OpenCode custom-plus-global cleanup, malformed files, backups, preservation, and repeat behavior.

  • Previous base reproductions reported ready/healthy for wrong roots or suppressed registrations. New tests assert the effective paths and reject conflicts before writes.

  • Representative blocked output: status: "needs_human", empty actions, and a named mcp.allowed, mcp.excluded, or mcpServers.rea source remediation.

  • Downloaded exact npm artifacts and inspected their shipped implementations: Gemini CLI 0.63.0, Grok Build 1.0.50, MiniMax Code 0.6.5. All runtime probes used isolated homes without authentication or model calls.

  • Unmodified public Gemini CLI connected to REA and enabled the installed shared skill. Native Grok completed a real MCP handshake and discovered 139 REA tools and its skill. Installed MiniMax's unmodified runtime also discovered 139 REA tools and cataloged the skill; its public ACP session creation requires login, so that authenticated journey was not claimed.

  • Gemini workspace/trust probes execute the shipped loader. Managed merger probes supply scopes to its unchanged settings class; they do not establish privileged managed-file loading.

  • Remaining gaps: no Windows/Linux native harness session, IDE-only trust, model turn, or analysis-provider run. Gemini 0.63.0 additionally skips managed files failing OS ownership/permission checks; REA conservatively considers configured managed paths and can request manual review for a file that release ignores. MiniMax has no REA setup adapter; external-skill disabling hides its shared skill root. Its accepted relative data-directory override later fails in native plan initialization.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

On macOS, Node 24.18.0 / npm 11.16.0:

  • npm run test:focused -- with 16 client/setup/registration test files — 228 passed.
  • npm run check — passed: types, lint/module boundaries, formatting, Knip, metadata and architecture guards.
  • npm run docs:check — passed.
  • npm run verify:package — passed, including installed CLI/MCP, setup/uninstall/backups, bundled skill and Skills 1.7.2 discovery; 139 tools.
  • npm pack --dry-run — passed.
  • Actual downloaded harness workflows and controlled loader probes described above — passed within their stated scope.

Compatibility, safety, and release

  • Breaking changes or migration: no command/identifier removal; rerun setup under the intended client environment to repair old installations.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS CLI/package/harness workflows; provider behavior unchanged.
  • Package/release metadata impact: no version bump; ignored build/evidence outputs excluded.
  • Security/privacy/process review: no credentials/model calls, ambient environment persistence, administrator/workspace writes, trust grants, or unrelated software installation. Malformed sources stop setup before writes; unrelated registrations/settings remain intact.

Review checklist

  • Concrete problem and focused Conventional Commit title.
  • Grouped audit explains why no separate issue was linked.
  • Observable behavior, meaningful failures and owning docs covered.
  • Representative CLI output and native proof limits included.
  • Final diff checked for secrets, unrelated cleanup and unsupported claims.

🔄 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/1504 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/fix-client-profile-resolution` --- ### 📝 Commits (7) - [`225c730`](https://github.com/morluto/rea/commit/225c730a526e7eeed70241a3a2e817160b66274a) refactor(setup): resolve skill destinations per client - [`1a5a0ee`](https://github.com/morluto/rea/commit/1a5a0ee946410b87a5cf1a9c7c9540f03339ebaf) fix(setup): honor active client configuration and skill roots - [`15aa970`](https://github.com/morluto/rea/commit/15aa970a09d37e66bc294c47802e853091dff3ee) merge: integrate Pi and Hermes client support from main - [`5a810ee`](https://github.com/morluto/rea/commit/5a810eed971173dc29cd256af045f6fd504ffb2c) fix(setup): validate effective client scopes and Gemini trust - [`b7f5440`](https://github.com/morluto/rea/commit/b7f5440052ddd5dae541bdc1ad34c4804c5f9dd4) merge: update client integration fixes with main - [`dfe448f`](https://github.com/morluto/rea/commit/dfe448fc09a68115f9fc8e38886f4b9f711996cf) fix(setup): treat empty OpenCode overrides as unset - [`137d3eb`](https://github.com/morluto/rea/commit/137d3eb8539160efaec6ed21710e92306bb93571) Merge remote-tracking branch 'origin/main' into codex/fix-client-profile-resolution ### 📊 Changes **14 files changed** (+1562 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+30 -7) 📝 `scripts/verify-package-environment.mjs` (+4 -0) 📝 `src/application/ClientConfigurationDocument.ts` (+42 -0) ➕ `src/application/ClientConfigurationFiles.ts` (+108 -0) 📝 `src/application/ClientRegistrationStatus.ts` (+59 -12) ➕ `src/application/GeminiClientSettings.ts` (+202 -0) 📝 `src/application/SetupClientConfiguration.ts` (+65 -1) 📝 `src/application/SetupHost.ts` (+12 -6) 📝 `src/application/SupportedClients.ts` (+157 -27) 📝 `src/application/Uninstall.ts` (+75 -3) 📝 `tests/acceptance/setup/piClientSetup.test.ts` (+13 -3) ➕ `tests/boundary/cli/clientProfiles.test.ts` (+786 -0) 📝 `tests/boundary/filesystem/ompClientConfiguration.test.ts` (+2 -2) 📝 `tests/fixtures/clientEnvironment.ts` (+7 -0) </details> ### 📄 Description ## Summary Setup could report ready after writing configuration or skills the selected client never reads. Doctor could overlook a higher-priority disabled or managed registration, and uninstall could expose an older registration. This corrects the confirmed client integration failures from the maintainer audit; no separate issue was opened for the grouped correction. ## Problem and expected behavior `GEMINI_CLI_HOME=/profiles/work` must select that home's settings and skills. OpenCode must inspect its normal global files even with `OPENCODE_CONFIG_DIR` set, then apply explicit/custom-file precedence. Gemini must account for trusted workspace policies and same-name system server overrides before reporting readiness. Setup plans and changes user-owned registration files only. A conflicting immutable registration or blocking policy returns `needs_human` with no planned/applied actions and a source-specific remediation. Doctor reports the conflict rather than aligned. Uninstall removes owned OpenCode registrations from every applicable user file. ## Change and scope - Honor Gemini's selected home and skill root; consolidate user/default/system/trusted-workspace MCP allow/exclude policies. Evaluate persisted folder trust, explicit trust/restricted-mode overrides and effective folder-trust settings without granting trust. - Treat Gemini `mcpServers` as a shallow merge: a winning workspace/system entry replaces the entire user entry. Block a conflicting definition; accept an identical one; retain the source path. - Preserve OpenCode's normal XDG global configuration with custom directories, its JSON/JSONC and explicit-file precedence, malformed-source failures, and multi-file owned cleanup. - Correct empty Codex/Grok home overrides, relative OMP directories, Devin XDG selection, and Antigravity's personal skill destination. - Match downloaded Grok's actual enablement behavior: entry-level `disabled=true` is ignored; `enabled=false` and the root denylist still disable it. - Integrate current main, including merged Pi/Hermes support. Adapt Pi assertions to the shared relative OMP path rather than assuming doctor has exactly one registration. No new client adapter, model request, analysis-provider change, or dependency change. MiniMax was inspected separately below; this PR does not advertise automatic MiniMax registration. ## Contract and boundary impact - Semantic owner and earliest changed stage: supported-client path metadata and source-aware configuration/trust loading. - CLI and MCP/tool-catalog contract: existing setup/doctor/uninstall commands and client identifiers; no analysis-tool/catalog changes. - Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; existing platform selection retained. - Evidence, artifact, provenance, or reconstruction contract: none. - Process execution, authorization, cleanup, or containment impact: planned approval, backups, idempotency and owned uninstall retained. Workspace/system settings and trust are read-only. - Generated metadata, package, or installation impact: corrected active configuration/skill roots; no version bump or generated artifacts committed. ## Evidence and regression coverage - Public CLI regression journeys cover seven affected integrations, Gemini policy consolidation/managed definitions/persisted and explicit trust, OpenCode custom-plus-global cleanup, malformed files, backups, preservation, and repeat behavior. - Previous base reproductions reported ready/healthy for wrong roots or suppressed registrations. New tests assert the effective paths and reject conflicts before writes. - Representative blocked output: `status: "needs_human"`, empty actions, and a named `mcp.allowed`, `mcp.excluded`, or `mcpServers.rea` source remediation. - Downloaded exact npm artifacts and inspected their shipped implementations: Gemini CLI 0.63.0, Grok Build 1.0.50, MiniMax Code 0.6.5. All runtime probes used isolated homes without authentication or model calls. - Unmodified public Gemini CLI connected to REA and enabled the installed shared skill. Native Grok completed a real MCP handshake and discovered 139 REA tools and its skill. Installed MiniMax's unmodified runtime also discovered 139 REA tools and cataloged the skill; its public ACP session creation requires login, so that authenticated journey was not claimed. - Gemini workspace/trust probes execute the shipped loader. Managed merger probes supply scopes to its unchanged settings class; they do not establish privileged managed-file loading. - Remaining gaps: no Windows/Linux native harness session, IDE-only trust, model turn, or analysis-provider run. Gemini 0.63.0 additionally skips managed files failing OS ownership/permission checks; REA conservatively considers configured managed paths and can request manual review for a file that release ignores. MiniMax has no REA setup adapter; external-skill disabling hides its shared skill root. Its accepted relative data-directory override later fails in native plan initialization. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed On macOS, Node 24.18.0 / npm 11.16.0: - `npm run test:focused --` with 16 client/setup/registration test files — 228 passed. - `npm run check` — passed: types, lint/module boundaries, formatting, Knip, metadata and architecture guards. - `npm run docs:check` — passed. - `npm run verify:package` — passed, including installed CLI/MCP, setup/uninstall/backups, bundled skill and Skills 1.7.2 discovery; 139 tools. - `npm pack --dry-run` — passed. - Actual downloaded harness workflows and controlled loader probes described above — passed within their stated scope. ## Compatibility, safety, and release - Breaking changes or migration: no command/identifier removal; rerun setup under the intended client environment to repair old installations. - Real Hopper/Ghidra, browser, or OS coverage: macOS CLI/package/harness workflows; provider behavior unchanged. - Package/release metadata impact: no version bump; ignored build/evidence outputs excluded. - Security/privacy/process review: no credentials/model calls, ambient environment persistence, administrator/workspace writes, trust grants, or unrelated software installation. Malformed sources stop setup before writes; unrelated registrations/settings remain intact. ## Review checklist - [x] Concrete problem and focused Conventional Commit title. - [x] Grouped audit explains why no separate issue was linked. - [x] Observable behavior, meaningful failures and owning docs covered. - [x] Representative CLI output and native proof limits included. - [x] Final diff checked for secrets, unrelated cleanup and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:52 +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#2924
No description provided.