[PR #5126] [MERGED] fix(setup): treat empty APPDATA as unset for VS Code, Trae and Devin #6778

Closed
opened 2026-11-01 21:42:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5126
Author: @vaidehi-snk
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @morluto

Base: main ← Head: fix/windows-empty-appdata


📝 Commits (1)

  • a57ee78 fix(setup): treat empty APPDATA as unset for VS Code, Trae and Devin

📊 Changes

2 files changed (+37 additions, -12 deletions)

View changed files

📝 src/application/SupportedClients.ts (+7 -12)
➕ tests/boundary/filesystem/windowsAppDataClientPaths.test.ts (+30 -0)

📄 Description

Summary

Fixes #5104. On Windows, an empty APPDATA made setup resolve relative configuration paths for VS Code, Trae and Devin, so their registrations were written under the working directory instead of %USERPROFILE%\AppData\Roaming. AI-assisted (Claude, claude-opus-5-5); I reviewed, ran and verified the change.

Problem and expected behavior

vscodeUserDirectory, traeUserDirectory and devinDirectory used env.APPDATA ?? join(home, "AppData", "Roaming"). Nullish coalescing keeps "", so join("", "Code", "User") becomes the relative path Code/User. REA's shared windowsAppDataRoots already defines an empty APPDATA as unset. Expected: an empty APPDATA selects the default roaming root, exactly like an unset one.

Change and scope

The three helpers now use windowsAppDataRoots(home, env).roaming, the existing owner of this rule, instead of re-implementing the fallback. Behavior with APPDATA unset or non-empty is unchanged. Scope decision: not applicable (ordinary fix within existing boundaries). Not included: cleanup of files already misplaced by earlier runs.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/application/SupportedClients.ts, Windows client path selection

  • Contribution scope fit and linked maintainer decision: ordinary fix; not applicable

  • CLI and MCP/tool-catalog contract: unchanged

  • Provider, bridge, target-format, or platform compatibility: Windows only; empty APPDATA now resolves to %USERPROFILE%\AppData\Roaming

  • Evidence, artifact, provenance, or reconstruction contract: none

  • Target selection, authority, upstream behavior, and cleanup details: not applicable

  • Generated metadata, package, or installation impact: setup writes VS Code, Trae and Devin registrations to the default roaming root when APPDATA is empty

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/windowsAppDataClientPaths.test.ts — for vscode, trae and devin with platform: "win32", an empty APPDATA resolves the same config path as an unset one

  • Base reproduction or other evidence: with SupportedClients.ts reverted, all 3 cases fail, e.g. Expected: "C:\Users\a/AppData/Roaming/Code/User/mcp.json", Received: "Code/User/mcp.json"

  • User-visible CLI/MCP output (if applicable): not exercised

  • Remaining proof gaps: not run on native Windows or through full rea setup; tested at the path-selection boundary with an injected win32 platform

  • 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

  • npx vitest run tests/boundary/filesystem/windowsAppDataClientPaths.test.ts — 3 passed
  • same with SupportedClients.ts stashed — 3 failed
  • npx vitest run on traeClientConfiguration, clientConfigurationDialects, setupConfig, clientLifecycle and claudeDesktopClientConfiguration tests — 139 passed
  • npx oxfmt --check on changed files — clean
  • npx oxlint on changed files — 0 errors; 1 existing max-lines warning on SupportedClients.ts (file was already over the limit; this change makes it 5 lines shorter)
  • npx tsc --noEmit — clean
  • pre-push check:fast (typecheck, lint) — 2 tasks successful

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Registrations previously misplaced under a working directory are not removed automatically.
  • Real Hopper/Ghidra, browser, or OS coverage: no native Windows run
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: setup no longer writes client configuration into an arbitrary working directory

Author readiness

Human owner: @vaidehi-snk

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff 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/5126 **Author:** [@vaidehi-snk](https://github.com/vaidehi-snk) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/windows-empty-appdata` --- ### 📝 Commits (1) - [`a57ee78`](https://github.com/morluto/rea/commit/a57ee786f7a8f24f551b14a65837b8c413fb9b30) fix(setup): treat empty APPDATA as unset for VS Code, Trae and Devin ### 📊 Changes **2 files changed** (+37 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/application/SupportedClients.ts` (+7 -12) ➕ `tests/boundary/filesystem/windowsAppDataClientPaths.test.ts` (+30 -0) </details> ### 📄 Description ## Summary Fixes #5104. On Windows, an empty `APPDATA` made setup resolve relative configuration paths for VS Code, Trae and Devin, so their registrations were written under the working directory instead of `%USERPROFILE%\AppData\Roaming`. AI-assisted (Claude, claude-opus-5-5); I reviewed, ran and verified the change. ## Problem and expected behavior `vscodeUserDirectory`, `traeUserDirectory` and `devinDirectory` used `env.APPDATA ?? join(home, "AppData", "Roaming")`. Nullish coalescing keeps `""`, so `join("", "Code", "User")` becomes the relative path `Code/User`. REA's shared `windowsAppDataRoots` already defines an empty `APPDATA` as unset. Expected: an empty `APPDATA` selects the default roaming root, exactly like an unset one. ## Change and scope The three helpers now use `windowsAppDataRoots(home, env).roaming`, the existing owner of this rule, instead of re-implementing the fallback. Behavior with `APPDATA` unset or non-empty is unchanged. Scope decision: not applicable (ordinary fix within existing boundaries). Not included: cleanup of files already misplaced by earlier runs. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/application/SupportedClients.ts`, Windows client path selection - Contribution scope fit and linked maintainer decision: ordinary fix; not applicable - CLI and MCP/tool-catalog contract: unchanged - Provider, bridge, target-format, or platform compatibility: Windows only; empty `APPDATA` now resolves to `%USERPROFILE%\AppData\Roaming` - Evidence, artifact, provenance, or reconstruction contract: none - Target selection, authority, upstream behavior, and cleanup details: not applicable - Generated metadata, package, or installation impact: setup writes VS Code, Trae and Devin registrations to the default roaming root when `APPDATA` is empty - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/filesystem/windowsAppDataClientPaths.test.ts` — for vscode, trae and devin with `platform: "win32"`, an empty `APPDATA` resolves the same config path as an unset one - Base reproduction or other evidence: with `SupportedClients.ts` reverted, all 3 cases fail, e.g. `Expected: "C:\Users\a/AppData/Roaming/Code/User/mcp.json"`, `Received: "Code/User/mcp.json"` - User-visible CLI/MCP output (if applicable): not exercised - Remaining proof gaps: not run on native Windows or through full `rea setup`; tested at the path-selection boundary with an injected `win32` platform - [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 - `npx vitest run tests/boundary/filesystem/windowsAppDataClientPaths.test.ts` — 3 passed - same with `SupportedClients.ts` stashed — 3 failed - `npx vitest run` on traeClientConfiguration, clientConfigurationDialects, setupConfig, clientLifecycle and claudeDesktopClientConfiguration tests — 139 passed - `npx oxfmt --check` on changed files — clean - `npx oxlint` on changed files — 0 errors; 1 existing `max-lines` warning on `SupportedClients.ts` (file was already over the limit; this change makes it 5 lines shorter) - `npx tsc --noEmit` — clean - pre-push `check:fast` (typecheck, lint) — 2 tasks successful ## Compatibility, safety, and release - Breaking changes or migration steps: none. Registrations previously misplaced under a working directory are not removed automatically. - Real Hopper/Ghidra, browser, or OS coverage: no native Windows run - Package or release metadata impact: none - Security, privacy, process, or containment review: setup no longer writes client configuration into an arbitrary working directory ## Author readiness Human owner: @vaidehi-snk - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff 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-11-01 21:42:58 +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#6778
No description provided.