Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] This test-only PR appears safe to merge once required CI passes. SummaryAdds four regression cases for retained capture cleanup.
Reviews (5) · Last reviewed commit: "Merge upstream main to refresh CI baseli..." · Reviewed by Greptile |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
6 open findings
This change replaces the previously publicpendingPathsgetter with private#pendingResources.… · New#pendingResourcesmay contain repeated entries when multiple pending roots share the same… · New The test asserts exact counts forcleanupCallsandrootCloses, which makes it tightly coupled… · New The test asserts exact counts forcleanupCallsandrootCloses, which makes it tightly coupled… · New The test asserts exact counts forcleanupCallsandrootCloses, which makes it tightly coupled… · New The test asserts exact counts forcleanupCallsandrootCloses, which makes it tightly coupled… · New
What changed in this PR
Updates capture cleanup diagnostics so unresolved retained-process cleanup reports the recorded launch identity (run id, pid, process group) alongside the workspace, and ensures subsequent retries preserve that identity until the process is settled.
Changes:
- Derive
cleanup_incompleteresource labels from retained ownership viaownedCommandResources. - Update cleanup error paths to surface process launch identity when still unresolved.
- Add a boundary test covering unresolved process cleanup vs workspace-only failures and retry behavior.
| File | Description |
|---|---|
| tests/boundary/captures/captureProvider.test.ts | Adds a regression test ensuring cleanup errors and close() retries report the correct resource set depending on what remains unresolved. |
| src/process/ArtifactAnalysisResources.ts | Produces resource labels from retained ownership (runId/pid/process-group) and uses them in cleanup error reporting. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ? [root.path] | ||
| : ownedCommandResources(ownership, root.path); | ||
| } | ||
|
|
| return [...this.#pending.keys()].flatMap((root) => | ||
| this.#resourcesFor(root), | ||
| ); |
| expect(cleanupCalls).toBe(failure !== "workspace" ? 2 : 1); | ||
| expect(rootCloses).toBe(failure !== "workspace" ? 0 : 1); | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: resources, | ||
| }); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 3 : 1); | ||
| if (failure === "process-then-workspace") { | ||
| processSettled = true; | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: [root], | ||
| }); | ||
| expect(cleanupCalls).toBe(4); | ||
| expect(rootCloses).toBe(1); | ||
| } | ||
| settled = true; | ||
| await service.close(); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 4 : 1); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); | ||
| await service.close(); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); |
| expect(cleanupCalls).toBe(failure !== "workspace" ? 2 : 1); | ||
| expect(rootCloses).toBe(failure !== "workspace" ? 0 : 1); | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: resources, | ||
| }); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 3 : 1); | ||
| if (failure === "process-then-workspace") { | ||
| processSettled = true; | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: [root], | ||
| }); | ||
| expect(cleanupCalls).toBe(4); | ||
| expect(rootCloses).toBe(1); | ||
| } | ||
| settled = true; | ||
| await service.close(); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 4 : 1); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); | ||
| await service.close(); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); |
| expect(cleanupCalls).toBe(failure !== "workspace" ? 2 : 1); | ||
| expect(rootCloses).toBe(failure !== "workspace" ? 0 : 1); | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: resources, | ||
| }); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 3 : 1); | ||
| if (failure === "process-then-workspace") { | ||
| processSettled = true; | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: [root], | ||
| }); | ||
| expect(cleanupCalls).toBe(4); | ||
| expect(rootCloses).toBe(1); | ||
| } | ||
| settled = true; | ||
| await service.close(); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 4 : 1); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); | ||
| await service.close(); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); |
| expect(cleanupCalls).toBe(failure !== "workspace" ? 2 : 1); | ||
| expect(rootCloses).toBe(failure !== "workspace" ? 0 : 1); | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: resources, | ||
| }); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 3 : 1); | ||
| if (failure === "process-then-workspace") { | ||
| processSettled = true; | ||
| await expect(service.close()).rejects.toMatchObject({ | ||
| cleanupResources: [root], | ||
| }); | ||
| expect(cleanupCalls).toBe(4); | ||
| expect(rootCloses).toBe(1); | ||
| } | ||
| settled = true; | ||
| await service.close(); | ||
| expect(cleanupCalls).toBe(failure !== "workspace" ? 4 : 1); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); | ||
| await service.close(); | ||
| expect(rootCloses).toBe( | ||
| failure === "process" ? 1 : failure === "workspace" ? 3 : 2, | ||
| ); |
Retain unresolved process identity and launch evidence through retryable cleanup. Share capture path normalization and preserve failed filesystem observations. Bound child output and drain Windows pipes without one-chunk throttling. Reviewed fixes include #1628, #2632, #2644, #2784, #2928, #2931, #2965, #2992, and #3011. Validation: 92 focused source tests passed; four platform-specific skips. Real Windows and Hopper lifecycle coverage was not rerun.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |

Summary
Preserve capture cleanup lifecycle coverage after the production fix was incorporated on main in 599a8ee11, which references this PR. Related: #2656.
Problem and expected behavior
Unresolved process cleanup must retain launch identity and block workspace removal. Once process cleanup succeeds, a remaining workspace failure must report only the workspace and must not retry the settled owner. Successful cleanup must make repeated close harmless, and public pendingPaths must survive failed cleanup and clear after success.
Change and scope
Merged main d9cd239 without rewriting history. The effective diff is only tests/boundary/captures/captureProvider.test.ts: three production-service lifecycle scenarios and one public getter lifecycle test. Production files match that main revision. Retry assertions express ordering and state rather than fixed invocation totals.
Evidence and regression coverage
Main has retained-launch diagnostic coverage but lacks these lifecycle combinations and pendingPaths assertions. This supplement protects the corrected behavior; current main already contains the fix. The capture seam is inert and refuses process signaling.
Validation performed
Verified the exact tree published at head fff9c6d in an assistant-cloud Linux checkout with Node 24.18.0 / npm 11.16.0:
The previous CI failures were matched by full test name against failing push CI 38505561204 on the exact old base 5830088. This refresh incorporates upstream fixes; Current-head CI completed successfully on 2026-10-14. Source tests, all five boundary shards, portable inventory and CI required passed. The separate PR readiness status has not yet appeared on this head.
Normal local commit hooks ran but auto-fixed two unrelated upstream tests. Those unrelated edits were excluded from publication. The GitHub-published merge tree exactly matches the tree tested above; original branch history is preserved.
Contract and boundary impact
Compatibility, safety, and release
No production, package, installation or breaking change. The tests use injected provider seams; they do not establish real-engine or native-platform behavior. Independent review inspected the final code and validation logs; it did not independently execute tests.
Before merge
Author readiness
Human owner: @maxazure
The human owner confirmed personal review and responsibility on 2026-10-14. The effective test-only diff is unchanged.