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. |
[Medium impact] The PR appears safe to merge, with a non-blocking loss of detail in Ghidra Java probe errors. Findings
Fix with agent prompt### Issue 1
src/ghidra/GhidraInstallation.ts:571-578
`installationCoordinates` drops the Java probe's diagnostics when it converts an `AnalysisError` into `GhidraJavaProbeFailure`. A failed macOS ownership-helper build records `stage: "ownership_preparation"` and `compiler_outcome`, but this conversion keeps only the generic adapter message and captured output. Users then see a Java runtime failure without the stage or compiler result that explains it.
Preserve those diagnostics in the installation failure and its caller-facing output.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR updates Electron launch arguments and manifest reads, JavaScript alias and path analysis, packet errors, firmware publication errors, and command admission.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Electron capture] --> B[Check executable fuses]
B --> C[Check whether executable bundles the app]
C --> D[Read bounded manifest when needed]
D --> E[Build launch arguments]
E --> F[Launch and run actions]
F --> G[Close processes and transport]
D --> H[Retain handles that fail to close]
G --> H
H --> I[Retry owned resources on close]
Reviews (28) · Last reviewed commit: "chore(merge): align with upstream main (..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de28a8f832
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } catch (cause: unknown) { | ||
| failures.push( | ||
| new ProviderCleanupError( | ||
| info.engine, | ||
| [info.path], |
There was a problem hiding this comment.
Block admission while descriptor cleanup remains unresolved
When the same descriptor close continues to fail on the next execute(), this catch only appends a cleanup failure; processUnverified remains false, and the caller ignores cleanup.failure unless that process flag is set. The provider therefore starts command resolution and snapshotting while the old handle is still pending, so repeated requests can open additional descriptors and launch native work instead of retrying the exact owner exclusively. Make unresolved descriptor cleanup block admission just like the lifecycle contract requires.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| try { | ||
| await owner.close(); | ||
| this.#unrootedDescriptors.delete(owner); |
There was a problem hiding this comment.
Resolve cleanup errors when descriptor retries succeed
After a retained handle eventually closes, this path only removes it from the map; none of the ProviderCleanupError instances returned for that owner are bound to the retry or have resolveCleanup() called. For example, provider.close() can succeed after a report-close failure while the original operation error still projects as cleanup_incomplete with stale resources. Retain a cleanup lease for each descriptor and bind every originating or aggregate error so successful release resolves its live cleanup marker.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| await pending.root.close(); | ||
| if (pending.tree === undefined) this.#pendingCleanup.delete(path); | ||
| if (pending.tree === undefined && pending.descriptors.size === 0) | ||
| this.#pendingCleanup.delete(path); |
There was a problem hiding this comment.
Keep workspace roots until descriptor release succeeds
If a rooted report or extraction descriptor still fails to close in the preceding retry loop, this block nevertheless calls PrivateRuntimeRoot.close(). On POSIX that method recursively removes the workspace successfully even with an open file descriptor, so the child remains unresolved while its containing root and reported paths disappear; later retries retain only an unlinked handle. Skip tree/root cleanup until pending.descriptors is empty so child release is confirmed before parent removal.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| request: FirmwareRequest, | ||
| descriptors?: Map<OwnedFileHandle, string>, | ||
| ): Promise<Outcome> => { | ||
| if (outcome.ok && descriptors !== undefined && descriptors.size > 0) { |
There was a problem hiding this comment.
Report retained descriptors on failed operations
When snapshotFirmware or its selected-range hash retains a failed close, the thrown RegularFileCleanupFailure is converted by the outer catch into an ordinary failed outcome, so this success-only descriptor branch is skipped and the later cleanupIncomplete branch is skipped as well. The workspace is then closed and the caller receives an error claiming cleanup is complete even though the descriptor remains in pending.descriptors. Compose retained descriptor cleanup with failed outcomes as well as successful ones so the handle path and primary failure both survive.
AGENTS.md reference: AGENTS.md:L31-L31
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e03e0237cd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| targetSha256: this.target.sha256, | ||
| enumerateRoots: bundle !== undefined, | ||
| parameters, | ||
| resourceScope: this.#resourceScope, |
There was a problem hiding this comment.
Run dyld traces inside the resource scope
When a trace_dylib_resolution descriptor close has been retained, a subsequent trace reaches this call directly rather than through ArtifactResourceScope.run(). The dispatch at ArtifactProvider.ts:184-185 confirms that only the inventory/extraction helpers enter the scope, while run() is what retries #pending before admission and registers work in #active; repeated trace requests can therefore open more descriptors while prior cleanup remains unresolved, and a direct close() cannot see the active trace. Execute the complete trace within the scope instead of merely passing the scope down.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| cause.outcome.kind === "failed" | ||
| ? cause.outcome.cause | ||
| : new ArtifactReaderFailure("unavailable", cause.message, { cause }); | ||
| throw ArtifactReaderFailure.withCleanup( |
There was a problem hiding this comment.
Bind dyld cleanup errors to retained owners
When a retained dyld handle later closes successfully in ArtifactResourceScope.retryCleanup() or close(), this path has already reduced the owner to a static cleanup observation; neither the scope nor translateArtifactFailure() keeps a lease to the resulting ArtifactOperationError. The original error therefore remains cleanupIncomplete and continues naming a resource that was released. Retain an AnalysisCleanupLease per descriptor and bind the originating and retry errors before discarding the owner.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| retainFailedClose: (owner) => { | ||
| resourceScope?.retain({ | ||
| kind: "file-handle", | ||
| resource: path, | ||
| handle: owner, |
There was a problem hiding this comment.
Report every concurrently retained dyld descriptor
When two or more of the eight concurrent bundle magic reads fail descriptor close, each callback retains its owner here, but consumeWithOrderedReads() throws only the first ordered failure and its finally merely awaits the remaining settled records. The catch at lines 192-203 consequently reports one path even though #resourceScope owns all failed handles, so the operation's cleanup resources are incomplete. Aggregate every retained child or lease into the returned cleanup error.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| const arg = process.argv[index]; | ||
| if ( | ||
| typeof arg === "string" && | ||
| (arg.endsWith(".asar") || arg.includes(".asar/")) |
There was a problem hiding this comment.
Preserve caller-supplied ASAR arguments
For packaged apps (process.defaultApp === false), this removes every argument ending in .asar or containing .asar/, not just the launcher-owned application token. PlaywrightElectronActiveProvider appends the caller's unconstrained input.args to the same argv, so an app invoked with /tmp/plugin.asar or --config=/tmp/app.asar/settings silently receives different inputs and the experiment can exercise the wrong behavior. Track and remove the exact injected application argument instead of pattern-matching all argv entries.
AGENTS.md reference: AGENTS.md:L13-L13
Useful? React with 👍 / 👎.
| if (cause instanceof RegularFileCleanupFailure) { | ||
| const primary = | ||
| cause.outcome.kind === "failed" | ||
| ? cause.outcome.cause | ||
| : new ArtifactReaderFailure("unavailable", cause.message, { cause }); |
There was a problem hiding this comment.
Preserve late dyld cancellation through close failure
When the abort signal fires after a dyld file operation completes but while its descriptor close fails, withOwnedRegularFile() throws RegularFileCleanupFailure with a completed outcome. This branch converts that case to unavailable; the preceding cancellation classifier does not recognize the cleanup wrapper even though the signal is now aborted, so the caller's cancellation and exact reason disappear. Use typed cancellation as the primary error and attach the cleanup observation and completed facts.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| }, | ||
| { cause: failure, operation }, | ||
| ); | ||
| if (failure.outcome.kind === "completed") return cleanup; |
There was a problem hiding this comment.
Preserve late firmware cancellation through close failure
When the caller aborts after a report read completes but the descriptor close fails, failure.outcome.kind is completed, so this unconditional return emits only ProviderCleanupError. readFirmwareCommandReport() then carries completedReport forward and FirmwareProvider never rechecks the signal, causing an explicitly cancelled inspection or extraction to project as cleanup-only instead of typed cancellation with the retained observation. Pass the signal into this composition and preserve cancellation as the primary failure.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77d59c72e4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| normalized.endsWith("/electron-active-hook.cjs") || | ||
| normalized.endsWith("/electron-active-hook.js") || | ||
| normalized === "electron-active-hook.cjs" || | ||
| normalized === "electron-active-hook.js" |
There was a problem hiding this comment.
Match only the injected Electron hook path
The ASAR-specific filter is gone, but when the selected default application or any caller-supplied argument is a different file named electron-active-hook.js or .cjs, these suffix branches still classify it as REA's hook and splice it (and possibly a preceding -r) from process.argv. Since PlaywrightElectronActiveProvider appends unconstrained input.args, this changes the experiment's inputs or can remove the application entry itself; compare only against the exact injected hook argument.
AGENTS.md reference: AGENTS.md:L13-L13
Useful? React with 👍 / 👎.
| : { partialObservation: outcome.error.partialObservation }), | ||
| }, | ||
| ); | ||
| new AnalysisCleanupLeaseGroup(cleanup, descriptorLeases); |
There was a problem hiding this comment.
Delay descriptor resolution until parent cleanup succeeds
When an otherwise successful operation retains a descriptor, this binds the returned cleanup error only to descriptor leases even though that error also reports the workspace root. On retry, AnalysisCleanupLease.release() resolves the original caller-visible error before root.close() runs; if root removal then fails, the provider retains the root and emits a new error while the original error now falsely projects cleanup as complete. Keep the marker unresolved until the ordered parent cleanup also succeeds.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| if ( | ||
| abortSignal?.aborted || | ||
| (failure.outcome.kind === "failed" && | ||
| failure.outcome.cause instanceof AnalysisCancelledError) |
There was a problem hiding this comment.
Preserve firmware failures through late cancellation
The completed-report case from the earlier review is different from this fresh failing-outcome path: when report parsing or another file operation has already failed and the caller aborts only while descriptor close also fails, abortSignal.aborted unconditionally replaces the established output/I/O failure with cancellation. Preserve failure.outcome.cause as primary unless that cause is itself cancellation; use signal-only late cancellation only for a completed outcome.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| options.signal?.aborted || | ||
| (cause.outcome.kind === "failed" && | ||
| isCancellationError(cause.outcome.cause, options.signal)) |
There was a problem hiding this comment.
Preserve dyld failures through late cancellation
The earlier completed-read case now gets typed cancellation, but a fresh failing-outcome case remains: if a Mach-O read has already failed with an integrity or I/O error and the signal aborts only while descriptor close also fails, the signal-only arm selects cancellation and discards cause.outcome.cause. Restrict that arm to completed outcomes so an already-established primary failure remains primary with cleanup attached.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8622810e8e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| RUST_BINARY_PROVIDER_IDENTITY.id, | ||
| cause.cleanup.resources, | ||
| { reason: cause.cleanup.reason }, | ||
| { operation: OPERATION, cause }, |
There was a problem hiding this comment.
Put retained Rust descriptors in a retryable scope
When readStableArtifact cannot close its descriptor, this stores the owner only through the returned error's cause; RustBinaryProvider has no resource scope and RustBinaryPort exposes no close(), so the persistent server service cannot retry that owner and subsequent inspections can open additional descriptors. Retain it in provider-owned state with retry-before-admission and final-close behavior instead of relying on callers to traverse an error cause.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| return new AnalysisCancelledError(OPERATION, { | ||
| cause: new AggregateError( | ||
| [new AnalysisCancelledError(OPERATION), cleanup], | ||
| "Cancelled with cleanup", | ||
| ), |
There was a problem hiding this comment.
Keep cleanup incomplete on late Rust cancellation
When the signal fires while descriptor close rejects, this returns an AnalysisCancelledError whose only reference to ProviderCleanupError is inside AggregateError.cause; the top-level error therefore has cleanupIncomplete === false, and normal projections omit the still-open descriptor path. Compose cancellation with the cleanup failure (or attach its cleanup observation) so late cancellation does not falsely report completed cleanup.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| "Cancelled with cleanup", | ||
| ), | ||
| }); | ||
| return cleanup; |
There was a problem hiding this comment.
Preserve Rust read failures alongside cleanup
When the file operation itself has already failed (for example with an integrity or size-limit failure) and descriptor close also fails, cause.cleanup enters this branch and the unconditional return reports only cleanup, even though the typed primary is retained in cause.outcome. Build the normal Rust analysis error from the failed outcome and compose it with cleanup, reserving a bare cleanup error for a completed read.
AGENTS.md reference: AGENTS.md:L31-L31
Useful? React with 👍 / 👎.
| pending.engine, | ||
| [path, pending.tree?.outputRoot ?? path], | ||
| { reason: cause instanceof Error ? cause.message : String(cause) }, | ||
| [entry.path], |
There was a problem hiding this comment.
Report the retained firmware workspace on retry
When a descriptor belonging to a firmware workspace still fails to close during retry, the workspace root is deliberately kept in #pendingCleanup because the parent cleanup below runs only after descriptors.size reaches zero, but this retry error names only entry.path. A subsequent execute() or close() therefore omits an owned residual workspace from cleanupResources; include the pending root path in this failure as the initial operation error does.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
…al destructuring Fixes morluto#4490
8622810 to
8ee0a28
Compare
|
@greptile review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ee0a28c92
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| initializer.node.name, | ||
| ); | ||
| if (targetBinding !== undefined) { | ||
| const parentOrigin = bindingOrigin(targetBinding, state, visited); |
There was a problem hiding this comment.
Bound alias-origin traversal before recursing
When an analyzed bundle contains a long stable alias chain (for example, thousands of const aN = aNMinus1 declarations ending in one Electron use), this recursive call consumes one JavaScript stack frame per alias. The new visited set only stops cycles, so a valid chain within accepted source limits can raise RangeError: Maximum call stack size exceeded and abort analysis instead of returning bounded or unknown evidence; walk the chain iteratively (and preferably memoize origins) or enforce a reported depth limit.
AGENTS.md reference: AGENTS.md:L51-L52
Useful? React with 👍 / 👎.
…lished cleanup errors
|
@greptile review |
|
@codex review |
|
@greptile review |
|
@codex review |
|
@greptile review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f298b7c3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const isWithin = isDarwinOrWin | ||
| ? isPathWithinRoot(normRoot.toLowerCase(), normApp.toLowerCase()) | ||
| : isPathWithinRoot(normRoot, normApp); | ||
| if (!isWithin) return false; |
There was a problem hiding this comment.
Honor package mains outside the bundle root
When an unpacked packaged app declares a valid entry such as "main": "../launcher.js" (or an absolute path) and application_path selects that file, Electron resolves and launches it from resources/app/package.json, but this early containment return prevents the manifest from being inspected. capture() then appends the already-loaded entry as a positional argument, so applications that interpret positionals as documents or URLs run a different scenario; inspect the package entry before rejecting an out-of-root selected path.
AGENTS.md reference: AGENTS.md:L13-L13
Useful? React with 👍 / 👎.
|
@greptile review |
|
@codex review |
|
@greptile review |
|
@codex review |
| ? javaProbe.error instanceof AnalysisError | ||
| ? { | ||
| _tag: "GhidraJavaProbeFailure", | ||
| code: "runtime_unavailable", | ||
| detail: `${javaCommand}: ${javaProbe.error.userMessage ?? javaProbe.error.message}`, | ||
| ...(javaProbe.error.capturedOutput === undefined | ||
| ? {} | ||
| : { output: javaProbe.error.capturedOutput }), |
There was a problem hiding this comment.
Java errors lose their explanation
installationCoordinates drops the Java probe's diagnostics when it converts an AnalysisError into GhidraJavaProbeFailure. A failed macOS ownership-helper build records stage: "ownership_preparation" and compiler_outcome, but this conversion keeps only the generic adapter message and captured output. Users then see a Java runtime failure without the stage or compiler result that explains it.
Preserve those diagnostics in the installation failure and its caller-facing output.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ghidra/GhidraInstallation.ts
Line: 571-578
Comment:
**Java errors lose their explanation**
`installationCoordinates` drops the Java probe's diagnostics when it converts an `AnalysisError` into `GhidraJavaProbeFailure`. A failed macOS ownership-helper build records `stage: "ownership_preparation"` and `compiler_outcome`, but this conversion keeps only the generic adapter message and captured output. Users then see a Java runtime failure without the stage or compiler result that explains it.
Preserve those diagnostics in the installation failure and its caller-facing output.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1dbdf9ff5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| initializer.node.name, | ||
| ); | ||
| if (targetBinding !== undefined) { | ||
| const parentOrigin = bindingOrigin(targetBinding, state, visited); |
There was a problem hiding this comment.
Check initialization order before following aliases
When an alias is initialized before a hoisted var receives its module value (for example, var alias = electron; var electron = require("electron")), this recursive hop asks bindingOrigin() for the target's eventual initializer without comparing source positions. alias actually captured undefined, but guarded uses such as alias && new alias.BrowserWindow() are now reported as Electron evidence; require the target origin to be established before the alias initializer, otherwise retain unknown provenance.
AGENTS.md reference: AGENTS.md:L21-L21
Useful? React with 👍 / 👎.
CassieFox23
left a comment
There was a problem hiding this comment.
TL;DR: The maintainer closed three of the five issues the PR names (#4475, #4483, #4495). The PR's diff no longer touches the files its body says fix them. Only #4490 and #4494 are still open, and the PR's tests for them pass on Node 22, 24 and 26. The one P1 thread on the current head is already handled.
Issues the PR names
| Issue | State now | What I found |
|---|---|---|
| #4475 | closed, completed | not in this PR's diff; commit 2d163c1 ("Refs #4475") is in the PR base |
| #4483 | closed, completed | not in this PR's diff; commit 542fa84 ("Refs #4458, #4483") is in the PR base |
| #4495 | closed, completed | not in this PR's diff; commit d292c44 ("Refs #4495") is in the PR base |
| #4490 | open | the fix is in this PR (javascriptSemanticAnalysis.ts) and not on main |
| #4494 | open | the fix is in this PR (Electron provider and hook) and not on main |
The PR body also lists tests for the first three, such as safeOutputTree.test.ts and firmwareReportFiles.test.ts. None of those files is in the diff against the base. So the body and the diff no longer match. GitHub shows the three issues closed as completed by the maintainer. No commit is attached. I did not check why; I only read the issue state, the close events and the commit messages.
Findings and verdicts
Head is f1dbdf9. Base is b33c0df. Main is 92dadf9. Bot threads: 38 unresolved, 15 P1 and 23 P2. This table covers the P1s. "Not real at head" means I ran a check and it passed.
| Thread | Claim | Verdict | What I saw |
|---|---|---|---|
| 4 threads on FirmwareProvider.ts (also r4295469220, r4295469228, r4295469239) | Cleanup and descriptor retention | Moot at head | FirmwareProvider.ts is byte-identical to main (cmp exit 0) and not in the diff |
| ArtifactProvider.ts | Run dyld traces in the scope | Moot at head | Byte-identical to main (cmp exit 0) and not in the diff |
| DylibResolutionReader.ts and second thread | Dyld cleanup owners | Moot at head | Byte-identical to main (cmp exit 0) and not in the diff |
| RustBinaryProvider.ts and second thread | Rust descriptor retry | Moot at head | Byte-identical to main (cmp exit 0) and not in the diff |
| Hook drops caller ASAR args | The hook strips every .asar argument |
Not real at head | The hook has no asar filter now; electronActiveHook.test.ts passes |
| Package probe can block | A FIFO at package.json hangs |
Not real at head | A FIFO there is rejected as target_not_allowed in 0 to 1 ms on Node 22, 24 and 26 |
| Failed probe close lost | A failed close is not retained | Not real at head | The test at line 1108 of PlaywrightElectronActiveProvider.test.ts passes |
| Manifest read outside the scope | Read skips the resource scope | Not real at head (code read, not run) | capture() runs inside #resources.run() at line 314 |
| Provider not closed on shutdown | Nothing calls close() |
Not real at head (code read, not run) | transport.ts line 88 and createServer.ts line 407 reach close() |
| Cleanup lost on cancellation | Abort hides a failed close | Not real at head | I aborted mid-read with a close that always fails: cleanup_failed, cleanupIncomplete: true, scope still pending; provider.close() then clears it. Same on Node 22, 24 and 26 |
Passing tests: 14 files, 402 tests, same on Node 22.23.1, 24.18.0 and 26.11.1. They cover:
- The Electron provider, hook and cleanup tests
electronBundledRequireIdentityJavaScriptArtifactPathResolutionsingleCommandLineSchemapacketOutput- The cutter and rizin tests
- Two Ghidra tests
Not run
- The 23 P2 threads. Nine are on the current head, such as alias-chain depth, BOM handling and package
mainfallbacks. I did not probe them. - A live Electron capture of the draw.io case from #4494. Only unit tests ran.
- Typecheck and lint, and the full suite.
- Why the maintainer closed #4475, #4483 and #4495.
- The extra files in the diff (cutter, tshark, Ghidra, apktool). Only their test files ran, and I skipped the Ghidra CLI test because it runs
doctor.
The PR sits on a 6.5.0 base and main is at 6.7.0. If the PR is rebased, a short body that lists only #4490 and #4494 would match the diff.
Thanks, qorvr, for the Electron and Webpack fixes. I hope this makes the bot threads easier to read.
Test setup
Commands
npm ci --ignore-scripts; npm run prepare; npm run build:cached; npm run test:prepare (Node 24, tree at f1dbdf9ff)
npm run test:focused -- src/application/javascript/JavaScriptArtifactPathResolution.test.ts \
src/browser/PlaywrightElectronActiveProvider.test.ts src/contracts/singleCommandLineSchema.test.ts \
src/domain/javascript/electronBundledRequireIdentity.test.ts \
tests/boundary/browser/electronActiveCleanup.test.ts tests/boundary/browser/electronActiveHook.test.ts \
tests/boundary/captures/packetOutput.test.ts tests/boundary/cli/cutterCommands.test.ts \
tests/boundary/cli/reverseEngineeringCommands.test.ts tests/boundary/mcp/cutterMcp.test.ts \
tests/boundary/mcp/rizinDebuggerCancellationMcp.test.ts tests/boundary/providers/CutterBridgeService.test.ts \
tests/boundary/filesystem/ghidraJavaProbe.test.ts tests/boundary/filesystem/ghidraInstallationProperties.test.ts
(once each on Node 24, 22 and 26)
cmp <head tree>/src/artifacts/apple/DylibResolutionReader.ts <main tree>/src/artifacts/apple/DylibResolutionReader.ts
(and ArtifactProvider.ts, FirmwareProvider.ts, FirmwareCommand.ts, RustBinaryProvider.ts, SafeOutputTreeReadback.ts)
Two small probe tests of my own (abort during the package.json read with a failing close, and a FIFO at package.json) ran through the same test:focused command. None of the test files mentions doctor except the Ghidra CLI one, which I skipped.
All 38 unresolved threads (P2 included)
P1 rows are in the table above. P2 threads, none probed:
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊
|
TL;DR: The #4490 part works end to end. With this PR, the six fixtures from #4490 and Bitwarden desktop 2026.10.0 report the destructured handlers and window. This adds CLI runs on real inputs to CassieFox23's unit-test review above. I only tested #4490, not #4494 or the other files. Builds: Fixtures from #4490 (
With the fix, E's window carries the same Bitwarden desktop 2026.10.0 (
The only channel added is Unit test: the PR's version of Not covered: #4494 and the other files in the diff, the P2 threads (for example alias-chain depth), and computed-key or rest-element patterns. For the last, #4490 asked for an unknown rather than silence; I did not test whether one is reported. |
Resolves #4475, #4483, #4490, #4494, #4495
Summary of Defects & Key Changes
1. #4495: Apple Dyld Resolution File Admission & Descriptor Lifecycle
DylibResolutionReader.tsopened candidate Mach-O files with blockingO_RDONLY | O_NOFOLLOW(withoutO_NONBLOCK), causing MCP workers to hang indefinitely if candidate paths in dyld search routes were FIFOs or special devices. Candidate files were opened 3 times independently (startsWithMachoMagic,readImage,fileSha256), descriptor close failures infinallydropped descriptor ownership, and the outer catch masked underlying I/O errors if the abort signal triggered after the failure.withOwnedRegularFileenforcing non-blocking flags (O_NONBLOCK | O_NOFOLLOW), guarding against FIFOs withNonRegularFileReadError, retaining unclosed descriptors into caller-providedArtifactResourceScopefor provider retry, preserving exact cancellation causes, and avoiding masking primary I/O failures.src/artifacts/apple/MachoLoadCommandReader.test.tsfor FIFO named-pipe non-blocking handling and exact cancellation propagation.2. #4494: Packaged Electron App (draw.io) Modal Dialog & Scenario Blocker
PlaywrightElectronActiveProvider.tspassedpaths.application(app.asar) as a positional CLI argument. For packaged applications like draw.io or VS Code, the binary already packages the application, so passing the ASAR path causes the application to treat it as a user document to open on startup, triggering an "Invalid file" modal dialog that blocks declared scenario actions.paths.applicationwhenpaths.executable === paths.application, and updatedscripts/electron-active-hook.cjsto sanitizeprocess.argvon startup, removing internal REA flags and positional ASAR arguments under packaged binaries.src/browser/PlaywrightElectronActiveProvider.test.tsverified argument construction and hook sanitization across packaged and unpackaged scenarios (24/24 passed).3. #4483: Output Tree Readback Cancellation Assertion & Error Preservation
SafeOutputTreeReadback.ts:hashOutputFile()lacked a post-loop cancellation assertion. An aborted stream or zero-byte read could return successfully and validate against expected hashes instead of propagating cancellation, and masked original I/O errors (EIO) with cancellation.isAborted()checks after the chunk read loop and afterassertFilePathIdentity(), preserved{ cause: signal.reason }, and prevented cancellation from masking preceding I/O errors.tests/boundary/filesystem/safeOutputTree.test.tsasserting cancellation failure reason and cause propagation (19/19 passed).4. #4490: Webpack-Bundled External Destructuring Analysis Loss
var ext = __webpack_require__('electron'); const { BrowserWindow } = ext;) failed identifier origin resolution becausebindingOrigin()only checked directrequire()calls and dropped identifier initializers.javascriptSemanticAnalysis.tsto trace identifier initializers usingresolveSemanticBindingStatewith a visited cycle guard so destructured bindings inherit parent module origin (electron->BrowserWindow).src/domain/javascript/electronBundledRequireIdentity.test.tsconfirmedBrowserWindowandipcMainorigin resolution (42/42 passed).5. #4475: Firmware Read Handle Close Failure Retention
PendingFirmwareCleanup.descriptors, enabled retries viaprovider.close(), and attachedpartialObservationon descriptor cleanup errors.tests/boundary/firmware/firmwareReportFiles.test.tsandtests/boundary/firmware/firmwareWorkspaceRecovery.test.ts(45/45 passed).Verification
npm run check:fastpassed (turborepo typecheck & lint, 0 errors, 0 warnings).