#28082 /v1/messages: pre_call_hook metadata.agent_id mutations don't reach spend_logs.agent_id
## Setup
- LiteLLM proxy running with `general_settings.callbacks: ["custom_callbacks.proxy_handler_instance", "custom_callbacks.header_metadata_handler"]` - `HeaderToMetadata` is a `CustomLogger` subclass whose `async_pre_call_hook` reads two request headers (`x-litellm-metadata-agent-id`, `x-litellm-metadata-gateway-id`) and writes them into both `data["metadata"]["agent_id"]` and `data["agent_id"]` so the spend logger picks them up. - Goal: tag every spend log row with the calling agent identity so cross-app per-agent cost attribution works.
## What works
`/v1/chat/completions` with the header set lands the value in the dedicated `LiteLLM_SpendLogs.agent_id` column. Verified end-to-end (model: `kainotomic-primary` → `openai/gpt-5.5`, populated `agent_id = 'test-callback-smoke-15-1646'`).
## What doesn't work
Same callback for `/v1/messages` route_type (`anthropic_messages`):
- Callback DOES fire — confirmed via debug print on the pre_call_hook - Header IS read — debug log shows `hdr_agent='anthropic-debug-1652'` - `data["metadata"]["agent_id"]` AND `data["agent_id"]` both set in hook - Spend log row is created with `call_type='anthropic_messages'`, `model='openai/fd-claude…