fix(frontend): displaying observation result statuses (#11559)

This commit is contained in:
Hiep Le 2025-10-29 23:02:32 +07:00 committed by GitHub
parent 4020448d64
commit 0e7fefca7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,9 +11,10 @@ export const getObservationResult = (
switch (observationType) {
case "ExecuteBashObservation": {
const exitCode = observation.exit_code;
const { metadata } = observation;
if (exitCode === -1) return "timeout"; // Command timed out
if (exitCode === 0) return "success"; // Command executed successfully
if (exitCode === -1 || metadata.exit_code === -1) return "timeout"; // Command timed out
if (exitCode === 0 || metadata.exit_code === 0) return "success"; // Command executed successfully
return "error"; // Command failed
}
case "FileEditorObservation":