fix(mcp): preserve retained evidence on oversized delivery
This commit is contained in:
@@ -19,7 +19,7 @@ import { observeJavaScriptRuntimeInputSchema } from "../domain/javascript/javasc
|
||||
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";
|
||||
|
||||
interface RuntimeToolRegistration {
|
||||
readonly logger: Logger;
|
||||
@@ -83,7 +83,5 @@ const runRuntimeTool = async <Input>(
|
||||
);
|
||||
if (!result.ok) return toCallToolResult(result, contract);
|
||||
const recorded = options.recordEvidence?.(result.value);
|
||||
return recorded !== undefined && !recorded.ok
|
||||
? toCallToolResult(recorded, contract)
|
||||
: toCallToolResult({ ok: true, value: result.value }, contract);
|
||||
return toEvidenceToolResult(result.value, contract, recorded);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user