fix(native): retain LLDB cleanup ownership through client close

This commit is contained in:
morluto
2026-10-10 04:35:03 +08:00
parent 0bfb6e00ab
commit 7ad353fa8b
9 changed files with 757 additions and 155 deletions
+15 -3
View File
@@ -1,5 +1,6 @@
import type { JsonValue } from "./jsonValue.js";
import { ProviderAdapterError } from "./providerAdapterError.js";
import type { AnalysisPartialObservation } from "./analysisErrorBase.js";
/** Provider resources could not be proven closed after bounded cleanup. */
export class ProviderCleanupError extends ProviderAdapterError {
@@ -13,10 +14,21 @@ export class ProviderCleanupError extends ProviderAdapterError {
resources: readonly string[],
diagnostics: Readonly<Record<string, JsonValue>>,
/** Identify the operation owning these resources; binary callers retain their default. */
options?: ErrorOptions & { readonly operation?: string },
options?: ErrorOptions & {
readonly operation?: string;
readonly partialObservation?: AnalysisPartialObservation;
},
) {
const { operation = "close_binary", ...errorOptions } = options ?? {};
super(providerId, operation, { ...errorOptions, diagnostics });
const {
operation = "close_binary",
partialObservation,
...errorOptions
} = options ?? {};
super(providerId, operation, {
...errorOptions,
...(partialObservation === undefined ? {} : { partialObservation }),
diagnostics,
});
this.cleanupResources = [...resources];
}
}