fix: MSIX/Store path detection + remove transcriptUnavailable on repair#7
fix: MSIX/Store path detection + remove transcriptUnavailable on repair#7BasedGPT wants to merge 3 commits into
Conversation
…criptUnavailable on repair Standard Windows installs store Claude data at %APPDATA%\Claude. MSIX/Store installs use %LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude. If %APPDATA%\Claude doesn't exist, both diagnose.py and repair_session_metadata.py now scan %LOCALAPPDATA%\Packages\ for any Claude_* package and use that path instead. Also removes the transcriptUnavailable key when repair_session_metadata.py writes a repaired metadata file. The Desktop app checks this flag before rendering session content — leaving it set after backfilling cliSessionId caused sessions to still show "Session not found on disk" even after a successful repair. Fixes #5
…e removal Standard Windows installs store Claude data at %APPDATA%\Claude. MSIX/Store installs use %LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude. If %APPDATA%\Claude doesn't exist, diagnose.py now scans %LOCALAPPDATA%\Packages\ for any Claude_* package and uses that path. Fixes #5
…ath fallback The Desktop checks transcriptUnavailable before rendering session content, so leaving it set after backfilling cliSessionId caused sessions to still show 'Session not found on disk'. Now popped from the metadata dict before writing with --apply. Also adds MSIX/Store path detection to _default_paths(). Related to #5
There was a problem hiding this comment.
Thanks for your first PR. Please confirm:
- CI passes (fixture tests + sanitisation lint)
- If you added a mutator, it has a matching fixture and passes the five mutator gates (see
docs/architecture.md) - No personal paths, real UUIDs, or identifying info in committed files
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c570e7b7f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| appdata_claude_dir = os.path.join( | ||
| os.environ.get("APPDATA", os.path.expanduser("~")), "Claude" | ||
| ) | ||
| if not os.path.isdir(appdata_claude_dir): |
There was a problem hiding this comment.
Detect MSIX Desktop before printing repair commands
When this new Store fallback makes MSIX metadata visible, desktop_running is still computed by _detect_desktop_running(), which treats a running claude.exe as Desktop only when its executable path contains AnthropicClaude; an MSIX install under the Claude_* package path won't match that check. In that Store-install context, diagnose.py can now emit runnable mutator commands without the QUIT DESKTOP FIRST warning even while Desktop is open, violating the repo's safety boundary and risking Desktop overwriting the repair on its next flush.
Useful? React with 👍 / 👎.
| _appdata_claude = os.path.join( | ||
| os.environ.get("APPDATA", os.path.expanduser("~")), "Claude" | ||
| ) | ||
| if not os.path.isdir(_appdata_claude): |
There was a problem hiding this comment.
Fall back when the AppData root is empty
This guard only checks whether %APPDATA%\Claude exists, not whether it contains usable claude-code-sessions metadata. In a Store/MSIX environment with a leftover or empty standard-install %APPDATA%\Claude directory, the fallback to %LOCALAPPDATA%\Packages\Claude_*\LocalCache\Roaming\Claude is skipped, so diagnose/repair still operate on the empty root and report no metadata even though the Store data exists.
Useful? React with 👍 / 👎.
Summary
Two fixes for Windows path detection and a one-line repair correctness fix.
MSIX/Store install path detection (fixes #5)
Standard installs store Claude data at
%APPDATA%\Claude. MSIX/Store installs use%LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude— a completely different root.diagnose.pywas returning 0 metadata files for MSIX users because it never looked there.Both
diagnose.pyandrepair_session_metadata.pynow check%APPDATA%\Claudefirst. If that directory doesn't exist, they scan%LOCALAPPDATA%\Packages\for anyClaude_*package and use itsLocalCache\Roaming\Claudepath instead.Remove
transcriptUnavailableon repairWhen
repair_session_metadata.py --applywrites a repaired metadata file, it now popstranscriptUnavailablefrom the dict before writing. The Desktop app checks this flag before rendering session content — leaving it set after backfillingcliSessionIdcaused sessions to still show "Session not found on disk" even after a successful repair. Surfaced by #63082 on the upstream tracker (macOS startup scanner sets bothtranscriptUnavailable: trueand removescliSessionId; repair was only fixing half the problem).Files changed
tools/diagnose.py— MSIX fallback inmain()Windows branchtools/sessions/repair_session_metadata.py— MSIX fallback in_default_paths(),transcriptUnavailablepop in--applywrite pathTest plan
diagnose.pyon a machine with an MSIX Claude install — should now show metadata count > 0transcriptUnavailable: trueand clearcliSessionIdin a test metadata file, runrepair_session_metadata.py --apply, confirm key is removed in the output file