fix(engines): serialize JEB acquisition and respect IDA cancellation

Validation: integrated changes passed formatting, typecheck, lint, resolved module-boundary verification and git diff --check. Tests and real-provider workflows were not run.
This commit is contained in:
morluto
2026-10-11 00:03:23 +08:00
parent d438675677
commit 5f30ea6ff2
3 changed files with 159 additions and 25 deletions
+4
View File
@@ -2,6 +2,7 @@ import { z } from "zod";
import { analysisSearchInput } from "../contracts/analysisSearchContract.js";
import {
AnalysisInputError,
AnalysisCancelledError,
AnalysisProtocolError,
} from "../domain/analysisErrorCore.js";
import {
@@ -62,16 +63,19 @@ export class IdaOperationRunner {
private readonly connection: IdaMcpConnection,
private readonly protocol: "legacy" | "modern",
private readonly database?: string,
private readonly signal?: AbortSignal,
) {}
async call(
tool: string,
args: Readonly<Record<string, JsonValue>>,
): Promise<JsonValue> {
if (this.signal?.aborted) throw new AnalysisCancelledError(tool);
const scoped =
this.database === undefined ? args : { ...args, database: this.database };
const result = await this.connection.call(tool, scoped);
this.raw.push({ tool, arguments: scoped, result });
if (this.signal?.aborted) throw new AnalysisCancelledError(tool);
return result;
}
+3
View File
@@ -195,8 +195,11 @@ export class IdaSessionClient implements AnalysisClient {
this.connection,
this.config.mode === "attached" ? "legacy" : "modern",
this.#database,
options?.signal,
);
const result = await runner.run(operation, parameters);
if (wasCancelled(options))
return err(new AnalysisCancelledError(operation));
const after = await this.#observe();
if (wasCancelled(options))
return err(new AnalysisCancelledError(operation));