Skip to content

fix(images): honor a deployment's turn_off_message_logging, Langfuse keys and callbacks again - #54668

Open
quietjules wants to merge 3 commits into
BerriAI:mainfrom
quietjules:litellm_images_deployment_log_settings
Open

quietjules wants to merge 3 commits into
BerriAI:mainfrom
quietjules:litellm_images_deployment_log_settings

Conversation

@quietjules

@quietjules quietjules commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Image generation on the proxy stopped following a deployment's own logging settings, so a deployment set to keep prompts out of logs still sent the prompt to every logging integration, and its own Langfuse project got nothing. This puts those settings back for each image request and each fallback attempt, so every logged row follows the deployment that actually handled it

Details

TLDR

Problem this solves:

  • Image requests ignore a deployment's turn_off_message_logging since v1.112.0-dev.1
  • That deployment's own Langfuse keys and callbacks are skipped too

How it solves it:

  • Each image attempt reapplies its own deployment's log settings
  • Request and key settings still win over the deployment's

User Flow

Before: an admin who turned off message logging on one image deployment still sees its prompts in their logs

  1. The admin sets turn_off_message_logging: true, its own Langfuse keys and success_callback: ["langfuse"] on an image deployment and restarts the proxy
  2. A developer sends POST https://litellm-domain/v1/images/generations with that model and a prompt, and gets HTTP 200 with an image
  3. The proxy's custom logger gets the full prompt, also when the request fails or falls back onto that deployment
  4. That deployment's Langfuse project shows no trace for the request

After: the same request logs no prompt, and its trace lands in the deployment's own Langfuse project

  1. The admin sets turn_off_message_logging: true, its own Langfuse keys and success_callback: ["langfuse"] on an image deployment and restarts the proxy
  2. A developer sends POST https://litellm-domain/v1/images/generations with that model and a prompt, and gets HTTP 200 with an image
  3. The proxy's custom logger gets the request with no prompt, also when it fails or falls back onto that deployment
  4. That deployment's Langfuse project shows one litellm-aimage_generation trace with an empty input

Affected release

