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
Re-apply editor launch optimizations on top of externalLauncher.ts #7
During the merge of origin/main into personal (merge commit b844dd40), upstream PR pingdotgg#2659 (commit d15909af, "Use Effect child process for editor launches") renamed apps/server/src/open.ts to apps/server/src/process/externalLauncher.ts and refactored the implementation to use Effect's ChildProcessSpawner.
To unblock the merge, the personal branch's two prior optimizations to open.ts were intentionally dropped rather than ported. This issue tracks re-applying them on top of the new externalLauncher.ts.
Dropped commits
1553907e — refactor: pre-resolve editor command map at service startup to avoid redundant availability checks
Added a resolveEditorCommandMap() helper that walked EDITORS once and returned a ReadonlyMap<EditorId, string>.
Threaded a resolvedCommands parameter through resolveEditorLaunch so per-launch isCommandAvailable walks were avoided.
Removed the if (!isCommandAvailable(launch.command)) return yield* new OpenError(...) guard in launchDetached.
Used setImmediate(...) to detect ENOENT spawn errors (which arrive via process.nextTick) while letting successful spawns resolve as Effect.void.
Where to apply in the new module
apps/server/src/process/externalLauncher.ts:
Command map caching — add a resolveEditorCommandMap helper alongside resolveAvailableEditors, accept an optional cached map in resolveEditorLaunch (around line 267), and cache it once in make (around line 347).
Pre-flight check removal — the new launchEditorProcess (line 321) still has if (!isCommandAvailable(launch.command)) at line 324. The behavior should be reconsidered in the context of ChildProcessSpawner.spawn(...).pipe(Effect.flatMap((handle) => handle.unref)), which surfaces errors via Effect's error channel; the original setImmediate/ENOENT trick may not be needed if the spawner already reports ENOENT cleanly.
Verification when re-applied
apps/server/src/process/externalLauncher.test.ts (19 tests today; add coverage for the cached-map path and the missing-command path).
apps/server/src/server.test.ts > routes websocket rpc shell.openInEditor errors should still pass with whatever error path is chosen.
Activity