diff --git a/packages/vscode-ide-companion/src/webview/components/layout/InputForm.tsx b/packages/vscode-ide-companion/src/webview/components/layout/InputForm.tsx index 86ba42be..6bd3289a 100644 --- a/packages/vscode-ide-companion/src/webview/components/layout/InputForm.tsx +++ b/packages/vscode-ide-companion/src/webview/components/layout/InputForm.tsx @@ -144,10 +144,7 @@ export const InputForm: React.FC = ({ : ''; return ( -
+
{/* Inner background layer */} diff --git a/packages/vscode-ide-companion/src/webview/handlers/SessionMessageHandler.ts b/packages/vscode-ide-companion/src/webview/handlers/SessionMessageHandler.ts index 130ca107..4b4ca09c 100644 --- a/packages/vscode-ide-companion/src/webview/handlers/SessionMessageHandler.ts +++ b/packages/vscode-ide-companion/src/webview/handlers/SessionMessageHandler.ts @@ -439,19 +439,34 @@ export class SessionMessageHandler extends BaseMessageHandler { } else { const isTimeoutError = lower.includes('timeout') || lower.includes('timed out'); - if (!isTimeoutError) { - vscode.window.showErrorMessage(`Error sending message: ${error}`); - } else { - // 超时对用户没有可执行的操作,因此只在面板内重置信息,不弹出 VS Code 错误提醒 + if (isTimeoutError) { + // Timeout has no action for the user to perform, so only reset the information in the panel and no VS Code error alert will pop up. console.warn( '[SessionMessageHandler] Prompt timed out; suppressing popup', ); + + const timeoutMessage: ChatMessage = { + role: 'assistant', + content: + 'Request timed out (no response within 120 seconds). Please try again or simplify the request.', + timestamp: Date.now(), + }; + + // Send a timeout message to the WebView without terminating the stream + // In this way, the long-term task can continue to receive subsequent messages after timeout. + this.sendToWebView({ + type: 'message', + data: timeoutMessage, + }); + } else { + // Handling of Non-Timeout Errors + vscode.window.showErrorMessage(`Error sending message: ${error}`); + this.sendToWebView({ + type: 'error', + data: { message: errorMsg }, + }); + this.sendStreamEnd('error'); } - this.sendToWebView({ - type: 'error', - data: { message: errorMsg }, - }); - this.sendStreamEnd(isTimeoutError ? 'timeout' : 'error'); } } }