fix(mcp): preserve retained evidence on oversized delivery

This commit is contained in:
morluto
2026-10-09 05:55:55 +08:00
parent 826583dd43
commit 0639a541a3
36 changed files with 339 additions and 184 deletions
+2 -4
View File
@@ -7,7 +7,7 @@ import type { AndroidOperation } from "../domain/android/androidAnalysis.js";
import type { Logger } from "../logger.js";
import { logToolExecution } from "./toolLogging.js";
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
import { toCallToolResult } from "./toolResult.js";
import { toCallToolResult, toEvidenceToolResult } from "./toolResult.js";
/** Bind Android handlers to their exact named contracts through shared workflows. */
export const registerAndroidTools = (
@@ -24,9 +24,7 @@ export const registerAndroidTools = (
);
if (!result.ok) return toCallToolResult(result, contract);
const recorded = recordEvidence?.(result.value);
return recorded !== undefined && !recorded.ok
? toCallToolResult(recorded, contract)
: toCallToolResult(result, contract);
return toEvidenceToolResult(result.value, contract, recorded);
};
};
const packageContract = toolContract("inspect_android_package");