fraudTech commited on
Commit
d2a1df1
Β·
1 Parent(s): 9757f59

fixed tool execution fail indicator

Browse files
Files changed (1) hide show
  1. web/src/App.tsx +21 -7
web/src/App.tsx CHANGED
@@ -423,17 +423,31 @@ function App() {
423
  setStatusMessage('');
424
  // Check for explicit success or failure markers from backend
425
  const output = data.output || '';
426
- const hasSuccessMarker = output.includes('βœ…');
427
- const hasFailureMarker = output.includes('❌');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
 
429
  // Determine error state:
430
- // 1. If has βœ…, it's success (not an error)
431
- // 2. If has ❌, it's failure (is an error)
432
- // 3. If neither, check for other failure indicators
433
  let hasError = false;
434
- if (hasSuccessMarker && !hasFailureMarker) {
435
  hasError = false; // Explicit success
436
- } else if (hasFailureMarker) {
437
  hasError = true; // Explicit failure
438
  } else {
439
  // No markers, check other indicators
 
423
  setStatusMessage('');
424
  // Check for explicit success or failure markers from backend
425
  const output = data.output || '';
426
+
427
+ // Check for final success marker (bottom of output)
428
+ const hasFinalSuccess = output.includes('βœ… Classification stored') ||
429
+ output.includes('βœ… Lean 4 code compiled successfully') ||
430
+ output.includes('βœ… Python code executed successfully') ||
431
+ output.includes('βœ… SymPy code executed successfully') ||
432
+ output.includes('βœ… Prolog code executed') ||
433
+ output.includes('βœ… Found in Mathlib') ||
434
+ /βœ….*completed/i.test(output);
435
+
436
+ // Check for actual failure markers (not status indicators)
437
+ const hasActualFailure = output.includes('❌ BLOCKED') ||
438
+ output.includes('❌ Python execution failed') ||
439
+ output.includes('❌ SymPy execution failed') ||
440
+ output.includes('❌ Lean 4 compilation failed') ||
441
+ output.includes('❌ Not found in Mathlib');
442
 
443
  // Determine error state:
444
+ // 1. If has final success marker, it's success
445
+ // 2. If has actual failure marker, it's failure
446
+ // 3. Otherwise check for Error: prefix or non-zero exit code
447
  let hasError = false;
448
+ if (hasFinalSuccess) {
449
  hasError = false; // Explicit success
450
+ } else if (hasActualFailure) {
451
  hasError = true; // Explicit failure
452
  } else {
453
  // No markers, check other indicators