@bluecopa/harness 0.1.0-snapshot.112 → 0.1.0-snapshot.113

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.
@@ -1237,7 +1237,15 @@ function extractFinalOutput(messages) {
1237
1237
  for (let i = messages.length - 1; i >= 0; i--) {
1238
1238
  const msg = messages[i];
1239
1239
  if (msg.role === "assistant" && (!msg.toolCalls || msg.toolCalls.length === 0)) {
1240
- return getTextContent(msg.content).slice(0, 200);
1240
+ const text = getTextContent(msg.content).trim();
1241
+ if (text) return text.slice(0, 200);
1242
+ }
1243
+ }
1244
+ for (let i = messages.length - 1; i >= 0; i--) {
1245
+ const msg = messages[i];
1246
+ if (msg.role === "assistant") {
1247
+ const text = getTextContent(msg.content).trim();
1248
+ if (text) return text.slice(0, 200);
1241
1249
  }
1242
1250
  }
1243
1251
  return "";
@@ -1445,7 +1453,10 @@ function validateObservedProcessResult(request, facts) {
1445
1453
  reasons.push("Expected a read outcome, but no files were read and no commands were run.");
1446
1454
  }
1447
1455
  if (spec.outcome === "answer" && !facts.finalOutput.trim()) {
1448
- reasons.push("Expected a direct answer, but the thread produced no final output.");
1456
+ const hasStructured = !!facts.structuredOutput && Object.keys(facts.structuredOutput).length > 0;
1457
+ if (!hasStructured) {
1458
+ reasons.push("Expected a direct answer, but the thread produced no final output.");
1459
+ }
1449
1460
  }
1450
1461
  if (spec.outcome === "verify" && facts.commandsRun.length === 0) {
1451
1462
  reasons.push("Expected a verification outcome, but no commands were run.");