fix(executor): preserve Rust execution cwd and sandbox lifecycle - #1237
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
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.
What / Why / How
Rust returns from
execute()before the shared cwd selection and cleanup. As a result, project-relative reads use.ctx-mode-*instead of the project,cwdoverrides are ignored, and successful executions and compiler failures leave their sandboxes behind.background: trueis also ignored by that branch.Route the compiled Rust result through the existing shared lifecycle. Keep the execution cwd separate from the sandbox directory and forward the existing background flag. This preserves the array-argument
execFileSynccompiler invocation, the bounded compiler timeout, and the existing common process handling.This completes the project-cwd and cleanup invariants introduced in commit
89f4e736/ #788. It does not add compiler cancellation or replace the process implementation. Reviewed the open cancellation/streaming patches touching the executor; they retain the old Rust cwd/cleanup branch and address different behavior.Affected platforms
The shared executor is affected wherever Rust is installed. Local execution was macOS with Node 22.19.0 and a real
rustc; native Windows/Linux execution and client-specific delivery are not claimed.Test plan
Added five native compiler/process regressions in the existing
tests/executor.test.ts:Before: the relative-file program exits 101 (
No such file or directory), the four lifecycle cases fail on the unchanged base, and a requested background run is killed rather than marked backgrounded.After: the program reads
project evidence, override readsoverride project, completed/failed sandboxes no longer exist, and the background case stays alive withbackgrounded: true.npm run typecheck: passed.npm test --ignore-scripts: passed (4778 passed / 26 skipped; 213 files). This runs the repository's full Vitest script while skipping the generated-bundle pretest, as required by the ops TDD instructions.claude -pmodel session or client transcript was run. The tests drive the real executor/compiler/process boundary; the client-to-MCP boundary remains untested locally.Checklist
npm test --ignore-scriptspassesnpm run typecheckpassesnext