fix(dashboard): run OpenCode model probes from the Magic Context data folder

IC
5h ago
+249-40

The dashboard started opencode models without a working directory, so OpenCode inherited the dashboard's own. For the AppImage that is a temporary mount, and OpenCode opened a project location there on every start.

All OpenCode probes now run in the Magic Context data folder: the verbose and plain model listings, the Windows where fallback, the login-shell fallback, and the version check that also runs at start. The folder uses the same resolution as the rest of the dashboard (MAGIC_CONTEXT_STORAGE_DIR, then XDG_DATA_HOME, then the default XDG data folder) and is created owner-only if it is missing. If it cannot be created, the probe runs from the home folder and logs a warning; it never falls back to the dashboard's own directory.

Tests: unit tests check that the probe command and the login-shell command carry this working directory, and that the folder is created and falls back as described. A stub CLI also records its real working directory for each probe path through the real probe functions. Removing current_dir from the probe builder fails two of them. Pi and OMP probes are unchanged. cargo fmt --check, cargo clippy --lib -- -D warnings and cargo test --lib (440 passed) pass.

Approved issue: #964
Refs #964


Summary by cubic

Fixes the dashboard's OpenCode model probes running in the dashboard's own working directory, which for the AppImage is a temporary mount that OpenCode opened as a project location on every start.

  • All OpenCode probes (opencode models verbose and plain, the Windows where fallback, the login-shell fallback, and the --version install check) now run in the Magic Context data folder.
  • The folder uses the same resolution as the rest of the dashboard, is created owner-only, and must be absolute: a blank XDG_DATA_HOME counts as unset, and a relative data folder falls back to the home folder with a warning—never the dashboard's directory.
  • Pi and OMP probes are unchanged.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous findings are fixed.

Summary

OpenCode model and version probes now run from the Magic Context data folder instead of the dashboard's launch folder.

  • OpenCode checks now run from the Magic Context data folder.
  • Blank XDG data-home settings now use the default folder.

Reviews (3) · Last reviewed commit: "test(dashboard): check the blank XDG_DAT..." · Reviewed by Greptile