|
298 | 298 | regression in test_extractors.py or |
299 | 299 | test_instrumentation_phase41.py. Wire format is unchanged. |
300 | 300 |
|
| 301 | +Recommended upgrade path: 0.13.3 -> 0.13.4. No SDK_MIN_VERSION |
| 302 | +bump; backends on 1.0.0 keep working unchanged. |
| 303 | +
|
| 304 | +--- |
| 305 | +
|
| 306 | +v3.16 / 0.13.5 (2026-07-08) — perf release: cancel the Transport |
| 307 | +flush-thread sleep so ``runtime.shutdown()`` returns in ms, not |
| 308 | +seconds. Plus CI hygiene so the freed time actually surfaces as |
| 309 | +faster CI. |
| 310 | +
|
| 311 | + 1. ``Transport._flush_loop`` (transport.py:816) swapped its bare |
| 312 | + ``time.sleep(self.config.flush_interval)`` for |
| 313 | + ``self._stop_event.wait(timeout=...)``. The previous loop was |
| 314 | + uncancellable — any caller of ``runtime.shutdown()`` while the |
| 315 | + thread was mid-sleep blocked on ``thread.join()`` for the full |
| 316 | + default 5s ``flush_interval`` before teardown could proceed. |
| 317 | + With 1222 tests in the suite and many paths calling |
| 318 | + ``shutdown()`` (or its fixture teardowns), that multiplied into |
| 319 | + ~10-15 minutes of pure teardown wall-clock per Python in the |
| 320 | + matrix. New ``threading.Event`` is set by ``stop()`` before |
| 321 | + ``join()`` and cleared by ``start()`` so a restart-after-stop |
| 322 | + is clean. Pin contract: ``tests/test_transport.py:: |
| 323 | + test_stop_interrupts_flush_sleep`` uses a 30s ``flush_interval`` |
| 324 | + and asserts ``stop() < 5s``; pre-fix this took 30s, post-fix |
| 325 | + ~0.3s. |
| 326 | +
|
| 327 | + 2. CI workflow cleanup (.github/workflows/ci.yml + |
| 328 | + publish.yml + publish-test.yml): |
| 329 | +
|
| 330 | + * ``setup-python`` action now declares ``cache: pip`` with |
| 331 | + ``cache-dependency-path: pyproject.toml`` so warm caches |
| 332 | + skip the ~60-90s cold ``pip install -e .[dev]`` per matrix |
| 333 | + leg. |
| 334 | + * ``strategy.fail-fast: true`` on the test matrix so a red |
| 335 | + run doesn't burn the remaining Python legs once the first |
| 336 | + one fails. |
| 337 | + * ``pip install "pytest-xdist>=3.6"`` + ``pytest -n auto`` so |
| 338 | + the suite runs across all runner cores. ``xdist`` is also |
| 339 | + added to ``[project.optional-dependencies.dev]`` so local |
| 340 | + ``pip install -e .[dev]`` brings it in by default. |
| 341 | + * ``coverage`` job also gets ``-n auto`` (single Python leg, |
| 342 | + 3.12, is unchanged). |
| 343 | +
|
| 344 | + 3. ``pyproject.toml``: dropped the global ``-q`` from |
| 345 | + ``addopts`` so CI logs surface the full ``PASSED`` line per |
| 346 | + test. ``--tb=short`` keeps tracebacks compact. ``-n auto`` |
| 347 | + stays in the workflow (not in ``addopts``) so a developer |
| 348 | + running ``pytest tests/test_x.py`` locally still gets a single |
| 349 | + process — the worker pool is only worth it on the full |
| 350 | + suite. |
| 351 | +
|
| 352 | +No public API change. The default ``FlushConfig`` is unchanged |
| 353 | +(5s ``flush_interval``, 50 ``batch_size``); production flush cadence |
| 354 | +is identical. The fix only shortens the worst-case shutdown latency. |
| 355 | +No SDK_MIN_VERSION bump. Backends on 1.0.0 keep working unchanged. |
| 356 | +Recommended upgrade path: 0.13.4 -> 0.13.5. |
| 357 | +
|
| 358 | +--- |
| 359 | +
|
| 360 | +v3.16 / 0.13.4 (2026-07-08) -- bug-fix: complete the LangChain |
| 361 | +usage-extraction elif-chain. |
| 362 | +
|
| 363 | +Pre-fix extract_usage_from_response walked the 4 source branches |
| 364 | +if-hasattr-usage_metadata ... elif-hasattr-generations ... |
| 365 | +elif-hasattr-usage ... elif-hasattr-response_metadata. A LangChain |
| 366 | +AIMessage can carry token info on multiple attributes at once. |
| 367 | +When the first branch's hasattr returned True but the value was |
| 368 | +empty or 0/0/0 (streaming init state, some provider wrappers), |
| 369 | +every subsequent elif was skipped and the SDK shipped tokens=0 |
| 370 | +to the backend -- making the LLM call invisible on the dashboard. |
| 371 | +
|
| 372 | +Switched all 4 source branches to plain if so each one attempts |
| 373 | +its read; later branches naturally overwrite the zero default when |
| 374 | +the earlier branch value is empty. New regression test |
| 375 | +test_extract_usage_metadata_zero_response_metadata_real. |
| 376 | +
|
| 377 | +39 tests in test_langgraph_callback.py still pass; no |
| 378 | +regression in test_extractors.py or |
| 379 | +test_instrumentation_phase41.py. Wire format is unchanged. |
| 380 | +
|
301 | 381 | Recommended upgrade path: 0.13.3 -> 0.13.4. No SDK_MIN_VERSION |
302 | 382 | bump; backends on 1.0.0 keep working unchanged. |
303 | 383 | """ |
304 | 384 |
|
305 | | -__version__ = "0.13.4" |
| 385 | +__version__ = "0.13.5" |
306 | 386 | __platform_version__ = "1.0.0" |
0 commit comments