Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

stop truncating monitor judge input

Developers Digestea40da5f03ae
diff --git a/apps/api/src/services/monitoring/judgeChange.ts b/apps/api/src/services/monitoring/judgeChange.ts
index 9d303c8bb..9bf69fe43 100644
--- a/apps/api/src/services/monitoring/judgeChange.ts
+++ b/apps/api/src/services/monitoring/judgeChange.ts
@@ -80,16 +80,6 @@ interface JudgeChangeArgs {
};
}
-const MARKDOWN_EXCERPT_CAP = 1500;
-const DIFF_TEXT_CAP = 3000;
-
-function truncate(s: string, cap: number): string {
- if (s.length <= cap) return s;
- const head = s.slice(0, Math.floor(cap * 0.6));
- const tail = s.slice(-Math.floor(cap * 0.3));
- return `${head}\n…[${s.length - head.length - tail.length} chars truncated]…\n${tail}`;
-}
-
function isMeaningfulChangeEvent(
value: unknown,
): value is MeaningfulChangeEvent {
@@ -172,17 +162,11 @@ export async function judgeChange(
}
if (markdownDiff) {
if (markdownDiff.diffText) {
- parts.push(
- `PAGE DIFF (unified):\n${truncate(markdownDiff.diffText, DIFF_TEXT_CAP)}`,
- );
+ parts.push(`PAGE DIFF (unified):\n${markdownDiff.diffText}`);
}
if (markdownDiff.previous || markdownDiff.current) {
- parts.push(
- `PREVIOUS PAGE (excerpt):\n${truncate(markdownDiff.previous ?? "", MARKDOWN_EXCERPT_CAP)}`,
- );
- parts.push(
- `CURRENT PAGE (excerpt):\n${truncate(markdownDiff.current ?? "", MARKDOWN_EXCERPT_CAP)}`,
- );
+ parts.push(`PREVIOUS PAGE:\n${markdownDiff.previous ?? ""}`);
+ parts.push(`CURRENT PAGE:\n${markdownDiff.current ?? ""}`);
}
}
if (jsonDiff && Object.keys(jsonDiff).length > 0) {