Repository navigation
fix(setup): resolve the configuration MSIX Claude Desktop reads - #2426
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
On Windows, setup, doctor and uninstall always used %APPDATA%\Claude\claude_desktop_config.json. The MSIX build of Claude Desktop (package family Claude_pzs8sxrjxfjjc) virtualizes AppData writes and reads its package-private copy under %LOCALAPPDATA%\Packages\<family>\LocalCache\Roaming\Claude once it exists. Setup from an ordinary process therefore wrote a file the app never reads, and doctor reported that file healthy. Resolve the Claude Desktop location once, in supportedClients(): the private copy when it exists, else the AppData file the package still reads, else a new private copy. An unrecognized Claude_* publisher or unreadable package storage is reported instead of falling back to AppData. Compare one of the package's private files with its AppData path through realpath.native to learn whether the running package started this process. From that redirected view, or when no file can be compared, setup and uninstall refuse to change Claude Desktop's configuration, because the running app rewrites it from memory. From a redirected view they also refuse writes under %APPDATA% and %LOCALAPPDATA% for other clients and skills, which would land in the package's private storage. Setup refuses to register a launcher stored in any MSIX package's private storage, discloses which file the package reads, and tells the user to quit Claude Desktop fully on every platform. Configuration fails with target_changed if the package switched to its private copy after the plan was shown. Uninstall removes REA from both files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the Windows 11 host with the MSIX build 2.31226.1.0, setup from an ordinary terminal with the app quit wrote the package-private copy. After the app restarted, the entry persisted, doctor reported it aligned, and Claude Desktop's MCP log showed REA starting and answering tools/list. Uninstall against the real app remains unverified. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Technical Review & Findings1. Readdir Failure Handling on Inaccessible Packages Directory (
|
Resolve the ClientRegistrationStatus conflict by keeping main's shared registration inspection (record and activation) and reapplying the client-aware status helpers that carry the Claude Desktop quit remediation. Claude Desktop's location now depends on LOCALAPPDATA, so the update maintenance test and the package verification scripts isolate it next to APPDATA instead of reading the host's real package storage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@greptileai review |
|
clientRegistrationRemoval returned a removeLegacy boolean, and removeClient recomputed the legacy path separately, so TypeScript could not prove the path existed when removeLegacy was true and `tsc --noEmit` failed in Uninstall.ts. The decision now returns the admitted legacy path itself; preflight and removal consume that one value. The alias regression matched new-destination children with a "/" separator while building paths with path.join, so it failed on Windows. It now uses path.sep. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tion length limit The uninstall cases pushed the registration lifecycle describe past the 150-line lint limit. Group them separately, with the AppData registration case kept among the registration cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
On Windows,
rea setup,rea doctorandrea uninstallforclaude_desktopalways used%APPDATA%\Claude\claude_desktop_config.json. The MSIX build of Claude Desktop (package familyClaude_pzs8sxrjxfjjc) does not read that file once it has saved its own configuration. It reads its package-private copy at%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json. Setup and doctor now resolve the file the installed app actually reads. When they cannot establish it, they report that instead of guessing.No existing issue; the failure was observed on a Windows 11 host with rea-agents 6.4.0 (details below).
Problem and expected behavior
Observed with rea-agents 6.4.0 on Windows 11 with the MSIX build 2.31226.1.0:
%APPDATA%\Claude\claude_desktop_config.jsoncontaining onlymcpServers.rea, andrea doctor --client claude_desktopreportedhealthy: true. The packaged app never reads that file, so the registration had no effect. The leftover file is still on that host, while the private copy has nomcpServers.npm install -gfrom such a process lands in…\LocalCache\Roaming\npm. A registration pointing at the%APPDATA%\npm\…\rea.mjspath then exists only inside the package's view.Expected:
%APPDATA%.Change and scope
supportedClients()resolves the Claude Desktop location once throughClaudeDesktopConfigLocation. Setup, doctor, uninstall and update maintenance all consume that result.Packages\Claude_pzs8sxrjxfjjc, the location is unchanged (%APPDATA%).%APPDATA%file the package still reads, else a new private copy.pzs8sxrjxfjjcis the MSIX hash of the package publisherCN="Anthropic, PBC", …; it was recomputed from the installed package's publisher string.Claude_<publisher ID>package from another publisher, or an unreadablePackagesdirectory or private path, becomesconfigPathError. There is no fallback to%APPDATA%.%APPDATA%path throughfs.realpathSync.native. This is observed to work although such processes report no package identity (GetCurrentPackageFullNamereturnedAPPMODEL_ERROR_NO_PACKAGE).redirected: the running package started this process.direct: it did not.unknown: nothing could be compared.direct. Uninstall applies this only when REA's entry is present.%APPDATA%/%LOCALAPPDATA%for other clients (VS Code, Trae, Devin, Hermes) and for skill destinations. Those writes would land in the package's private storage.LocalCache. Both sides of the comparison are canonicalized, so short-name or junctioned profiles still match.claude_desktopremediation says the same.target_changedwhen the package began reading its private copy after the plan chose the%APPDATA%file, for example when it saved its settings on quit.%APPDATA%file, which includes entries written there by earlier releases.Not included:
Contract and boundary impact
src/application/ClaudeDesktopConfigLocation.ts, consumed only throughsupportedClients().src/application/MsixPackageStorage.tsowns the package-storage facts.clientStates[].clientmay now includemsixPackageandquitBeforeSetup.clients.<id>.reasongainstarget_changed.detailand doctorremediationtext changed forclaude_desktop.needs_humanfrom the redirected and unknown views described above.npm run docs:checkpassed.Expected effects:
Evidence and regression coverage
tests/boundary/filesystem/claudeDesktopClientConfiguration.test.ts(11 tests, real tempAPPDATA/LOCALAPPDATA, MSIX and non-MSIX layouts). It covers:reareported as missing (the false healthy case);target_changed;src/application/ClaudeDesktopConfigLocation.test.ts(14 tests, injected filesystem) covers:src/application/Setup.configuration.test.tsadds plan disclosure, the AppData-redirect refusal, and the launcher refusal.%APPDATA%file holding onlymcpServers.rea, a separate inode from the private copy.supportedClients()returns the%APPDATA%path, so the private-copy expectations would not hold.setup --client claude_desktop --dry-run --json:--client vscode:doctor --client claude_desktop --jsonreportsstate: "missing"at the private copy instead of the earlier false healthy result.setup --client claude_desktop --client vscode --dry-run --jsonplansconfigure_client:claude_desktop updateon the private copy andconfigure_client:vscode create, withprocessView: "direct".rea setup --client claude_desktopwas run from an ordinary PowerShell with Claude Desktop fully quit, and the plan was approved. Results:mcpServers.reato the package-private copy and keptpreferencesandcoworkUserFilesPath.doctor --client claude_desktop --jsonreportedhealthy: trueandalignedat the private copy.%LOCALAPPDATA%\Claude\logs\mcp-server-rea.logshowsServer started and connected successfully, theninitialize,notifications/initializedandtools/list.mcp.logshows the server answeringtools/listandprompts/list.For evidence-bearing changes: not applicable.
Validation performed
npx tsc --noEmit: passed.npx oxlint <changed files>: no new warnings in changed code. Remaining warnings in touched files were pre-existing (file length and complexity).npm run verify:module-boundaries: passed.npm run docs:check: passed.npm run test:local -- src/application/ClaudeDesktopConfigLocation.test.ts src/application/Setup.configuration.test.ts: 32 passed.npm run test:focused -- tests/boundary/filesystem/claudeDesktopClientConfiguration.test.ts: 11 passed.npx vitest run --project serviceson Windows: 802 passed, 6 failed. The same 6 fail on the unmodified base on this Windows host (LinuxHopper,MacHopper,Setup.planningskill-path tests).npm run test:focusedover 22 related client/setup/uninstall boundary files on Windows: 331 passed, 47 failed. The identical 47 tests fail on the unmodified base on this Windows host (symlink and POSIX-path tests); no new failures.npm run check:fast: passed.doctorandsetup --dry-runinside and outside the package, as shown above.rea setup --client claude_desktopfrom an ordinary terminal with the app quit. The app restarted, the registration persisted, doctor reportedhealthy: true, and the MCP log shows REA answeringtools/list.Compatibility, safety, and release
%APPDATA%, which is the fix.%APPDATA%/%LOCALAPPDATA%instead of silently writing files that do not take effect.readdir/lstat/realpathon the package storage paths.Before merge
type(scope): outcome.🤖 Generated with Claude Code