環境変数

CLAUDE_ENABLE_BYTE_WATCHDOG

1 を設定するとバイトレベルのストリーミングアイドルウォッチドッグを強制的に有効にし、0 を設定すると強制的に無効にする。0 は、その期限が動作している接続における最初のバイトまでの期限も無効にする。未設定の場合、ウォッチドッグは直接の Anthropic API 接続と AWS 上の Claude Platform 接続、および ANTHROPIC_BASE_URL や ANTHROPIC_AWS_BASE_URL で到達するゲートウェイ接続のストリーミング応答に対して既定で有効である。v2.1.222 より前はこれらのゲートウェイ接続では動作しなかったため、keep-alive の ping が届いている間でもイベントレベルのウォッチドッグが停止と報告することがあった。タイムアウトやタイマーの相互作用については、Streaming idle watchdogs を参照。

使い方・用途

  • keep-alive が届いているのにイベントレベルの watchdog が停滞と誤検出する gateway 接続(v2.1.222 より前の挙動)で、バイト単位の監視を強制的に有効にして対処する
  • 接続種別ごとの既定挙動に任せず、対象接続上で byte-level streaming idle watchdog を明示的に有効または無効にしたい
  • first-byte deadline を個別のタイムアウト変数を触らずにオフにしたい場合に 0 を設定する
英語原文(公式ドキュメントより)

Set to 1 to force-enable the byte-level streaming idle watchdog, or set to 0 to force-disable it. 0 also turns off the first-byte deadline on the connections where that deadline runs. When unset, the watchdog is enabled by default for direct Anthropic API and Claude Platform on AWS connections, and for streaming responses on gateway connections reached through ANTHROPIC_BASE_URL or ANTHROPIC_AWS_BASE_URL; before v2.1.222 it didn't run on those gateway connections, so the event-level watchdog could report a stall there even while keep-alive pings were arriving. For timeouts and how the timers interact, see Streaming idle watchdogs

関連ドキュメント