From bfa32f66167f1fbe952f1204f6fa214fe04f78d1 Mon Sep 17 00:00:00 2001 From: yucheng Date: Wed, 23 Sep 2026 08:06:28 +0000 Subject: [PATCH] test(langfuse_otel): build rig config and wire batches immutably Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../observability/test_langfuse_otel_metadata.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration/observability/test_langfuse_otel_metadata.py b/tests/integration/observability/test_langfuse_otel_metadata.py index 03b828b0c50..fb07b672f7e 100644 --- a/tests/integration/observability/test_langfuse_otel_metadata.py +++ b/tests/integration/observability/test_langfuse_otel_metadata.py @@ -57,8 +57,11 @@ def _langfuse_rig( return Reply() with wire_server(upstream) as provider, wire_server(sink) as collector: - config: Final = yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text()) - config["litellm_settings"].update({"callbacks": ["langfuse_otel"], **settings}) + raw_config: Final = yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text()) + config: Final = { + **raw_config, + "litellm_settings": {**raw_config["litellm_settings"], "callbacks": ["langfuse_otel"], **settings}, + } path: Final = tmp_path / "langfuse_otel.yaml" path.write_text(yaml.safe_dump(config)) with owned_proxy( @@ -76,7 +79,7 @@ def _langfuse_rig( def _observation_span(collector: Wire, response_id: str) -> dict[str, object]: - batches: Final = [] + batches: Final[list[Request]] = [] # mutable-ok: drain() consumes the queue, so accumulating needs a mutable list def spans() -> tuple[dict[str, object], ...]: batches.extend(collector.drain())