Repository navigation
refactor(plugin): let callers wait on the same scan - #1124
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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
An aborted in-flight preparation can still invoke the scan client after cancellation or shutdown.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Introduces shared native scan operations so multiple requests can safely await one scan.
Changes:
- Adds scan sharing, cancellation, shutdown, and cleanup handling.
- Adds lifetime and concurrency tests.
| File | Description |
|---|---|
native-scan.ts |
Implements shared native scan hosting. |
test_native_scan.mjs |
Tests joining, cancellation, cleanup, and shutdown. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| try { | ||
| return await client.run(input.scan.targetPath, { | ||
| ...options, | ||
| signal: controller.signal, | ||
| }); |
alandelong-oai
left a comment
There was a problem hiding this comment.
Reviewed 421f474bbc006a05600df1bd494192bfd69f6924 against mdangelo/codex/pr939-stack-18-native-preparation at 5bfc9854b68ee044dd8e94bab05dfb9c6f1dc3d8, scoped to this PR's diff and touched files.
Reviewed shared-operation ownership, waiter detachment, cancellation, shutdown, and cleanup. No additional distinct finding beyond the existing preparation/shutdown-race comment. All five added lifetime cases passed against an isolated extraction of the exact implementation, with preparation/error dependencies stubbed.
Review included simplification/deletion opportunities. Full repository and platform test suites were not run.
421f474 to
ce162f8
Compare
e53883b to
c9c9ae4
Compare
c503aba to
983f2b1
Compare
c9c9ae4 to
06527bb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 983f2b1c46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!active) { | ||
| const controller = new AbortController(); | ||
| const promise = Promise.resolve() |
There was a problem hiding this comment.
Reject pre-aborted waiters before starting a scan
When waiterSignal is already aborted and no operation is active, this branch registers and schedules the scan before waitForScan calls throwIfAborted(). The caller therefore gets a synchronous exception despite the Promise-returning API, while the queued preparation and scan continue in the background with no waiter. Check the waiter signal before creating the active operation; an already-active operation can remain untouched when rejecting that waiter.
Useful? React with 👍 / 👎.
faizan-oai
left a comment
There was a problem hiding this comment.
Reviewed shared scan lifetime, detaching waiters, explicit cancellation, and cleanup during preparation/shutdown. No issue found in this focused layer. The integrated native lifecycle/stop suites passed locally with synthetic, isolated credentials.
alandelong-oai
left a comment
There was a problem hiding this comment.
Three independent passes and root verification found no actionable regression. The 15 focused native lifecycle tests passed; later activation checks also passed. I traced the pre-aborted waiter concern through the #1163 caller: workbench registration accepts the durable scan before the host waits, and waiter detachment is intentionally separate from canceling that accepted scan. Cancellation or shutdown during preparation is checked before client.run and still closes the prepared client. No repository files were changed.
06527bb to
fdef28b
Compare
983f2b1 to
177fcc1
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
Three independent re-review passes and root reconciliation are complete for this restacked head.
No serious outstanding finding was identified in this change. The scoped prior review and current diff remain consistent.
Approval is for this change. Integrated-tip validation passed 1,357 SDK tests (31 skipped), 105 MCP tests (2 skipped), portable checks, types/builds and installed-package smoke. Other stack findings and known CI fixture failures still prevent the stack from being mergeable.
177fcc1 to
9bc4841
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
Re-reviewed the real PR diff at 9bc48415f9faad45ee0117ec2a382069aeb0ebf3. The patch is unchanged from the prior three-pass review. I reconciled the inherited changes in touched files and retained the prior verified findings and tests.
No serious outstanding finding identified in this patch; prior conclusions remain consistent with the unchanged change or the current re-review.
Validation across touched paths at branch tip 06e75cfe: 1,356 SDK tests, 867 Python tests plus 100 subtests, and 108 MCP tests passed; builds, types, portable checks and installed-package checks passed. These are integration checks at the branch tip, not a claim that every intermediate PR or its CI is clean.
32f2372 to
742cdd7
Compare
5fe3f32 to
d4eb058
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
Retained the three independent passes for the identical patch and reconciled inherited touched-file changes at d4eb058380be.
No actionable introduced finding survives the independent reviews and root reconciliation of this exact patch, touched-file changes, and current integration checks.
Current tip 355ec321 passed 75 report-projection tests, portable source checks, SDK build:ci and plugin build. The immediately preceding tip fec36f1d passed 1,360 SDK tests, 873 Python tests plus 100 subtests, 109 MCP tests, builds/types and the clean 600-entry installed-package check. Only report_projection.py and its test changed between those tips; SDK/MCP runtime files are byte-identical. Both descend from main 008a8b4d. These are integration checks, separate from own-head probes. No native Windows local run.
No serious outstanding finding introduced by this PR. Code review approval does not establish CI or merge readiness.
d4eb058 to
b68f49a
Compare
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
alandelong-oai
left a comment
There was a problem hiding this comment.
Retained the three independent passes for the verified identical patch and reconciled inherited touched-file changes at b68f49ae8507.
No actionable introduced finding survives the independent reviews and root reconciliation of this exact patch and inherited changes in touched files.
Integrated tip 6ef8cbb8, based on 008a8b4d, passed 1,388 SDK tests, 879 Python tests plus 100 subtests, 109 MCP tests, portable checks, builds and the clean 600-entry installed-package check. These are branch-tip integration checks, separate from own-head probes; no local Windows execution was performed.
No serious outstanding finding introduced by this PR. Code approval is separate from CI and merge readiness.
b68f49a to
e20ef28
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
Retained three prior independent passes for the verified identical patch and reconciled inherited touched-file changes at e20ef28e8b24.
No actionable introduced finding survives the independent reviews and root reconciliation of this exact patch and inherited changes in touched files.
Branch tip 3e0083d9, based on 008a8b4d, passed 1,392 SDK tests, 881 Python tests plus 100 subtests, 109 MCP tests, builds, portable source checks and the 600-entry installed-package check. These are tip checks, separate from own-head probes. No local Windows run was performed. The tip excludes the dependency update merged separately in #1184; combined validation remains outstanding.
No serious outstanding finding introduced by this PR. Code approval is separate from CI and merge readiness.
0e27989 to
bd8e9b8
Compare
bd8e9b8 to
42c3a60
Compare
e20ef28 to
8828b65
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
Reviewed exact head 8828b651cdb9daec9853852ad2c7d4cb1c2b16f2 against base 42c3a6004be5cbdb91ae0fbe18c9533aba7d1f14. Three historical independent reviews retained after actual three-dot, ordered contribution, touched own/base modes and bytes, instructions and inherited-context reconciliation; root synthesis completed.
The own NativeScanHost contribution is unchanged: accepted scans are shared, a waiter can detach without cancelling the scan, cancellation and shutdown drain the operation, and cleanup preserves its outcome. Both inherited touched paths were reconciled on base and head against the separately reviewed preceding contribution; no residual own change remains. Three historical independent review summaries are retained. Their individual timestamp/effort fields are absent; HIGH is recorded workflow provenance, not newly populated metadata. This approval covers this PR's own contribution; it inherits the separate #1123 source hold and does not establish stack readiness.
Hosted CI is recorded separately in the final review evidence; it is not inferred from these local or retained checks. Source approval, hosted CI and whole-stack/current-main integration remain separate. No product model, local Windows run, clean install, fresh native compilation or deployment validation was performed.
Hosted CI observation 2026-10-04T13:37:39.993325+00:00 to 2026-10-04T13:38:02.237036+00:00: this exact head was pending. No failed jobs were reported for this head in that observation. Later source/metadata readbacks are not CI refreshes.
Consolidate approved Deep Scan changes into the parent topic branch.
8e9a059
into
mdangelo/codex/pr939-stack-18-native-preparation

Part 19 of 46. Previous: #1123 · Next: #1139 · Stack index
Summary
Add a scan manager that lets multiple plugin tool calls wait on one SDK operation. Canceling a waiting request detaches that caller while the accepted scan continues.
Changes
Testing
At the rebuilt #1141 integration, all 19 native preparation, permission, executable, and lifetime tests passed. SDK and MCP types, Ruff check/format, SDK CI build, source compatibility, and all nine compatibility tests passed.
Risk and rollout
This adds the manager and its lifecycle coverage. The plugin server starts using it in part 40. Request cancellation and explicit scan cancellation deliberately have different lifetimes.
Public disclosure review