Problem
When Zoo Code routes requests through a LiteLLM proxy, there is no way for the proxy operator to correlate individual API calls back to a specific Zoo Code conversation thread. LiteLLM natively recognizes the X-<vendor>-Session-ID request header and uses it to tag log entries and spend-tracking records with a session identifier.
Zoo Code already tracks a per-task UUID (taskId) that is unique to each conversation thread and is passed to every createMessage() call via ApiHandlerCreateMessageMetadata. This value is already forwarded to the Zoo Gateway provider as X-Zoo-Task-ID, and to OpenAI Native / Codex providers as session_id. However, the LiteLLMHandler does not forward it at all.
Expected Behavior
When Zoo Code sends a request to a LiteLLM proxy, the HTTP request should include:
X-Zoo-Session-ID: <taskId UUID>
This allows proxy operators to:
- Filter logs by conversation thread
- Track per-session token spend
- Diagnose cache control issues and request timing
- Correlate multi-turn conversations in LiteLLMs dashboard
Current Behavior
The LiteLLMHandler sends no session or task identifier in request headers. The taskId available in metadata is silently dropped.
References
Industry Context
This follows the x-<vendor>-session-id convention used by:
- Claude Code:
x-claude-code-session-id
- GitHub Copilot:
x-copilot-session-id
Problem
When Zoo Code routes requests through a LiteLLM proxy, there is no way for the proxy operator to correlate individual API calls back to a specific Zoo Code conversation thread. LiteLLM natively recognizes the
X-<vendor>-Session-IDrequest header and uses it to tag log entries and spend-tracking records with a session identifier.Zoo Code already tracks a per-task UUID (
taskId) that is unique to each conversation thread and is passed to everycreateMessage()call viaApiHandlerCreateMessageMetadata. This value is already forwarded to the Zoo Gateway provider asX-Zoo-Task-ID, and to OpenAI Native / Codex providers assession_id. However, theLiteLLMHandlerdoes not forward it at all.Expected Behavior
When Zoo Code sends a request to a LiteLLM proxy, the HTTP request should include:
This allows proxy operators to:
Current Behavior
The
LiteLLMHandlersends no session or task identifier in request headers. ThetaskIdavailable inmetadatais silently dropped.References
X-Zoo-Task-IDimplementation insrc/api/providers/zoo-gateway.tsApiHandlerCreateMessageMetadata.taskIdinsrc/api/index.tsIndustry Context
This follows the
x-<vendor>-session-idconvention used by:x-claude-code-session-idx-copilot-session-id