[BUG] WithSecure Elements Agent (EDR) causes "Connection closed mid-response" errors during streaming responses

Status Fixed / completed
Reported on v2.1.223
Maintainer reply None cached
Activity 0 comments · opened Aug 8, 2026 · closed Aug 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

環境
Claude Code version: 2.1.223
Platform: Windows(社給PC、企業ネットワーク環境)
インターフェース:VS Code拡張機能(Claude Code for VS Code)およびターミナルCLI 両方で再現
症状

応答のストリーミング中に接続が切断され、以下のエラーが繰り返し発生する(1回の会話で10回程度連続することもある)。

API Error: Connection closed mid-response. The response above may be incomplete.
切り分け結果
DNS解決:正常(nslookup api.anthropic.com で正しいIPアドレス(160.79.104.10)を取得)
プロキシ設定:Windowsのシステム設定で無効化されていることを確認済み
TCP接続:Test-NetConnection api.anthropic.com -Port 443 は成功(TcpTestSucceeded: True)
ネットワーク切り分け:社内ネットワーク、自宅Wi-Fi、モバイル回線(iPhoneテザリング)のいずれでも再現し、ネットワーク環境に依存しない
ブラウザ版claude.ai(同一PC・同一ネットワーク環境):問題なく正常動作、ストリーミング応答も完全に受信できる
原因の推測

PCに常駐しているEDR製品「WithSecure Elements Agent」(旧F-Secure Business、バージョン26.3、Web保護/HTTPSインスペクション機能)が、Claude Code CLIおよびVS Code拡張機能が使用する長時間持続的なストリーミング接続(SSEまたはHTTP/2)を検査・遮断していると考えられる。通常のHTTPリクエスト(ブラウザ版claude.ai)は影響を受けていない。

発生時期

昨日夕方から継続して発生(それ以前は正常動作していた)。WithSecure側の何らかの更新か設定変更が影響した可能性がある。

要望
同様の報告が他ユーザー(特にWithSecure/F-Secure利用企業)からも寄せられているか
主要EDRベンダー(WithSecure、CrowdStrike、Microsoft Defender for Endpointなど)との既知の互換性情報があれば共有してほしい
可能であれば、企業ネットワーク管理者向けに「ストリーミング接続を維持するための推奨ファイアウォール/EDR除外設定」のドキュメント整備を検討してほしい

What Should Happen?

Claude Codeを使用中、ストリーミング応答が最後まで中断されることなく正常に完了するべき。WithSecure Elements Agentが導入されたPCでも、通常のブラウザ通信同様に安定して動作することを期待する。

Error Messages/Logs

API Error: Connection closed mid-response. The response above may be incomplete.
Above message is repeated 10 times

Steps to Reproduce

  1. WithSecure Elements Agent(EDR、バージョン26.3)が導入されたWindows PCでClaude Code CLIまたはVS Code拡張機能を起動する
  2. claudeコマンドでターミナルセッションを開始する、またはVS Code拡張機能でチャットを開始する
  3. 通常の質問を送信する(例:"日本の四季について詳しく教えてください")
  4. 応答のストリーミング中に接続が切断され、「API Error: Connection closed mid-response」が表示される
  5. 同じ質問をブラウザ版claude.ai(同一PC・同一ネットワーク)で送信すると、正常に完結する

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.223 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

セキュリティソフト: WithSecure Elements Agent (旧F-Secure Business) バージョン26.3
企業支給PC、企業ネットワーク環境下で発生。Windows Defenderファイアウォールではなく、上記EDR製品のWeb保護機能が疑われる。

View original on GitHub ↗