From 7a003942a8362e89ecfe1c4a45e35eeb867567c6 Mon Sep 17 00:00:00 2001 From: Entrpi Date: Sun, 1 Nov 2026 16:54:09 +1100 Subject: [PATCH] fix(rizin): keep the selected executable when the command fails to start When the command failed to start after identification, for example with E2BIG, the error kept the provider, the resolved path, the digest and the banner, but not the executable the caller selected. Evidence records it as provider_executable, and only the ENOENT launch branch carried it as command; an E2BIG resource constraint carries just argument_bytes, so a bare alias or configured path was lost. The retained diagnostics now include provider_executable beside the lookup, hash and probe facts. --- docs/reverse-engineering-tools.md | 3 ++- src/application/reverse/ReverseEngineeringService.ts | 4 +++- .../mcp/reverseEngineeringProviderEnvironmentMcp.test.ts | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/reverse-engineering-tools.md b/docs/reverse-engineering-tools.md index 1c680919109..345166cda6c 100644 --- a/docs/reverse-engineering-tools.md +++ b/docs/reverse-engineering-tools.md @@ -126,7 +126,8 @@ that answers. Each call therefore launches the executable twice, the probe and then the command. If the command then fails to start, for example with `E2BIG` because its arguments exceed the host's launch limit, the call returns no Evidence; the error's `details.diagnostics` keep `provider`, the tool and -version, and the `provider_*` parameters above. A probe that is cancelled, or +version, the selected `provider_executable`, and the `provider_*` parameters +above. A probe that is cancelled, or whose cleanup is incomplete, keeps the executable path and SHA-256 there; a hash that is cancelled or reaches the deadline keeps the executable path; and a lookup that is cancelled or reaches the deadline keeps the path it was checking, as diff --git a/src/application/reverse/ReverseEngineeringService.ts b/src/application/reverse/ReverseEngineeringService.ts index 06769bc7d07..49f97725bc3 100644 --- a/src/application/reverse/ReverseEngineeringService.ts +++ b/src/application/reverse/ReverseEngineeringService.ts @@ -694,10 +694,12 @@ export class ReverseEngineeringService { } if (earlyFailure !== undefined) { // Without command output there is no Evidence to carry what the lookup, - // hash and probe observed, so the failure keeps it. + // hash and probe observed, so the failure keeps it beside the + // executable the caller selected. if (identification.observed) earlyFailure.retainDiagnostics({ provider: identification.identity, + provider_executable: command, ...identification.parameters, }); return err(this.#registerCleanupFailure(earlyFailure, cleanupOwner)); diff --git a/tests/boundary/mcp/reverseEngineeringProviderEnvironmentMcp.test.ts b/tests/boundary/mcp/reverseEngineeringProviderEnvironmentMcp.test.ts index 17ec2fdb5ca..155105520e3 100644 --- a/tests/boundary/mcp/reverseEngineeringProviderEnvironmentMcp.test.ts +++ b/tests/boundary/mcp/reverseEngineeringProviderEnvironmentMcp.test.ts @@ -203,6 +203,7 @@ it("keeps the probe's identification when the command then fails to start", asyn details: { diagnostics: { ...scenario.diagnostics, + provider_executable: "rizin", provider_executable_path: executable, provider_executable_sha256: digest, provider_version_banner: scenario.banner,