Repository navigation
Replies: 3 comments
|
Confirmed at Where the scrub is. Is the shared base the right layer? Yes — safer than the launcher. Every in-tree consumer that needs the marker writes it explicitly into the environment it builds, after the scrub: The tree already contains the deny-list you need. Duplicate report. #9599 describes the same leak reached through the web host (electron-based editors → Third-party mitigation, not a fix. Because One policy note: |
|
Following up on my reply above: I built the mitigation into a plugin, so a desktop host that has already shipped can stop breaking the editors it launches without waiting for a core release.
What it doesOn mount it deletes
One detail that is not cosmetic: it deletes the name rather than assigning What it is notIt is a mitigation, and the README says so first. The actual defect is the keep-rule:
That is a one-line change in the harness, so a plugin cannot make it. Why removing it from the base is safeEvery in-tree launcher that genuinely needs the marker writes it explicitly after the scrub — Usage- insert:
- id: electron-marker-strip
name: '@argszero/dsh-electron-marker-strip'The package carries a Verification83 tests, including a witness that spawns real child processes and measures what they can see from the inside: a child born while the parent carries the marker inherits it; a child born after the mount does not, and sees the name absent rather than the string
StatusThe source, the built This is the same defect reported in #9599, so it applies there unchanged. |
|
Publication status: Verified through the registry's version endpoint: It deletes |
Uh oh!
There was an error while loading. Please reload this page.
open-in-app: "Open in VS Code" always fails on Windows —
ELECTRON_RUN_AS_NODEleaks into the launcher's environmentSummary
In the DSH desktop app on Windows, the Open In menu lists VS Code correctly, but picking it always shows "Could not open. Try again." (
path.openError).The root cause is an environment-variable leak: the desktop shell runs the host as a child Electron process with
ELECTRON_RUN_AS_NODE=1, andlaunchDetachedApp()in@deepseek-ai/dsh-host-open-in-appforwards that variable to the launched application. Electron-based targets (VS Code, Cursor, Windsurf, GitHub Desktop, …) therefore start in Node mode, interpret the workspace directory as an entry script, and exit non-zero inside the launch watch window. The route classifies that asfailed, so the client shows the generic error.Explorer, Windows Terminal, Git Bash, and the JetBrains IDEs (JVM) are unaffected — the bug only hits Electron-based launchers.
Environment
0.2.0-rc.2(@deepseek-ai/dsh-desktop 0.2.0-rc.2)@deepseek-ai/dsh-host-open-in-app 0.2.0-rc.244.0.0/ Node24.18.11.136.1, installed atD:\Microsoft VS CodeApp Paths\Code.exe→D:\Microsoft VS Code\Code.exe(resolves fine, the app appears in the menu)Steps to reproduce
Expected
VS Code opens on the workspace directory and the control reports success.
Actual
A toast appears: "Could not open. Try again." (
path.openError). VS Code does not open on that directory.Root cause
resolveOpenInAppApps()resolves the catalog entry to{ kind: 'argv', command: 'D:\Microsoft VS Code\Code.exe', args: [] }, andlaunchArgs()appends the directory because no argument carries{path}. So the host effectively runs:scrubbedParentEnv()removes names matching/KEY|PASSWORD|SECRET|TOKEN/iand allDSH_*names, but it does not remove Electron's runtime markers. The DSH desktop shell spawns the host CLI as a child of Electron withELECTRON_RUN_AS_NODE=1, so every descendant — including the launched editor — inherits it.When
Code.exeseesELECTRON_RUN_AS_NODE=1, it runs as Node and treats the first argument (the workspace directory) as the module entry point:Exit code
1inside the watch window makesrunLaunch()returnfailed,launchResolved()returnsfailed, and the open route rejects → the client showspath.openError.Minimal reproduction (no DSH involved)
Verified both ways on the machine above: with the variable →
exit code 1; without it →exit code 0within the watch window.Suggested fix
Strip Electron's own runtime markers from the launch environment, either in
launchDetachedApp()specifically (safer, since open-in-app launches arbitrary desktop applications) or in the shared scrub base:Related marker worth considering:
ELECTRON_RUN_AS_NODEis the one that changes behavior;ELECTRON_ENABLE_LOGGING/ELECTRON_NO_ATTACH_CONSOLEare cosmetic but equally meaningless to an external app.If the shared
scrubbedParentEnv()is the wrong layer (it is documented as the canonical child base for harness children, which may legitimately need the marker), doing the deletion insidelaunchDetachedApp()keeps the blast radius to third-party launches.Notes
github-desktopadapter); it is Electron too, so the same leak would break it once resolved.GET /open-in-app/apps. Only the launch step fails.All reactions