You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][Desktop] PTC run_code runtime is permanently bricked after setting session cwd into an app.asar virtual path (Windows)
#11691
On Windows, if a PTC (run_code) program calls working_directory with a path inside an Electron app.asar archive (e.g. DSH's own installation directory), the PTC runtime becomes permanently unusable for the rest of the session. Every subsequent run_code call — including a bare console.log — dies at worker start with:
Furthermore: After restarting the desktop app, the broken session disappears from the session list as soon as I click on it, and it can no longer be found in the archived sessions.
Expected behavior
working_directory should reject a target inside an asar virtual path with an actionable error, or resolve it to a real directory; and/or
an unusable session cwd must not poison the runtime — the next call should fall back to the workspace root (or report the offending path) and remain recoverable.
Actual behavior
working_directory accepts the virtual path and returns cd ok.
The following grep call fails with ripgrep provider failure.
From that point on, every run_code invocation fails, even ones that call no tools at all.
sandbox_permissions: "danger-full-access" does not help.
tools.working_directory({ cd: "E:\\Git\\DeepSearch" }) fails with the same error, because it also runs through the broken runtime → unrecoverable deadlock. Restarting the GUI / starting a new session is the only way out.
Impact
The entire session is bricked, since in PTC mode all tools are exposed through run_code. Easy to hit whenever an agent is asked to inspect DSH's own source/logs, because the checkout path provided in the runtime context lives under app.asar.
Suspected root cause
The PTC worker is spawned with the session working directory as its cwd. A path inside an asar archive is a virtual path for Electron's patched fs, but a native child process cannot chdir into it. Node reports the failure as ENOENT while naming only the executable, which is misleading — the executable is clearly present (it is the running app). Most likely the ENOENT refers to the child process's cwd, not the exe.
Suggested fixes
Validate working_directory targets: reject paths containing an .asar segment with a clear message, or map them to the unpacked/real directory.
Harden PTC worker startup: catch spawn failures, include the attempted cwd in the error, and retry with the workspace root instead of bricking the runtime.
If the session cwd is unusable, reset it automatically on the next call and surface a warning.
Additional notes
grep on the asar path failing with ripgrep provider failure may be related; the permanent runtime failure is the main issue.
Accepting the virtual path in working_directory is the trigger; validating it early would prevent the poisoned state entirely.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows, if a PTC (
run_code) program callsworking_directorywith a path inside an Electronapp.asararchive (e.g. DSH's own installation directory), the PTC runtime becomes permanently unusable for the rest of the session. Every subsequentrun_codecall — including a bareconsole.log— dies at worker start with:The session cannot recover on its own: resetting the working directory also goes through
run_code, so the agent is locked out of all tools.Environment
V0.2.2-alpha.2, resources underE:\Git\dsh-gui-home\desktop\resources\app.asar\dshworkspace-write(also reproduced withdanger-full-access)Steps to reproduce
Any subsequent
run_codecall, including:Furthermore: After restarting the desktop app, the broken session disappears from the session list as soon as I click on it, and it can no longer be found in the archived sessions.
Expected behavior
working_directoryshould reject a target inside an asar virtual path with an actionable error, or resolve it to a real directory; and/orActual behavior
working_directoryaccepts the virtual path and returnscd ok.grepcall fails withripgrep provider failure.run_codeinvocation fails, even ones that call no tools at all.sandbox_permissions: "danger-full-access"does not help.tools.working_directory({ cd: "E:\\Git\\DeepSearch" })fails with the same error, because it also runs through the broken runtime → unrecoverable deadlock. Restarting the GUI / starting a new session is the only way out.Impact
The entire session is bricked, since in PTC mode all tools are exposed through
run_code. Easy to hit whenever an agent is asked to inspect DSH's own source/logs, because the checkout path provided in the runtime context lives underapp.asar.Suspected root cause
The PTC worker is spawned with the session working directory as its
cwd. A path inside an asar archive is a virtual path for Electron's patchedfs, but a native child process cannotchdirinto it. Node reports the failure asENOENTwhile naming only the executable, which is misleading — the executable is clearly present (it is the running app). Most likely theENOENTrefers to the child process'scwd, not the exe.Suggested fixes
working_directorytargets: reject paths containing an.asarsegment with a clear message, or map them to the unpacked/real directory.cwdin the error, and retry with the workspace root instead of bricking the runtime.Additional notes
grepon the asar path failing withripgrep provider failuremay be related; the permanent runtime failure is the main issue.working_directoryis the trigger; validating it early would prevent the poisoned state entirely.All reactions