fix(stepper): handle evaluator errors gracefully in BasicEvaluator and RunnerPlugin#30
fix(stepper): handle evaluator errors gracefully in BasicEvaluator and RunnerPlugin#30Shrey5132 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces error handling to the evaluator startup process by wrapping the execution loop in try-catch blocks. In BasicEvaluator.ts, the evaluator loop is now monitored to notify the host of errors, and RunnerPlugin.ts has been updated to handle these errors asynchronously. Feedback highlights that the code following the infinite loop in BasicEvaluator.ts is unreachable and may cause compilation errors. Additionally, it is recommended to log the caught error in RunnerPlugin.ts rather than swallowing it silently to aid in debugging.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // The REPL loop only exits if the conduit is terminated externally. | ||
| this.conductor.updateStatus(RunnerStatus.STOPPED, true); |
| } catch (_e) { | ||
| // BasicEvaluator already sends RunnerStatus.ERROR; this is a safety net for | ||
| // evaluator subclasses that override startEvaluator without the same guarantee. | ||
| this.updateStatus(RunnerStatus.ERROR, true); | ||
| } |
There was a problem hiding this comment.
The caught error is currently swallowed silently. Swallowing errors makes debugging extremely difficult because the stack trace and error message are lost. It is highly recommended to log the error to console.error so that the failure details are visible in the logs.
} catch (e) {
console.error("Evaluator error:", e);
// BasicEvaluator already sends RunnerStatus.ERROR; this is a safety net for
// evaluator subclasses that override startEvaluator without the same guarantee.
this.updateStatus(RunnerStatus.ERROR, true);
}
This PR introduces error handling in
BasicEvaluatorandRunnerPluginto catch and handle evaluator-side errors, propagatingRunnerStatus.ERRORto the host. This prevents the host REPL loop from hanging indefinitely when evaluator plugins crash or fail to initialize.