fix(coding-agent/modes): added checks to skip writing error messages to
- Added checks to skip writing error messages to stderr when stopReason is 'error' or 'aborted', as these cases already handle error output separately. - This prevents duplicate error reporting in print mode when the assistant encounters terminal error conditions.
This commit is contained in:
@@ -161,7 +161,11 @@ export async function runPrintMode(session: AgentSession, options: PrintModeOpti
|
||||
}
|
||||
}
|
||||
|
||||
if (assistantMsg.errorMessage) {
|
||||
if (
|
||||
assistantMsg.errorMessage &&
|
||||
assistantMsg.stopReason !== "error" &&
|
||||
assistantMsg.stopReason !== "aborted"
|
||||
) {
|
||||
process.stderr.write(`${sanitizeText(assistantMsg.errorMessage)}\n`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user