feat: auto-download JetBrains dotMemory Console on first use#42
Merged
MarcelRoozekrans merged 9 commits intomainfrom Apr 14, 2026
Merged
feat: auto-download JetBrains dotMemory Console on first use#42MarcelRoozekrans merged 9 commits intomainfrom
MarcelRoozekrans merged 9 commits intomainfrom
Conversation
- Replace hard dependency on dotnet-dotmemory global tool - Add DotMemoryCommand record for flexible command resolution - Support 4 modes: DOTMEMORY_PATH env var, PATH discovery, local tool, global tool - Update SnapshotManager to use ResolveCommandAsync instead of hardcoded command - Add dotMemory, dotMemory.exe, dotMemory.sh to ProcessFilter exclusions - Create FakeDotMemoryToolManager for testing - Update all tests to use FakeDotMemoryToolManager This allows memorylens-mcp to work with official JetBrains dotMemory CLI installed via Toolbox or zip, not just the non-existent NuGet global tool.
- Make ResolveCommandAsync virtual for proper override in tests - Re-throw OperationCanceledException in TryRunAsync for proper cancellation handling - Restore global tool update logic in EnsureInstalledAsync for 'up-to-date' contract - Add exit code validation in TryProbeAsync to prevent false positives
- Add samples/DotMemoryPathTest console application - Include README.md with usage instructions and explanations - Update PR description with comprehensive documentation - Demonstrate how to use DOTMEMORY_PATH with official JetBrains dotMemory CLI
- Fix EnsureInstalledAsync to only run update when using global tool shim - Add caching to ResolveCommandAsync for performance optimization - Add InvalidateCache method to refresh cached command - Add tests for DOTMEMORY_PATH precedence - Add tests for ProcessFilter new exclusions (dotMemory, dotMemory.exe, dotMemory.sh)
- Revert server.json to original state (remove personal paths) - Fix ProjectReference path in sample - Rename test_dotmemory.csproj to DotMemoryPathTest.csproj - Improve tests for DOTMEMORY_PATH with real temp file - Improve InvalidateCache test to verify actual cache invalidation - EnsureInstalledAsync now uses CommandKind instead of heuristics - Add --version validation for DOTMEMORY_PATH without separators
- Add --version validation for DOTMEMORY_PATH with existing files - Improve error message formatting with separator and null check - Update error messages to mention all discovery modes (DOTMEMORY_PATH, MEMORYLENS_DOTMEMORY_PATH, PATH) - Fix InvalidateCache test to use real temp files instead of non-existent paths
- Accept DOTMEMORY_PATH even if --version validation fails - User explicitly configured the path, so trust it - Fixes issue where dotmemory command fails --version in some environments
Parallel test execution could leak DOTMEMORY_PATH from ResolveCommand_Prefers_DOTMEMORY_Path_Over_Other_Modes into EnsureDotMemory_ReturnsInstalledMessage, causing it to resolve via ExplicitPath instead of the fake process runner output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The test was using a real DotMemoryToolManager which performs actual system discovery. On CI, dotMemory.sh was found in PATH via ResolveFromPathAsync before the fake process runner could return the expected version string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JetBrains.dotMemory.Console.*NuGet package on the firstensure_dotmemorycall — zero user setup on supported platformsIDotMemoryAutoInstaller/DotMemoryAutoInstallerhandles platform detection, NuGet download, ZIP extraction, and caching under~/.memorylens/tools/dotmemory/DOTMEMORY_PATH→ auto-installed cache → PATH → local tool manifest → global tool fallbackDOTMEMORY_PATHwith clear error messagesDOTMEMORY_PATH/ PATH discovery work from PR Add support for official dotMemory CLI via DOTMEMORY_PATH #41 (closed) plus its failing-test fixTest coverage
current.txt→ executable path)FakeHttpMessageHandler)DotMemoryToolManagerwiring: cache-hit resolution, install-on-cache-miss, fallthrough on failure, unsupported platform short-circuit (assertsInstallLatestAsyncnever called)Error scenarios documented
Platform '...' is not supportedDOTMEMORY_PATHDOTMEMORY_PATHor retrychmod +x failedDOTMEMORY_PATHensure_dotmemory🤖 Generated with Claude Code