refactor(observation): retain complete tool results

This commit is contained in:
morluto
2026-09-29 12:42:08 +08:00
parent 34d00fd323
commit fa2b6c5a61
37 changed files with 425 additions and 701 deletions
+2 -15
View File
@@ -14,14 +14,6 @@ import {
type WebCaptureDiff,
} from "./webCaptureDiff.js";
const maxChangesSchema = z
.number()
.int()
.min(1)
.max(20_000)
.default(2_000)
.describe("Maximum normalized change records to retain.");
/** Caller-visible object schema for passive and scenario capture comparisons. */
export const browserCaptureComparisonInputSchema = z
.strictObject({
@@ -41,7 +33,6 @@ export const browserCaptureComparisonInputSchema = z
.unwrap()
.optional()
.describe("Exact-literal normalization policy."),
max_changes: maxChangesSchema,
})
.superRefine((input, context) => {
const passive = input.before !== undefined && input.after !== undefined;
@@ -70,7 +61,7 @@ export type BrowserCaptureComparisonInput = z.output<
>;
type ScenarioCapturePair = Pick<
BrowserCaptureComparisonInput,
"before_scenario" | "after_scenario" | "normalization" | "max_changes"
"before_scenario" | "after_scenario" | "normalization"
> & {
before_scenario: NonNullable<
BrowserCaptureComparisonInput["before_scenario"]
@@ -107,9 +98,5 @@ const toPassiveComparison = (
): CompareWebCapturesInput => {
if (input.before === undefined || input.after === undefined)
throw new Error("Validated passive comparison is missing a capture");
return {
before: input.before,
after: input.after,
max_changes: input.max_changes,
};
return { before: input.before, after: input.after };
};