Spaces:
Sleeping
Sleeping
fixed tool execution fail indicator
Browse files- 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 |
-
|
| 427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
|
| 429 |
// Determine error state:
|
| 430 |
-
// 1. If has
|
| 431 |
-
// 2. If has
|
| 432 |
-
// 3.
|
| 433 |
let hasError = false;
|
| 434 |
-
if (
|
| 435 |
hasError = false; // Explicit success
|
| 436 |
-
} else if (
|
| 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
|