環境変数

CLAUDE_ENABLE_STREAM_WATCHDOG

0 を設定するとイベントレベルのストリーミングアイドルウォッチドッグを強制的に無効にし、1 を設定すると強制的に有効にする。未設定の場合、ウォッチドッグはすべてのプロバイダーで既定で有効である。v2.1.196 より前では、未設定時の既定は直接の Anthropic API ではサーバー制御、その他のプロバイダーではオフだった。タイムアウトは CLAUDE_STREAM_IDLE_TIMEOUT_MS で設定し、これと並行して動作する他の停止検知タイマーについては Streaming idle watchdogs を参照。

使い方・用途

  • レスポンスヘッダー受信後、レスポンスボディのストリーミングが途中で止まったリクエストを自動的に中断してリトライさせたい場面で使う。
  • プロバイダ側の制御ではなく自分の判断でストリーミング監視(watchdog)の有効・無効を強制的に切り替えたい場面で使う。
  • v2.1.196 未満のバージョンで、direct Anthropic API 以外のプロバイダ利用時に既定で無効になっているストリーミング監視を強制的に有効化したい場面で使う。
英語原文(公式ドキュメントより)

Set to 0 to force-disable the event-level streaming idle watchdog, or set to 1 to force-enable it. When unset, the watchdog is on by default for all providers. Before v2.1.196, the unset default was server-controlled on the direct Anthropic API and off on other providers. Configure the timeout with CLAUDE_STREAM_IDLE_TIMEOUT_MS; for the other stall timers that run alongside this one, see Streaming idle watchdogs

関連ドキュメント

関連する変更履歴

v2.1.196(1件)

Changed
ストリーミング停止を検知するウォッチドッグ機能が全プロバイダーでデフォルト有効化
英語原文を表示
The streaming idle watchdog is now on by default for all providers — it aborts and retries when a response stream produces no events for 5 minutes. Set CLAUDE_ENABLE_STREAM_WATCHDOG=0 to disable.

変更後

ネットワークの不安定さによる「応答待ちのフリーズ」から自動で回復し、作業が中断されるストレスを軽減します。

関連ドキュメント