fix: memory files tab empty on Windows #140

Merged
naomi merged 2 commits from fix/memory-files-windows into main 2026-02-08 13:51:10 -08:00
Owner

Summary

Fixes the memory files tab showing as empty on Windows production builds and the "forbidden path" error when trying to read memory files.

Changes

1. List memory files from WSL home directory (commit 1)

  • Split list_memory_files() into platform-specific implementations
  • Windows: Use WSL command with bash -l to find memory files in WSL home (~/.claude/projects/.../memory/)
  • Linux/Mac: Continue using native filesystem access
  • Previously used dirs::home_dir() which returns Windows home (C:\Users\...), but Claude Code stores files in WSL home

2. Use backend command for reading files (commit 2)

  • Changed frontend from Tauri's readTextFile plugin to read_file_content backend command
  • Tauri plugin enforces scope restrictions and can't access WSL paths on Windows
  • Our backend command already handles WSL paths correctly via read_file_via_wsl()
  • Matches the pattern used throughout the app for other file operations

Testing

  • All 426 backend tests pass
  • All frontend tests pass
  • Lint, format, and type checks pass
  • Follows existing WSL file operation patterns in codebase

Related Issues

Fixes the memory files tab functionality on Windows whilst maintaining full compatibility with Linux/Mac.

This PR was created by Hikari~ 🌸

## Summary Fixes the memory files tab showing as empty on Windows production builds and the "forbidden path" error when trying to read memory files. ## Changes ### 1. List memory files from WSL home directory (commit 1) - Split `list_memory_files()` into platform-specific implementations - **Windows**: Use WSL command with `bash -l` to find memory files in WSL home (`~/.claude/projects/.../memory/`) - **Linux/Mac**: Continue using native filesystem access - Previously used `dirs::home_dir()` which returns Windows home (`C:\Users\...`), but Claude Code stores files in WSL home ### 2. Use backend command for reading files (commit 2) - Changed frontend from Tauri's `readTextFile` plugin to `read_file_content` backend command - Tauri plugin enforces scope restrictions and can't access WSL paths on Windows - Our backend command already handles WSL paths correctly via `read_file_via_wsl()` - Matches the pattern used throughout the app for other file operations ## Testing - ✅ All 426 backend tests pass - ✅ All frontend tests pass - ✅ Lint, format, and type checks pass - ✅ Follows existing WSL file operation patterns in codebase ## Related Issues Fixes the memory files tab functionality on Windows whilst maintaining full compatibility with Linux/Mac. ✨ This PR was created by Hikari~ 🌸
hikari added 2 commits 2026-02-08 13:06:29 -08:00
The memory files tab was empty on Windows production builds because
`list_memory_files()` was using `dirs::home_dir()` which returns the
Windows home directory (C:\Users\...), but Claude Code stores memory
files in the WSL home directory (~/.claude/projects/.../memory/).

Solution:
- Split into platform-specific implementations
- Windows: Use WSL command to find and list memory files in WSL home
- Linux/Mac: Continue using native filesystem access
- Use `bash -l` to ensure proper PATH and home directory resolution

This matches the pattern used for other file operations throughout
the codebase (read_file, write_file, list_directory, etc.).

Fixes empty memory files tab on Windows whilst maintaining full
functionality on Linux/Mac.

 This fix was created by Hikari~ 🌸
fix: use backend command to read memory files for WSL compatibility
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m23s
CI / Lint & Test (pull_request) Successful in 20m3s
CI / Build Linux (pull_request) Successful in 24m6s
CI / Build Windows (cross-compile) (pull_request) Successful in 34m8s
6f7544c8b3
The frontend was using Tauri's `readTextFile` plugin which enforces
scope restrictions and doesn't work with WSL paths on Windows.

Changed to use our `read_file_content` backend command which:
- Already handles WSL paths correctly on Windows
- Works with absolute paths on all platforms
- Bypasses Tauri's filesystem scope restrictions
- Matches the pattern used throughout the app for file operations

This fixes the "forbidden path" error when trying to read memory
files on Windows whilst maintaining functionality on Linux/Mac.

 This fix was created by Hikari~ 🌸
naomi merged commit 778e016bf5 into main 2026-02-08 13:51:10 -08:00
naomi deleted branch fix/memory-files-windows 2026-02-08 13:51:10 -08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#140