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
fix(call-logs): avoid esbuild zombies in source workers - #18511
Source checkouts run the call-log artifact worker through TSX. On Linux, terminating that worker after its 30-second idle timeout can leave an esbuild zombie under the server process. Repeated cycles can exhaust a configured PID limit and prevent new workers or healthchecks from starting.
Run the source worker with Node's built-in TypeScript support and explicit relative imports. All supported Node versions already provide type stripping. Packaged JavaScript workers keep their existing priority; queue, idle timeout, drain and ref/unref behavior stay unchanged. The TSX cache workaround is no longer needed.
Validation:
The regression fails on the upstream baseline with three extra esbuild child processes, then passes with the fix.
Real artifact writes, idle restarts, forced close and CLI preload isolation are covered. The bundled worker is also exercised in standalone and scoped node_modules layouts.
Node 26.11.1: 64 focused tests across 14 files pass. Node 22.22.2 and 24.0.0: 10 source/packaging/lifecycle checks pass each.
Focused ESLint and formatting pass. Full unit/Vitest suites, the project typecheck and the application build were not run.
Source TypeScript workers now use empty execArgv instead of tsx/esm, and ensureWorker passes those arguments directly to Worker. Related imports use explicit .ts paths. The changelog records the stated effect on esbuild zombies.
Artifact and worker lifecycle tests tests/unit/call-log-artifact-worker-native.test.ts, tests/unit/call-log-artifact-worker-tsx-cache.test.ts, tests/helpers/callLogSettle.ts, tests/unit/call-log-save-drain.test.ts
Tests cover artifact contents and metadata, idle restarts, forced close behavior, Linux esbuild child processes, and a subprocess preload case. The former TSX cache-option test is removed. Comments describe cold starts and hang guards.
Worker resolution and bundled execution tests/unit/call-log-artifact-worker.test.ts
Resolution tests cover source and colocated JavaScript workers without loader arguments. Bundled-worker tests cover standalone and scoped node_modules layouts and verify artifact output and metadata.
Source workers use native TypeScript, while packaged builds retain JavaScript workers. No merge-blocking issue was identified.
Security architecture risk: Minimal · up to bb412
The runtime change removes a child-process leak without expanding access or permissions. Existing deployment selection, write ownership, and shutdown behavior remain unchanged.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The runtime change directly affects servers selecting a source TypeScript worker. Its sensitive outcome remains writing call-log data beneath the parent's resolved data directory, using existing server authority. Packaged JavaScript workers retain their previous launch path.
Security Findings and Attack Paths
inferred — No introduced or worsened attack path was identified in the inspected launch-to-write flow. Artifact contents remain data passed to the file writer rather than executable-module selectors. The routed subprocess creation and process inspection in the native test are test-only operations, not newly exposed production entrypoints.
Trust Boundaries and Controls
observed — The parent continues to select the worker executable and per-write environment. Empty execArgv avoids inheriting parent CLI preloads; a regression supplies a preload that throws outside the main thread and asserts a successful worker write. The worker remains an execution compartment, not a lower-privilege security sandbox.
Resilience and Maintainability Implications
observed — Worker failure settles outstanding jobs to null rather than leaving callers waiting. The persistence consumer publishes ready metadata only after a successful result; failure reaches the missing-detail path. Drain regressions assert an existing file for ready metadata and null metadata after forced close, preserving failure containment without making logging success a prerequisite for request processing.
Pre-merge checks: 5 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description explains the operational problem, the implementation, related issue, validation results, and unrun checks. It does not follow the required template and omits or incompletely covers Tar…
Rewrite the description using all template headings. Add the target branch checklist status, change type, focused tests and category gates, lint and reconciliation status, the complete list of changed test files, coverage details for the to…
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 5 passed
Check name
Status
Explanation
Title check
The title follows the required Conventional Commits format and accurately describes the main change: preventing esbuild zombie processes in source call-log workers.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Tests For Production Code
Production code changed under src/ in three files. The PR adds tests/unit/call-log-artifact-worker-native.test.ts and updates tests/unit/call-log-artifact-worker.test.ts, plus related call-log l…
No Ai Attribution
No forbidden AI attribution appears in the reviewed commits or PR diff. The three commit bodies have no trailers or generation footers, and the authored PR body contains neither a Co-Authored-By trail…
Full details: Tests For Production Code
Explanation
Production code changed under src/ in three files. The PR adds tests/unit/call-log-artifact-worker-native.test.ts and updates tests/unit/call-log-artifact-worker.test.ts, plus related call-log lifecycle test helpers. This satisfies the requirement to add or update tests for production changes.
Full details: No Ai Attribution
Explanation
No forbidden AI attribution appears in the reviewed commits or PR diff. The three commit bodies have no trailers or generation footers, and the authored PR body contains neither a Co-Authored-By trailer nor a “Generated with <AI tool>” footer. The commit author name does not create a prohibited trailer.
Full details: Description check
Explanation
The description explains the operational problem, the implementation, related issue, validation results, and unrun checks. It does not follow the required template and omits or incompletely covers Target Branch, Tests Added Or Updated, Coverage Notes, and Reviewer Notes. The validation checklist also does not identify the change type or confirm all required gates.
Resolution
Rewrite the description using all template headings. Add the target branch checklist status, change type, focused tests and category gates, lint and reconciliation status, the complete list of changed test files, coverage details for the touched src/ files, and reviewer notes for risks or manual validation. Preserve the existing summary, validation results, and related issue information.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 7 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
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
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.
Source checkouts run the call-log artifact worker through TSX. On Linux, terminating that worker after its 30-second idle timeout can leave an esbuild zombie under the server process. Repeated cycles can exhaust a configured PID limit and prevent new workers or healthchecks from starting.
Run the source worker with Node's built-in TypeScript support and explicit relative imports. All supported Node versions already provide type stripping. Packaged JavaScript workers keep their existing priority; queue, idle timeout, drain and ref/unref behavior stay unchanged. The TSX cache workaround is no longer needed.
Validation:
node_moduleslayouts.Related: #18056, which handles idle process exit.