From 1d5f5a144097242b23da32a706ed0b79ad8802ed Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 5 Jun 2026 13:41:30 +0800 Subject: [PATCH] fix(arch): conservative fallback for gateway error codes --- ...app_controller_desktop_thread_actions.dart | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/app/app_controller_desktop_thread_actions.dart b/lib/app/app_controller_desktop_thread_actions.dart index 43caac3e..5ce7bc44 100644 --- a/lib/app/app_controller_desktop_thread_actions.dart +++ b/lib/app/app_controller_desktop_thread_actions.dart @@ -1547,30 +1547,22 @@ extension AppControllerDesktopThreadActions on AppController { bool gatewayResultCodeRequiresNewSessionInternal(String code) { final normalized = code.trim().toUpperCase(); if (normalized.isEmpty || - normalized == 'SUCCESS' || - normalized == 'COMPLETED' || - normalized == 'READY') { + normalized == 'ACP_HTTP_CONNECTION_CLOSED') { return false; } if (normalized == 'RUNNING' || normalized == 'QUEUED' || normalized == 'ABORTED' || - normalized == gatewayAcpHttpConnectTimeoutCode || - normalized == gatewayAcpHttpConnectFailedCode || - normalized == gatewayAcpHttpHandshakeInterruptedCode || normalized == 'BRIDGE_NOT_CONNECTED' || - normalized == 'ACP_HTTP_401' || - normalized == 'ACP_HTTP_403' || - normalized == 'OPENCLAW_GATEWAY_SOCKET_CLOSED' || - normalized == 'OPENCLAW_GATEWAY_QUEUE_FULL' || - normalized == 'OPENCLAW_AGENT_FAILED_BEFORE_REPLY' || - normalized == 'OPENCLAW_NO_DISPLAYABLE_OUTPUT' || - normalized == 'OPENCLAW_NO_EXPORTED_ARTIFACTS' || - normalized == 'OPENCLAW_ARTIFACT_MISSING' || normalized == 'ARTIFACT_MISSING') { return true; } - return true; + if (normalized.startsWith('OPENCLAW_') || + normalized.startsWith('ACP_HTTP_') || + normalized.startsWith('GATEWAY_')) { + return true; // Conservative fallback for unrecognized infrastructure/gateway errors + } + return false; } Future abortRun() async {