elasticdash-test 0.1.21-alpha-1 → 0.1.21-alpha-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/judge-utils.ts +5 -3
package/package.json
CHANGED
package/src/core/judge-utils.ts
CHANGED
|
@@ -29,13 +29,15 @@ export function prepareOutputForJudge(
|
|
|
29
29
|
maxChars: number = DEFAULT_MAX_CHARS,
|
|
30
30
|
): string {
|
|
31
31
|
if (!output) return output
|
|
32
|
-
if (output.length <= maxChars) return output
|
|
33
32
|
|
|
34
|
-
//
|
|
33
|
+
// Always attempt JSON-aware processing (value truncation + key extraction).
|
|
34
|
+
// Even outputs under maxChars can contain arrays with 100+ items that
|
|
35
|
+
// drown out the fields the judge actually needs to evaluate.
|
|
35
36
|
const jsonResult = tryJsonExtract(output, judgePrompt, maxChars)
|
|
36
37
|
if (jsonResult !== null) return jsonResult
|
|
37
38
|
|
|
38
|
-
//
|
|
39
|
+
// Non-JSON: only truncate if over budget
|
|
40
|
+
if (output.length <= maxChars) return output
|
|
39
41
|
return truncateHeadTail(output, maxChars)
|
|
40
42
|
}
|
|
41
43
|
|