fix: suppress stack traces for timeout and abort errors in CLI/MCP output

Timeout and abort error stack traces are internal noise (Promise.race,
setTimeout, AbortController internals) that waste context window space
for LLM agents and clutter CLI output. Now only error.message is shown
to the user for these error types. Full stacks are still logged to the
relay server log file for debugging.
This commit is contained in:
Tommy D. Rossi
2026-02-26 13:04:18 +01:00
parent 2c7e859a7b
commit bf5ae2686d
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -1138,7 +1138,8 @@ export class PlaywrightExecutor {
return { text: finalText, images, isError: false }
} catch (error: any) {
const errorStack = error.stack || error.message
const isTimeoutError = error instanceof CodeExecutionTimeoutError || error.name === 'TimeoutError'
const isTimeoutError =
error instanceof CodeExecutionTimeoutError || error?.name === 'TimeoutError' || error?.name === 'AbortError'
this.logger.error('Error in execute:', errorStack)
+2 -1
View File
@@ -218,7 +218,8 @@ server.tool(
return { content }
} catch (error: any) {
const errorStack = error.stack || error.message
const isTimeoutError = error instanceof CodeExecutionTimeoutError || error.name === 'TimeoutError'
const isTimeoutError =
error instanceof CodeExecutionTimeoutError || error?.name === 'TimeoutError' || error?.name === 'AbortError'
console.error('Error in execute tool:', errorStack)
if (!isTimeoutError) {