fix: reject signal-killed helpers, create custom codex-home, and clean temp output on failure - #163
Open
Alphaxiaoteng wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
…n temp output on failure
Alphaxiaoteng
force-pushed
the
fix/signal-termination-and-temp-cleanup-and-codex-home
branch
from
August 25, 2026 07:51
3739939 to
9dea3db
Compare
Author
|
recheck |
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.
Summary
code ?? 0treated child processes terminated by signal (code === null) as successful exits (code 0). Now signal termination explicitly rejects with an error containing the terminating signal name/code.codex-homedirectories (withsudo -u <codex-user>underunprivileged-userstrategy orfs.mkdirotherwise) so proxy and server-info creation do not fail due to missing parent directories.cleanupTempOutput()into thefinallyblock ofrunCodexExec(), ensuring that temporary output directories created for--output-last-messageare cleaned up when Codex fails or exits non-zero, rather than being abandoned on runner disk.Changes
src/dropSudo.ts:(code, signal)event inexecCommand(). Ifcode === null, rejects with a descriptive signal error unlessignoreFailureis set.src/main.ts:resolveCodexHome()to create custominputCodexHomeandenvHomepaths before returning them.src/runCodexExec.ts:cleanupTempOutput(outputFile, runAsUser)into thefinallyblock ofrunCodexExec().test/cleanupAndCustomHome.test.mjs:resolve-codex-homecreates non-existent custom directory structures.Verification
npm run buildcleanly compiled with esbuild.npm testpassed: 146/146 tests passing.