Repository navigation
fix(agents): transport large child instructions via temporary file and preserve exit signal (#1373) #1382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Alan-TheGentleman
merged 5 commits into
Gentleman-Programming:main
from
carlosmoradev:fix/1373-child-instruction-transport
Sep 30, 2026
Merged
fix(agents): transport large child instructions via temporary file and preserve exit signal (#1373) #1382
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2126abc
fix(agents): transport large child instructions via temporary file an…
carlosmoradev 48771ab
test(agents): cover transport directory cleanup on write and early sp…
carlosmoradev 3eb705e
fix(agents): clean up transport directory and IPC on task quarantine
carlosmoradev 97ecb78
fix(agents): resolve main conflicts in child instruction transport
egdev6 97ae43b
fix(agents): count inline instruction limit in UTF-8 bytes and bound …
Alan-TheGentleman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # PR #1382 Review Fixes | ||
|
|
||
| ## Objective | ||
|
|
||
| Close the verified CodeRabbit review findings on PR #1382 (`#1373` large child instruction transport) by adding regression tests for failure paths during temporary file transport and child startup. | ||
|
|
||
| ## Problem | ||
|
|
||
| PR #1382 added owner-only temporary file transport for large agent instructions and cleanup routines in `lib/agents-runner.ts`. While the happy path and synchronous spawn throw path were tested, coverage was missing for: | ||
| 1. Instruction write failure after the transport directory is created on disk. | ||
| 2. Early child error before a PID is assigned (`pid === undefined`). | ||
|
|
||
| ## Scope | ||
|
|
||
| - Add regression tests in `tests/agents-runner.test.ts` covering both failure paths. | ||
| - Assert that in each case the task fails with an informative error and the temporary transport directory and file are completely cleaned up. | ||
| - Verify test suite and typecheck. | ||
|
|
||
| ## Constraints | ||
|
|
||
| - Keep the patch minimal and limited to PR #1382 review findings. | ||
| - Technical artifacts remain in English. | ||
| - Do not commit, push, or merge without explicit user direction. | ||
|
|
||
| ## Tasks | ||
|
|
||
| - [x] **T1 — Test transport directory cleanup on instruction write failure.** Simulate write failure after directory creation and assert task failure and directory removal. | ||
| - [x] **T2 — Test transport directory cleanup on early child error pre-PID.** Simulate early error before child PID and assert task failure and directory removal. | ||
| - [x] **T3 — Full verification.** Run test suite and typecheck. |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add tests for temporary-file cleanup on failure.
The new tests cover child exit and a synchronous
spawnthrow. They do not cover a write failure after directory creation or an early child"error"with no PID. Add both cases with long instructions. Assert that each task fails and leaves no transport directory.As per path instructions: “Behavior changes here must ship with their tests in the same PR. Flag changed logic without updated tests.”
Also applies to: 999-999
🤖 Prompt for AI Agents
Source: Path instructions