hunterlige
10/23/2025, 8:06 PM0.206.1
called "Result::unwrap()" on an "Err" value: PoisonError { .. }
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: baml_runtime::tracing::BamlTracer::start_call
4: baml_runtime::BamlRuntime::call_function_with_expr_events::{{closure}}
5: <pyo3_async_runtimes::generic::Cancellable<F> as core::future::future::Future>::poll
6: <tokio::task::task_local::TaskLocalFuture<T,F> as core::future::future::Future>::poll{{reify.shim}}
7: tokio::runtime::task::core::Core<T,S>::poll
8: tokio::runtime::task::raw::poll
9: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
10: tokio::runtime::task::raw::poll
note: Some details are omitted, run with "RUST_BACKTRACE=full" for a verbose backtrace.
thread "<unnamed>" panicked at baml-runtime/src/tracingv2/storage/storage.rs:669:45:
I do not see any fix in the storage.rs between 0.206.1 and 0.211.2. Will bump the version to latest and see if this is still an issue but sharing to let you know in the meantime.Vaibhav (BAML π)
10/23/2025, 8:28 PMhunterlige
10/23/2025, 8:48 PMhunterlige
10/23/2025, 8:48 PMVaibhav (BAML π)
10/23/2025, 9:19 PMVaibhav (BAML π)
10/23/2025, 9:19 PMhunterlige
10/23/2025, 10:28 PMhunterlige
10/23/2025, 10:29 PMVaibhav (BAML π)
10/23/2025, 10:29 PMhunterlige
10/23/2025, 10:30 PMVaibhav (BAML π)
10/23/2025, 10:31 PMhunterlige
10/23/2025, 10:40 PMpython
import asyncio
from collections.abc import Generator
from contextlib import contextmanager
from typing import TYPE_CHECKING, Literal
Components = Literal["agent"]
if TYPE_CHECKING:
from baml_py import Collector
@contextmanager
def baml_instrumentation(caller: Components) -> Generator["Collector"]:
from baml_py import Collector
baml_collector = Collector(caller)
try:
yield baml_collector
finally:
_record_baml_usage(baml_collector)
def get_usage_bytes_from_baml_collector(baml_collector: "Collector") -> int:
total_bytes = 0
for log in baml_collector.logs:
for call in log.calls:
if call.http_request:
total_bytes += len(call.http_request.body.text().encode("utf-8"))
if call.http_response:
total_bytes += len(call.http_response.body.text().encode("utf-8"))
return total_bytes
def _call_llm(baml_collector: "Collector", semaphore: asyncio.Semaphore):
from baml_client.async_client import BamlCallOptions
from baml_client import async_client
# Set up client_registry with GEMINI 2.5
baml_options = BamlCallOptions(
client_registry=client_registry,
collector=baml_collector,
)
return await async_client.b.GenerateText()
async def main():
semaphore = asyncio.BoundedSemaphore(20)
with baml_instrumentation("agent") as baml_collector:
async with asyncio.TaskGroup() as tg:
tasks = [
tg.create_task(
_call_llm(
baml_collector=baml_collector,
semaphore=semaphore,
)
)
for i in range(1_000)
]
total_bytes_processed = get_usage_bytes_from_baml_collector(baml_collector)hunterlige
10/23/2025, 10:41 PMVaibhav (BAML π)
10/23/2025, 10:41 PMhunterlige
10/23/2025, 10:43 PMVaibhav (BAML π)
10/24/2025, 8:16 PMhunterlige
11/06/2025, 5:12 PMaaronv (BAML)
11/06/2025, 5:13 PMaaronv (BAML)
11/06/2025, 5:14 PMaaronv (BAML)
11/06/2025, 5:14 PMhunterlige
11/06/2025, 7:55 PMaaronv (BAML)
11/07/2025, 10:45 PMaaronv (BAML)
11/07/2025, 10:49 PMaaronv (BAML)
11/07/2025, 10:57 PMaaronv (BAML)
11/07/2025, 11:00 PMaaronv (BAML)
11/07/2025, 11:00 PMhunterlige
11/24/2025, 5:16 PMaaronv (BAML)
11/24/2025, 8:12 PM