fix(android)!: preserve JVM settings and reuse metadata sessions (#908)

* perf(graph): avoid repeated traversal edge scans and copies

* fix(android)!: preserve JVM settings and reuse metadata sessions

Read class metadata without generating application source, retain immutable serialized APK sessions, and join owned cleanup on cancellation and shutdown.

BREAKING CHANGE: Android analysis now requires a full JDK 17 or newer with its compiler module for the packaged Java source bridge.
This commit is contained in:
morluto
2026-10-07 16:50:41 +08:00
committed by GitHub
parent f430c416c7
commit eab34a9d8c
36 changed files with 1165 additions and 138 deletions
+8 -2
View File
@@ -7,6 +7,7 @@ import { MCP_SHUTDOWN_FAILED } from "./messages.js";
export const createShutdown = (input: {
readonly handle: StdioServerHandle;
readonly closeAndroid?: () => Promise<void>;
readonly session: BinarySession;
readonly unregisterReload: () => void;
readonly dependencies: RuntimeDependencies;
@@ -23,8 +24,13 @@ export const createShutdown = (input: {
shutdownPromise ??= (async () => {
unregisterReload();
unregisterShutdown();
await handle.close();
await session.close({ retainProviderDocuments: true });
const results = await Promise.allSettled([
handle.close(),
input.closeAndroid?.(),
session.close({ retainProviderDocuments: true }),
]);
for (const result of results)
if (result.status === "rejected") throw result.reason;
})();
return shutdownPromise;
};