Regression since v1.112.0-dev.1 (#52103), also on the rc/1.112.0 line

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Both proxies ran at the same time on one machine, 2 workers each, no database, with real Gemini calls (gemini/gemini-3.1-flash-image, chat on gemini/gemini-3.5-flash-lite). A small custom logger writes one row per logged event, and prompt_in_log is true when the prompt text zebra-marker-7731 shows up anywhere the logger can read. Each request sends its own x-litellm-call-id so its rows can be found again. Deployments named private* set turn_off_message_logging: true, and the *fail and privatefirst ones use an invalid key so Google answers a real error. The deployment's own Langfuse project is a local Langfuse 4.86.0, since the Langfuse Cloud project this ran against before is out of free units and now answers every export with a 403

Case e42e0db, before #52103 113766d, #52103 beb69b2, merge base a75b927, this PR
private, served no prompt prompt prompt no prompt
privatefail, failed no prompt prompt prompt no prompt
openfail -> private, served row no prompt prompt prompt no prompt
privatefirst -> open, failed row no prompt prompt prompt no prompt
privatefirst -> open, served row prompt prompt prompt prompt
private, streamed not on main yet not on main yet prompt no prompt
privatelangfuse, custom logger no prompt prompt prompt no prompt
privatelangfuse, own Langfuse 1 trace, no input 0 traces 0 traces 1 trace, no input
client-sent langfuse_host not run not run 401, rejected 401, rejected
open, served prompt prompt prompt prompt
privatechat, chat prompt prompt prompt prompt

Every private deployment's own row should show no prompt and every open one should show it. This PR brings back the behavior from before #52103 and also covers image streaming, which came to main after it. A caller still cannot send the deployment's Langfuse keys to a host of its own, since the proxy rejects langfuse_host in the request body on both commits

Shared setup: config.yaml, custom logger, local Langfuse, start script, case script

Env var names: GEMINI_API_KEY, QA_LANGFUSE_PUBLIC_KEY, QA_LANGFUSE_SECRET_KEY, QA_LANGFUSE_HOST, CAPTURE_LOG_PATH, PYTHONPATH (the folder holding capture_logger.py). The three Langfuse values come from langfuse.env, which points at the local Langfuse, and langfuse-selfhost.curlrc holds the same key pair for the read API. Each proxy started as launch.sh <worktree> <port> <capture file> and the cases ran as cases.sh <port> <capture file>

Local Langfuse, from the docker-compose.yml at tag v4.86.0 of langfuse/langfuse, with LANGFUSE_INIT_ORG_ID, LANGFUSE_INIT_PROJECT_ID, LANGFUSE_INIT_PROJECT_PUBLIC_KEY and LANGFUSE_INIT_PROJECT_SECRET_KEY set in keys.env and an override that publishes only the web port on 127.0.0.1

docker compose -p bfc5413f-langfuse --env-file keys.env -f docker-compose.yml -f override.yml up -d

config.yaml

model_list:
  - model_name: open
    litellm_params:
      model: gemini/gemini-3.1-flash-image
      api_key: os.environ/GEMINI_API_KEY
  - model_name: private
    litellm_params:
      model: gemini/gemini-3.1-flash-image
      api_key: os.environ/GEMINI_API_KEY
      turn_off_message_logging: true
  - model_name: privatefail
    litellm_params:
      model: gemini/gemini-3.1-flash-image
      api_key: invalid-key-for-qa
      turn_off_message_logging: true
  - model_name: openfail
    litellm_params:
      model: gemini/gemini-3.1-flash-image
      api_key: invalid-key-for-qa
  - model_name: privatefirst
    litellm_params:
      model: gemini/gemini-3.1-flash-image
      api_key: invalid-key-for-qa
      turn_off_message_logging: true
  - model_name: privatelangfuse
    litellm_params:
      model: gemini/gemini-3.1-flash-image
      api_key: os.environ/GEMINI_API_KEY
      turn_off_message_logging: true
      success_callback: ["langfuse"]
      langfuse_public_key: os.environ/QA_LANGFUSE_PUBLIC_KEY
      langfuse_secret_key: os.environ/QA_LANGFUSE_SECRET_KEY
      langfuse_host: os.environ/QA_LANGFUSE_HOST
  - model_name: privatechat
    litellm_params:
      model: gemini/gemini-3.5-flash-lite
      api_key: os.environ/GEMINI_API_KEY
      turn_off_message_logging: true
router_settings:
  fallbacks:
    - openfail: ["private"]
    - privatefirst: ["open"]
litellm_settings:
  callbacks: capture_logger.handler

capture_logger.py

import json
import os

from litellm.integrations.custom_logger import CustomLogger

MARKER = "zebra-marker-7731"
OUT = os.environ["CAPTURE_LOG_PATH"]


def _has_marker(value):
    return MARKER in json.dumps(value, default=str)


class CaptureLogger(CustomLogger):
    def _write(self, event, kwargs):
        slo = kwargs.get("standard_logging_object") or {}
        row = {
            "call_id": kwargs.get("litellm_call_id"),
            "event": event,
            "model_group": slo.get("model_group"),
            "prompt_in_log": _has_marker(kwargs.get("messages"))
            or _has_marker(kwargs.get("input"))
            or _has_marker(slo),
        }
        with open(OUT, "a") as f:
            f.write(json.dumps(row) + "\n")

    async def async_log_success_event(self, kwargs, response_obj, start_time, end_time):
        self._write("success", kwargs)

    async def async_log_failure_event(self, kwargs, response_obj, start_time, end_time):
        self._write("failure", kwargs)


handler = CaptureLogger()

launch.sh

#!/bin/zsh
T=$1
PORT=$2
Q=${0:A:h}
E=/home/mateo/Development/litellm-worktrees/work-bfc5413f-head/.env
LF=$Q/langfuse.env
export PYTHON_DOTENV_DISABLED=1
export GEMINI_API_KEY="$(~/.claude/bin/dotenv-get GEMINI_API_KEY --file $E)"
export QA_LANGFUSE_PUBLIC_KEY="$(~/.claude/bin/dotenv-get LANGFUSE_PUBLIC_KEY --file $LF)"
export QA_LANGFUSE_SECRET_KEY="$(~/.claude/bin/dotenv-get LANGFUSE_SECRET_KEY --file $LF)"
export QA_LANGFUSE_HOST="$(~/.claude/bin/dotenv-get LANGFUSE_HOST --file $LF)"
export LITELLM_DANGEROUSLY_PERMIT_WEAK_OR_UNSET_MASTER_KEY=true
export CAPTURE_LOG_PATH=$3
export PYTHONPATH=$Q
cd $T
git status --porcelain | grep -v '^?? target/$' && { print "BLOCKED: tree not clean"; exit 3 }
print "tree $(git rev-parse --short HEAD) workers 2 port $PORT"
exec $T/.venv/bin/litellm --config $Q/config.yaml --port $PORT --num_workers 2 --timeout_worker_healthcheck 300

cases.sh

#!/bin/zsh
PORT=$1
CAP=$2
Q=${0:A:h}
cd $Q
LANGFUSE_HOST=$(~/.claude/bin/dotenv-get LANGFUSE_HOST --file $Q/langfuse.env)
START=$(date -u +%Y-%m-%dT%H:%M:%SZ)
run() { printf '$ %s\n' "$1"; eval "$1"; print }
typeset -A ID
for m in open private privatefail openfail privatefirst privatelangfuse privatechat private_stream; do ID[$m]=$(uuidgen); done
for m in open private privatefail openfail privatefirst privatelangfuse; do
  run "curl -sS http://localhost:$PORT/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: ${ID[$m]}' -d '{\"model\":\"$m\",\"prompt\":\"a zebra-marker-7731 tree, flat icon\"}' -w '\nHTTP %{http_code}\n' | cut -c1-160"
done
run "curl -sS http://localhost:$PORT/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: ${ID[private_stream]}' -d '{\"model\":\"private\",\"prompt\":\"a zebra-marker-7731 tree, flat icon\",\"stream\":true}' -w '\nHTTP %{http_code}\n' | cut -c1-160"
run "curl -sS http://localhost:$PORT/v1/chat/completions -H 'Content-Type: application/json' -H 'x-litellm-call-id: ${ID[privatechat]}' -d '{\"model\":\"privatechat\",\"messages\":[{\"role\":\"user\",\"content\":\"say hi zebra-marker-7731\"}]}' -w '\nHTTP %{http_code}\n' | cut -c1-160"
run "curl -sS http://localhost:$PORT/v1/images/generations -H 'Content-Type: application/json' -d '{\"model\":\"privatelangfuse\",\"prompt\":\"a zebra-marker-7731 tree, flat icon\",\"langfuse_host\":\"https://attacker.example\"}' -w '\nHTTP %{http_code}\n' | cut -c1-200"
sleep 10
for m in open private privatefail openfail privatefirst privatelangfuse private_stream privatechat; do
  print "# $m"
  run "grep ${ID[$m]} $CAP"
done
sleep 45
run "curl -sS --config langfuse-selfhost.curlrc '$LANGFUSE_HOST/api/public/v2/observations?fields=core,basic,io,metadata&limit=100&fromStartTime=$START' | jq -c '[.data[] | select(.metadata.litellm_call_id == \"${ID[privatelangfuse]}\")] | {observations: length, names: map(.name), inputs: map(.input)}'"

Before (beb69b2)

private, served

  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 04379fde-5746-4129-9a03-ce1e7bb0b7a7' -d '{"model":"private","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683628,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 04379fde-5746-4129-9a03-ce1e7bb0b7a7 capture-base4.jsonl
{"call_id": "04379fde-5746-4129-9a03-ce1e7bb0b7a7", "event": "success", "model_group": "private", "prompt_in_log": true}

privatefail, failed

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 02f1a369-398b-4321-bb43-e377e8de1809' -d '{"model":"privatefail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"error":{"message":"litellm.AuthenticationError: GeminiException - {\n  \"error\": {\n    \"code\": 400,\n    \"message\": \"API key not valid. Please pass a v
HTTP 401
  1. Read the logged rows for that call id
$ grep 02f1a369-398b-4321-bb43-e377e8de1809 capture-base4.jsonl
{"call_id": "02f1a369-398b-4321-bb43-e377e8de1809", "event": "failure", "model_group": "privatefail", "prompt_in_log": true}

openfail falls back to private

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 238f6493-abe0-4fe4-a852-11d82a2b8d13' -d '{"model":"openfail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683637,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 238f6493-abe0-4fe4-a852-11d82a2b8d13 capture-base4.jsonl
{"call_id": "238f6493-abe0-4fe4-a852-11d82a2b8d13", "event": "failure", "model_group": "openfail", "prompt_in_log": true}
{"call_id": "238f6493-abe0-4fe4-a852-11d82a2b8d13", "event": "success", "model_group": "private", "prompt_in_log": true}

privatefirst falls back to open

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 07ebed59-23b1-4b73-8d99-ea5826f5688b' -d '{"model":"privatefirst","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683646,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 07ebed59-23b1-4b73-8d99-ea5826f5688b capture-base4.jsonl
{"call_id": "07ebed59-23b1-4b73-8d99-ea5826f5688b", "event": "failure", "model_group": "privatefirst", "prompt_in_log": true}
{"call_id": "07ebed59-23b1-4b73-8d99-ea5826f5688b", "event": "success", "model_group": "open", "prompt_in_log": true}

private, streamed

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: f505dd26-caf2-4fb3-b349-dbc542b1d4f0' -d '{"model":"private","prompt":"a zebra-marker-7731 tree, flat icon","stream":true}' -w '\nHTTP %{http_code}\n' | cut -c1-160
event: image_generation.completed
data: {"type":"image_generation.completed","created_at":1795683661,"usage":{"total_tokens":1470,"input_tokens":13,"input_tokens_details":{"image_tokens":0,"text


HTTP 200
  1. Read the logged rows for that call id
$ grep f505dd26-caf2-4fb3-b349-dbc542b1d4f0 capture-base4.jsonl
{"call_id": "f505dd26-caf2-4fb3-b349-dbc542b1d4f0", "event": "success", "model_group": "private", "prompt_in_log": true}

privatelangfuse, its own Langfuse project

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 61183289-1f59-43a8-ab42-f97346ff8c87' -d '{"model":"privatelangfuse","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683654,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 61183289-1f59-43a8-ab42-f97346ff8c87 capture-base4.jsonl
{"call_id": "61183289-1f59-43a8-ab42-f97346ff8c87", "event": "success", "model_group": "privatelangfuse", "prompt_in_log": true}
  1. Look the call up in the deployment's Langfuse project
$ curl -sS --config langfuse-selfhost.curlrc 'http://127.0.0.1:30720/api/public/v2/observations?fields=core,basic,io,metadata&limit=100&fromStartTime=2026-11-26T09:00:14Z' | jq -c '[.data[] | select(.metadata.litellm_call_id == "61183289-1f59-43a8-ab42-f97346ff8c87")] | {observations: length, names: map(.name), inputs: map(.input)}'
{"observations":0,"names":[],"inputs":[]}

privatelangfuse with a client-sent Langfuse host

Commands and output
  1. Send the request with its own langfuse_host
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -d '{"model":"privatelangfuse","prompt":"a zebra-marker-7731 tree, flat icon","langfuse_host":"https://attacker.example"}' -w '\nHTTP %{http_code}\n' | cut -c1-200
{"error":{"message":"Authentication Error, Rejected Request: langfuse_host is not allowed in request body. Clientside passthrough requires explicit admin opt-in via either `general_settings.allow_clie
HTTP 401

open, served (control)

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 007b7169-7fd6-4d34-ac5b-b2229e9bb595' -d '{"model":"open","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683621,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 007b7169-7fd6-4d34-ac5b-b2229e9bb595 capture-base4.jsonl
{"call_id": "007b7169-7fd6-4d34-ac5b-b2229e9bb595", "event": "success", "model_group": "open", "prompt_in_log": true}

privatechat, chat (out of scope)

Commands and output
  1. Send the request
$ curl -sS http://localhost:31465/v1/chat/completions -H 'Content-Type: application/json' -H 'x-litellm-call-id: 2df709f1-0cda-47f0-a16c-2d788599e97c' -d '{"model":"privatechat","messages":[{"role":"user","content":"say hi zebra-marker-7731"}]}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"id":"TvUHa6LMDeGvvMcPsvmDuAk","created":1795683662,"model":"privatechat","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"c
HTTP 200
  1. Read the logged rows for that call id
$ grep 2df709f1-0cda-47f0-a16c-2d788599e97c capture-base4.jsonl
{"call_id": "2df709f1-0cda-47f0-a16c-2d788599e97c", "event": "success", "model_group": "privatechat", "prompt_in_log": true}

After (a75b927)

private, served

  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 646ef6a0-954c-436b-b70e-d0a9206bd308' -d '{"model":"private","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683627,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 646ef6a0-954c-436b-b70e-d0a9206bd308 capture-tip4.jsonl
{"call_id": "646ef6a0-954c-436b-b70e-d0a9206bd308", "event": "success", "model_group": "private", "prompt_in_log": false}

privatefail, failed

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: f8789e5f-5ed5-4acd-be15-ed5cf1db36fa' -d '{"model":"privatefail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"error":{"message":"litellm.AuthenticationError: GeminiException - {\n  \"error\": {\n    \"code\": 400,\n    \"message\": \"API key not valid. Please pass a v
HTTP 401
  1. Read the logged rows for that call id
$ grep f8789e5f-5ed5-4acd-be15-ed5cf1db36fa capture-tip4.jsonl
{"call_id": "f8789e5f-5ed5-4acd-be15-ed5cf1db36fa", "event": "failure", "model_group": "privatefail", "prompt_in_log": false}

openfail falls back to private

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 23b47877-0efe-4146-abc0-b7ad530af0b9' -d '{"model":"openfail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683636,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 23b47877-0efe-4146-abc0-b7ad530af0b9 capture-tip4.jsonl
{"call_id": "23b47877-0efe-4146-abc0-b7ad530af0b9", "event": "failure", "model_group": "openfail", "prompt_in_log": true}
{"call_id": "23b47877-0efe-4146-abc0-b7ad530af0b9", "event": "success", "model_group": "private", "prompt_in_log": false}

privatefirst falls back to open

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: a60a12fd-c0b6-4a99-bad4-5ff128803929' -d '{"model":"privatefirst","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683642,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep a60a12fd-c0b6-4a99-bad4-5ff128803929 capture-tip4.jsonl
{"call_id": "a60a12fd-c0b6-4a99-bad4-5ff128803929", "event": "failure", "model_group": "privatefirst", "prompt_in_log": false}
{"call_id": "a60a12fd-c0b6-4a99-bad4-5ff128803929", "event": "success", "model_group": "open", "prompt_in_log": true}

private, streamed

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 388ea3e9-06d2-48c0-b4f8-ddc361caea32' -d '{"model":"private","prompt":"a zebra-marker-7731 tree, flat icon","stream":true}' -w '\nHTTP %{http_code}\n' | cut -c1-160
event: image_generation.completed
data: {"type":"image_generation.completed","created_at":1795683654,"usage":{"total_tokens":1382,"input_tokens":13,"input_tokens_details":{"image_tokens":0,"text


HTTP 200
  1. Read the logged rows for that call id
$ grep 388ea3e9-06d2-48c0-b4f8-ddc361caea32 capture-tip4.jsonl
{"call_id": "388ea3e9-06d2-48c0-b4f8-ddc361caea32", "event": "success", "model_group": "private", "prompt_in_log": false}

privatelangfuse, its own Langfuse project

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 32c20994-2b75-4356-944c-8a07f93c7650' -d '{"model":"privatelangfuse","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683648,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 32c20994-2b75-4356-944c-8a07f93c7650 capture-tip4.jsonl
{"call_id": "32c20994-2b75-4356-944c-8a07f93c7650", "event": "success", "model_group": "privatelangfuse", "prompt_in_log": false}
  1. Look the call up in the deployment's Langfuse project
$ curl -sS --config langfuse-selfhost.curlrc 'http://127.0.0.1:30720/api/public/v2/observations?fields=core,basic,io,metadata&limit=100&fromStartTime=2026-11-26T09:00:14Z' | jq -c '[.data[] | select(.metadata.litellm_call_id == "32c20994-2b75-4356-944c-8a07f93c7650")] | {observations: length, names: map(.name), inputs: map(.input)}'
{"observations":1,"names":["litellm-aimage_generation"],"inputs":[null]}

privatelangfuse with a client-sent Langfuse host

Commands and output
  1. Send the request with its own langfuse_host
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -d '{"model":"privatelangfuse","prompt":"a zebra-marker-7731 tree, flat icon","langfuse_host":"https://attacker.example"}' -w '\nHTTP %{http_code}\n' | cut -c1-200
{"error":{"message":"Authentication Error, Rejected Request: langfuse_host is not allowed in request body. Clientside passthrough requires explicit admin opt-in via either `general_settings.allow_clie
HTTP 401

open, served (control)

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 7c4caf67-2f2a-470f-8f44-6e74f7c1b2a9' -d '{"model":"open","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795683621,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6zpFSlAAAQAAAAEAADo7anVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAFuN
HTTP 200
  1. Read the logged rows for that call id
$ grep 7c4caf67-2f2a-470f-8f44-6e74f7c1b2a9 capture-tip4.jsonl
{"call_id": "7c4caf67-2f2a-470f-8f44-6e74f7c1b2a9", "event": "success", "model_group": "open", "prompt_in_log": true}

privatechat, chat (out of scope)

Commands and output
  1. Send the request
$ curl -sS http://localhost:30018/v1/chat/completions -H 'Content-Type: application/json' -H 'x-litellm-call-id: a57154b4-7780-4508-b89d-11b2cd6b5c00' -d '{"model":"privatechat","messages":[{"role":"user","content":"say hi zebra-marker-7731"}]}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"id":"RvUHa5rmO9LCodAPqercmQs","created":1795683654,"model":"privatechat","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"c
HTTP 200
  1. Read the logged rows for that call id
$ grep a57154b4-7780-4508-b89d-11b2cd6b5c00 capture-tip4.jsonl
{"call_id": "a57154b4-7780-4508-b89d-11b2cd6b5c00", "event": "success", "model_group": "privatechat", "prompt_in_log": true}

Earlier checkpoints

e42e0db, the commit before #52103
$ curl -sS http://localhost:21758/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 471a5b85-08cf-476a-b672-526f2c6c0ded' -d '{"model":"open","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484701,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:21758/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: f1100730-1666-484a-aca8-cf57d2f124bb' -d '{"model":"private","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484710,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:21758/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: f24234fa-5c0a-49ea-b3af-8fc9074cef26' -d '{"model":"privatefail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"error":{"message":"litellm.AuthenticationError: GeminiException - {\n  \"error\": {\n    \"code\": 400,\n    \"message\": \"API key not valid. Please pass a v
HTTP 401

$ curl -sS http://localhost:21758/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 1a26d477-00b1-4c62-917d-05104d8e0543' -d '{"model":"openfail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484719,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:21758/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: cadc583a-ce92-4a68-a77d-632b4a1ac30f' -d '{"model":"privatefirst","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484727,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:21758/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 1a0e1929-27ff-48b6-8101-3d6e3d57375d' -d '{"model":"privatelangfuse","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484736,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:21758/v1/chat/completions -H 'Content-Type: application/json' -H 'x-litellm-call-id: 9ee2b02e-a227-44a9-b844-a47766705472' -d '{"model":"privatechat","messages":[{"role":"user","content":"say hi zebra-marker-7731"}]}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"id":"QewEa4TUMfTcodAPvs3g6As","created":1795484737,"model":"privatechat","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"c
HTTP 200

# open
$ grep 471a5b85-08cf-476a-b672-526f2c6c0ded capture-regbefore.jsonl
{"call_id": "471a5b85-08cf-476a-b672-526f2c6c0ded", "event": "success", "model_group": "open", "prompt_in_log": true}

# private
$ grep f1100730-1666-484a-aca8-cf57d2f124bb capture-regbefore.jsonl
{"call_id": "f1100730-1666-484a-aca8-cf57d2f124bb", "event": "success", "model_group": "private", "prompt_in_log": false}

# privatefail
$ grep f24234fa-5c0a-49ea-b3af-8fc9074cef26 capture-regbefore.jsonl
{"call_id": "f24234fa-5c0a-49ea-b3af-8fc9074cef26", "event": "failure", "model_group": "privatefail", "prompt_in_log": false}

# openfail
$ grep 1a26d477-00b1-4c62-917d-05104d8e0543 capture-regbefore.jsonl
{"call_id": "1a26d477-00b1-4c62-917d-05104d8e0543", "event": "failure", "model_group": "openfail", "prompt_in_log": true}
{"call_id": "1a26d477-00b1-4c62-917d-05104d8e0543", "event": "success", "model_group": "private", "prompt_in_log": false}

# privatefirst
$ grep cadc583a-ce92-4a68-a77d-632b4a1ac30f capture-regbefore.jsonl
{"call_id": "cadc583a-ce92-4a68-a77d-632b4a1ac30f", "event": "failure", "model_group": "privatefirst", "prompt_in_log": false}
{"call_id": "cadc583a-ce92-4a68-a77d-632b4a1ac30f", "event": "success", "model_group": "open", "prompt_in_log": true}

# privatelangfuse
$ grep 1a0e1929-27ff-48b6-8101-3d6e3d57375d capture-regbefore.jsonl
{"call_id": "1a0e1929-27ff-48b6-8101-3d6e3d57375d", "event": "success", "model_group": "privatelangfuse", "prompt_in_log": false}

# privatechat
$ grep 9ee2b02e-a227-44a9-b844-a47766705472 capture-regbefore.jsonl
{"call_id": "9ee2b02e-a227-44a9-b844-a47766705472", "event": "success", "model_group": "privatechat", "prompt_in_log": true}

$ curl -sS --config langfuse.curlrc 'https://cloud.langfuse.com/api/public/v2/observations?fields=core,basic,io,metadata&limit=100&fromStartTime=2026-11-24T01:44:00Z&toStartTime=2026-11-24T01:47:00Z' | jq -c '[.data[] | select(.metadata.litellm_call_id == "1a0e1929-27ff-48b6-8101-3d6e3d57375d")] | {observations: length, names: map(.name), inputs: map(.input)}'
{"observations":1,"names":["litellm-aimage_generation"],"inputs":[null]}
113766d, #52103
$ curl -sS http://localhost:25425/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 670999c9-4d20-4c95-989a-5980c5b42fbb' -d '{"model":"open","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484701,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:25425/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 7425f853-8efb-43a1-afdc-908893a238be' -d '{"model":"private","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484708,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:25425/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: f748367d-de60-40ea-a92d-4890cbef4887' -d '{"model":"privatefail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"error":{"message":"litellm.AuthenticationError: GeminiException - {\n  \"error\": {\n    \"code\": 400,\n    \"message\": \"API key not valid. Please pass a v
HTTP 401

$ curl -sS http://localhost:25425/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 6dcda7e0-6948-41cd-8ce3-53f65d8166d0' -d '{"model":"openfail","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484716,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:25425/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: b31bee72-e174-43e9-9567-e88fa01068b3' -d '{"model":"privatefirst","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484723,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:25425/v1/images/generations -H 'Content-Type: application/json' -H 'x-litellm-call-id: 2634b9e9-87ef-4a38-b61f-caf51abaa1d1' -d '{"model":"privatelangfuse","prompt":"a zebra-marker-7731 tree, flat icon"}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"created":1795484731,"background":null,"data":[{"b64_json":"/9j/4AAQSkZJRgABAQEBLAEsAAD/6x3xSlAAAQAAAAEAAB3nanVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAAHcF
HTTP 200

$ curl -sS http://localhost:25425/v1/chat/completions -H 'Content-Type: application/json' -H 'x-litellm-call-id: 0f963523-bacd-4047-bfd7-bf93ce385fb0' -d '{"model":"privatechat","messages":[{"role":"user","content":"say hi zebra-marker-7731"}]}' -w '\nHTTP %{http_code}\n' | cut -c1-160
{"id":"O-wEa_a4LaKEzLEPkPCXoQc","created":1795484731,"model":"privatechat","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"c
HTTP 200

# open
$ grep 670999c9-4d20-4c95-989a-5980c5b42fbb capture-regafter.jsonl
{"call_id": "670999c9-4d20-4c95-989a-5980c5b42fbb", "event": "success", "model_group": "open", "prompt_in_log": true}

# private
$ grep 7425f853-8efb-43a1-afdc-908893a238be capture-regafter.jsonl
{"call_id": "7425f853-8efb-43a1-afdc-908893a238be", "event": "success", "model_group": "private", "prompt_in_log": true}

# privatefail
$ grep f748367d-de60-40ea-a92d-4890cbef4887 capture-regafter.jsonl
{"call_id": "f748367d-de60-40ea-a92d-4890cbef4887", "event": "failure", "model_group": "privatefail", "prompt_in_log": true}

# openfail
$ grep 6dcda7e0-6948-41cd-8ce3-53f65d8166d0 capture-regafter.jsonl
{"call_id": "6dcda7e0-6948-41cd-8ce3-53f65d8166d0", "event": "failure", "model_group": "openfail", "prompt_in_log": true}
{"call_id": "6dcda7e0-6948-41cd-8ce3-53f65d8166d0", "event": "success", "model_group": "private", "prompt_in_log": true}

# privatefirst
$ grep b31bee72-e174-43e9-9567-e88fa01068b3 capture-regafter.jsonl
{"call_id": "b31bee72-e174-43e9-9567-e88fa01068b3", "event": "failure", "model_group": "privatefirst", "prompt_in_log": true}
{"call_id": "b31bee72-e174-43e9-9567-e88fa01068b3", "event": "success", "model_group": "open", "prompt_in_log": true}

# privatelangfuse
$ grep 2634b9e9-87ef-4a38-b61f-caf51abaa1d1 capture-regafter.jsonl
{"call_id": "2634b9e9-87ef-4a38-b61f-caf51abaa1d1", "event": "success", "model_group": "privatelangfuse", "prompt_in_log": true}

# privatechat
$ grep 0f963523-bacd-4047-bfd7-bf93ce385fb0 capture-regafter.jsonl
{"call_id": "0f963523-bacd-4047-bfd7-bf93ce385fb0", "event": "success", "model_group": "privatechat", "prompt_in_log": true}

$ curl -sS --config langfuse.curlrc 'https://cloud.langfuse.com/api/public/v2/observations?fields=core,basic,io,metadata&limit=100&fromStartTime=2026-11-24T01:44:00Z&toStartTime=2026-11-24T01:47:00Z' | jq -c '[.data[] | select(.metadata.litellm_call_id == "2634b9e9-87ef-4a38-b61f-caf51abaa1d1")] | {observations: length, names: map(.name), inputs: map(.input)}'
{"observations":0,"names":[],"inputs":[]}

Surprises from the run

  • Chat ignores a deployment's message logging switch, before and after
  • Langfuse trace ids no longer match the litellm call id
Decisions
  • Only image generation changes. Chat has an older, separate gap where a deployment's switch never applied, and fixing it here would change chat logging for everyone
  • Request and key settings still win over the deployment's, the same order the proxy used before fix(gemini): return n images for image generations and edits when n > 1 #52103
  • Settings follow each attempt, so a fallback logs every attempt under the deployment that ran it. Keeping the first deployment's settings for the whole request was rejected because it would hide an open deployment's prompt or leak a private one's
  • Only the previous attempt's deployment callbacks are swapped out. Replacing the whole callback list, as the LTS fix does, was rejected because it would drop callbacks attached to the request itself
  • The change sits in the router's per-attempt call for images. The proxy route cannot see fallbacks, and the SDK wrapper would change every endpoint
  • When no shared logging object comes in, as with direct SDK calls, nothing changes, since the SDK already reads the deployment's settings there
  • Attempts run one after another, and each failure row is logged before the next attempt changes the settings, so sharing one logging object is safe
  • A deployment's callbacks register once under the existing lock, the same way the SDK registers them. That keeps them process-wide, as images did before fix(gemini): return n images for image generations and edits when n > 1 #52103 and as chat and every other endpoint still do. Scoping them to one request would be its own change for every endpoint
  • A caller cannot aim the deployment's Langfuse keys at its own host. The proxy rejects langfuse_host in the request body before routing unless the admin opts in, which the live case above shows on both commits

Type

🐛 Bug Fix

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@veria-ai

veria-ai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

This PR restores image deployments’ handling of turn_off_message_logging, deployment-specific Langfuse credentials, and callbacks.

Two security issues remain open, with none addressed so far. An authenticated caller can redirect deployment Langfuse credentials to an attacker-controlled host when the optional destination allowlist is not enabled. Deployment callbacks also persist globally, allowing prompts and responses from unrelated deployments to reach a previously registered logger.

Open issues (2)

Fixed/addressed: 0 · PR risk: 8/10

Reviews

)

def follow_attempt_callback_settings(self, attempt_fields: Mapping[str, object]) -> None:
self.standard_callback_dynamic_params = _initialize_standard_callback_dynamic_params(dict(attempt_fields))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High: Client-selected Langfuse host receives deployment keys

For an image deployment configured with Langfuse credentials and a Langfuse callback, an authenticated caller can supply "langfuse_host": "https://attacker.example": the image attempt merges that host with the deployment keys, and this new assignment passes both to LangFuseHandler, whose exporter sends the keys in Basic authentication; the host allowlist is only enforced with OTel V2 enabled, which is off by default. Keep deployment credentials bound to their configured destination, and reject client destination overrides unless they use a complete caller-owned credential set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proxy rejects a request-body langfuse_host with a 401 before routing, unless the admin opts in (code). The PR body shows it live

return attempt_kwargs
deployment_callbacks: Final = configured_callbacks(attempt_kwargs.get("callbacks"))
if deployment_callbacks:
register_dynamic_callbacks(deployment_callbacks)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: Deployment callbacks persist across unrelated requests

register_dynamic_callbacks() permanently adds these deployment-specific callbacks to the process-wide input/success/failure registries, so requesting deployment A with callbacks: [loggerA] causes later requests to unrelated deployment B to deliver their prompts and responses to loggerA through get_combined_callback_list(). Attach deployment callbacks to the current attempt's Logging object instead, reserving global registration for server-wide callbacks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Images registered deployment callbacks process-wide before #52103 and chat still does (code). Scoping them per request is a separate change for every endpoint

@surlymochan surlymochan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the mechanism: image requests previously kept the first attempt's callback list for the whole call, so a fallback deployment's own turn_off_message_logging, Langfuse keys, and callbacks were ignored. The new follow_attempt_callback_settings swaps in each attempt's callbacks via _swapped_callbacks (keeps request-level callbacks, appends the new attempt's), and _attempt_callbacks_from returns None for success/failure when the request itself set callbacks — so request-level settings still win over per-attempt ones.

The tests pin the exact behaviors: test_image_log_follows_the_deployments_message_logging_setting, test_image_fallback_logs_each_attempt_by_its_own_deployments_message_logging, and test_image_log_carries_the_deployments_callback_params_unless_the_key_sets_them. The _resolved_dynamic_callbacks expansion of known-logger strings into instances also explains the test_repeated_image_requests_register_a_deployments_named_logger_once case — no duplicate logger registration across repeated requests.

One question on precedence: when the request sets success callbacks, per-attempt success callbacks are skipped entirely (None branch). Is that the intended precedence — request wins, attempt contributes nothing — or should the attempt's callbacks still run alongside? The code is consistent, just confirming the intent is deliberate.

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge with no actionable findings.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with no actionable findings.

Summary

Image attempts now apply the selected deployment’s logging settings to the shared Logging object.

  • Image logs now follow the deployment used for each attempt.

quietjules explicitly leaves chat logging unchanged and keeps deployment callbacks process-wide to match the existing SDK behavior. Request-only registration is deferred.

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants