Repository navigation
Conversation
The NLog file target was hardcoded to %AppData%/StabilityMatrix/Logs, while the Settings "Logs" shortcut and the exception dialog's log zip read from Compat.AppDataHome/Logs. With --home-dir set, those diverged and the log folder never existed, throwing DirectoryNotFoundException. Also resolve a relative --home-dir to a full path so folder-browser calls and file:// URIs don't receive relative paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mohnjiles
reviewed
Oct 4, 2026
mohnjiles
left a comment
Member
There was a problem hiding this comment.
Two path-handling edge cases on the current head. The NLog layout case was reproduced on Windows with the pinned NLog 5.3.2; the Unix backslash case is based on static path analysis.
FileName and ArchiveFileName are parsed as NLog layouts, so a home
directory containing "${...}" (e.g. "${shortdate}") was rendered instead
of used literally, sending logs to a different folder than Settings and
the log zip read from. Escape the path with SimpleLayout.Escape.
Drop the backslash-to-slash rewrite: NLog treats backslashes literally
outside "${...}", and on Unix a backslash is a valid filename character.
Move file target setup into LogFileTarget.Create so it can be tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the hand-built AppDataHome/Logs and LibraryDir/Packages paths with named properties, so each well-known folder is defined in one place. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Folders like Packages were only created on first use (e.g. the first package install), so Settings > App Folders > Packages crashed on a fresh library. Add SettingsManager.EnsureAppDirectories() as the one place that creates the app's well-known folders (AppDataHome, Logs, Packages, Workflows, Images, ExtensionPacks, and the default Models folder), and call it whenever the library is found. It runs after LoadSettings so a ModelDirectoryOverride is known; an override is never created since it may be on an unmounted drive. Images/Consolidated is left to the consolidate action, since Images subfolders show as Outputs categories. Failures are logged, not thrown. The three TryFindLibrary branches now share LoadLibrary(), and the Workflows and Outputs pages call EnsureAppDirectories() instead of creating their own folders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening a folder that doesn't exist threw from shell execute and showed the exception dialog. Add IOCommands.OpenFolderBrowserAsync and OpenFileBrowserAsync, which check the path first and show a "Folder not found" / "File not found" warning instead. They never create anything, so a genuinely missing package or model folder is reported, not hidden. The IOCommands browser commands use them. The Settings > App Folders shortcuts call EnsureAppDirectories() first, so app folders deleted while running are recreated, then open through the checked path. A missing ModelDirectoryOverride gets the notification. CreateLogFolderZip no longer throws if the Logs folder is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Changes
--home-dir. The log file target is built fromCompat.AppDataHome, and the path is escaped withSimpleLayout.Escapeso NLog treats it literally. A relative--home-diris resolved to a full path.Compat.LogsDirandSettingsManager.PackagesDirectoryreplace the hand-built paths.SettingsManager.EnsureAppDirectories()creates the app's well-known folders: AppDataHome, Logs, Packages, Workflows, Images, ExtensionPacks and the default Models folder.LoadSettings. The threeTryFindLibrarybranches now shareLoadLibrary().Images/Consolidated.IOCommands.OpenFolderBrowserAsyncandOpenFileBrowserAsyncshow a "Folder not found" or "File not found" warning, and they never create anything. The Settings → App Folders shortcuts callEnsureAppDirectories()before opening.CreateLogFolderZiphandles a missing Logs folder.Testing
LogFileTargetTestsandSettingsManagerDirectoriesTests.--home-dirset to a folder named${shortdate}: logs, the Packages and Logs shortcuts, and recreating deleted folders.TestGetInstalledExtensionsLiteAsync) also fails onmain.Note: other hardcoded paths that could drift (not changed here)
LibraryDir/Packages/<name>is built by hand inPackageInstallDetailViewModel, both one-click install view models andBaseGitPackage.DownloadLocation. These could usePackagesDirectory.LibraryPathvalues use a literal"Packages"in about 7 places.PackageInstallDetailViewModelandIndexUnknownPackagescompareLibraryPathas plain strings using the current OS separator. They could miss matches for a library moved between Windows and Unix. This hasn't been reproduced.GlobalConfig.ModelsDiris set before settings load, so it ignores aModelDirectoryOverride.🤖 Generated with Claude Code