fix: preserve Windows paths for Codex resume#214
Merged
vakovalskii merged 1 commit intoMay 15, 2026
Conversation
vakovalskii
approved these changes
May 15, 2026
Owner
vakovalskii
left a comment
There was a problem hiding this comment.
LGTM ✅ Welcome to the project @IamXesus, nice first contribution!
Verified:
node -cclean onterminals.js,app.js,detail.js- 5/5 new tests pass (
frontend-escaping.test.js,terminals-windows-launch.test.js)
Spot-checks:
escJsString:
- Backslash escaped first (essential — otherwise subsequent
\'escapes would be double-escaped) \r,\n, U+2028, U+2029 covered (the last two are easy to miss but break JS string literals)- Final
escHtmlwrap handles the HTML-attribute layer — double-encoding round-trips correctly:- Input
C:\\Users\\foo→escJsString→C:\\\\Users\\\\foo→ browser HTML-decode →C:\\Users\\foo→ JS string parse →C:\\Users\\foo(single backslashes), correct
- Input
Windows launcher:
- Refactor extracts
buildAgentCommand+ per-launcher arg builders as pure functions — testable, noexecside-effects in unit tests 👍 Start-Process -WorkingDirectoryis the right pattern; eliminates the nestedcmd /k "cd \"...\" && ..."quoting fragilityquotePowerShellSinglecorrectly uses''(doubled single quote) as PowerShell's literal-string escape- Switching the three Windows paths from
exec(shell) toexecFileSafe(no shell) is a security improvement on top of the bug fix - Windows Terminal:
--startingDirectoryis the documented cwd flag, matches MS docs -NoProfileon PowerShell — good practice (no user-profile side effects)
Thanks for the carefully-scoped fix + regression tests!
11 tasks
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что исправлено
Исправляет Resume для Codex-сессий на Windows, когда проект лежит по Windows-пути вроде
C:\projects.До фикса при нажатии Resume могла открываться консоль в
C:\Windows\System32или сервер отклонял запуск с ошибкойinvalid or unsafe project path.Причина
Было два связанных слоя проблемы:
onclick, где обратные слэши вC:\...интерпретировались как JSescape-последовательности;
cmd /k "cd \"...\" && ...", что ломало quoting и не гарантировалокорректный working directory.
Изменения
Start-Process -WorkingDirectory.--startingDirectory.Проверка
node --test test\frontend-escaping.test.js test\terminals-windows-launch.test.jsТакже запускал полный
node --test: все новые проверки проходят, остаётся существующий Windows-only fail из-заEPERMнаfs.symlinkSyncвtest/git-root-resolve.test.js.