mirror of
https://github.com/instructkr/claw-code.git
synced 2026-12-02 00:00:34 +08:00
Adds an optional per-client ExtraHeadersHook. Hosts that need routing, quota or cache-affinity metadata can install it with with_extra_headers_provider on AnthropicClient, OpenAiCompatClient or ProviderClient; headers are applied inside send_raw_request after the JSON body is built. There is no global state and no behaviour change when no provider is installed. count_tokens does not go through send_raw_request, so it stays unannotated. Transport-owned headers and malformed names/values are dropped, so a broken hook cannot rewrite credentials or fail a call. Co-authored-by: tree-zby <203675912+tree-zby@users.noreply.github.com>