Repository navigation
Conversation
… folder The OpenCode probes started without a working directory, so the CLI inherited the dashboard's own. For the AppImage that is a temporary mount, and OpenCode opens a project location there on each start. Every OpenCode probe now runs in the Magic Context data folder: the verbose and plain `opencode models` attempts, the Windows `where` fallback probe, the login-shell fallback, and the `--version` install check. The folder follows the same resolution as the log reader (MAGIC_CONTEXT_STORAGE_DIR, then XDG_DATA_HOME, then the default XDG data folder) and is created owner-only when missing. If it cannot be created, the probe runs from the home folder and logs a warning. Pi and OMP probes are unchanged. Refs cortexkit#964
|
Waiting for This PR needs a linked issue with the |
|
Thanks, this is the shape we asked for: every OpenCode probe runs from the data folder, with a test that fails without Greptile's finding is real, and it's the same bug through a side door. With One small thing: the comment The merge also waits on a maintainer label on #964; that's on our side, and we'll post here when it's done. |
A blank XDG_DATA_HOME now counts as unset, as in the plugin's storage resolver, so the probe uses the default data folder. A relative data folder is refused and the probe runs from the home folder: a relative path would resolve under the launch directory again. Tests cover both cases; with the fix removed, both fail and the probe creates the folder under the launch directory.
…home The test now checks the storage resolver and creates no folder. On Windows, dirs ignores HOME, so the probe would have created the folder in the real profile and the test would have failed.
The dashboard started
opencode modelswithout 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
wherefallback, 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, thenXDG_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_dirfrom the probe builder fails two of them. Pi and OMP probes are unchanged.cargo fmt --check,cargo clippy --lib -- -D warningsandcargo 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.
opencode modelsverbose and plain, the Windowswherefallback, the login-shell fallback, and the--versioninstall check) now run in the Magic Context data folder.XDG_DATA_HOMEcounts as unset, and a relative data folder falls back to the home folder with a warning—never the dashboard's directory.Written for commit 93a73fa. Summary will update on new commits.


Confidence 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.
Reviews (3) · Last reviewed commit: "test(dashboard): check the blank XDG_DAT..." · Reviewed by Greptile