feat(litellm): per-request Langfuse routing + trace linking; retrofit prod state
What
Adds a LiteLLM proxy custom callback that consolidates agently's two trace streams into one, and retrofits this role to match the running prod box.
Callback (files/custom_callbacks.py)
Reads hyphenated x-agent-langfuse-* request headers and, per request:
-
routes LiteLLM's Langfuse logging to the instance named by the headers (patches the per-request logging object's
standard_callback_dynamic_params— must be the logging object, since dynamic creds are resolved before the pre-call hook runs); -
links the GENERATION to the agently OTel trace via
x-agent-langfuse-trace-id→metadata["existing_trace_id"].
Hyphenated names sidestep LiteLLM's stock langfuse_ (underscore) parser and nginx's default underscore-dropping — no nginx change needed. Fails open.
Retrofit (group_vars + templates)
The repo still described the old Ollama setup; prod has moved to vLLM from /opt/litellm via a start.sh wrapper. Reconciled the role (config path, models, service unit, start.sh, debug logging, anthropic-messages passthrough) so site.yml reproduces — rather than clobbers — the live deployment. Rendered output diff-checked against the live /opt/litellm files.
Status
Already applied live on nocode and verified end-to-end (routing to the correct instance + GENERATION attaches to the trace; fail-open fallback confirmed). This MR captures that state as code.