Commit a9f1d88
fix: Remove OpenAI-specific message coalescing and consolidate token extraction
_coalesce_tool_messages_for_openai was a workaround for the parallel fan-out
problem that no longer exists with Command-based handoff routing. With
add_messages reducer and parallel_tool_calls=False, message state is always
well-ordered, so remove it along with its helper functions.
Consolidate token extraction in LDMetricsCallbackHandler to use
get_ai_usage_from_response from langchain_helper, reading from the
generation's AIMessage (usage_metadata / response_metadata) rather than
LLMResult.llm_output — the LangChain 1.x standard across all providers.
Fix TestBuildTools tests that were importing a nonexistent build_tools symbol;
update to build_structured_tools, covering both sync and async callables.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ce0c1e4 commit a9f1d88
1 file changed
Lines changed: 20 additions & 8 deletions
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
389 | 392 | | |
390 | 393 | | |
391 | 394 | | |
392 | | - | |
393 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
394 | 400 | | |
395 | 401 | | |
396 | 402 | | |
| |||
459 | 465 | | |
460 | 466 | | |
461 | 467 | | |
462 | | - | |
463 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
467 | 476 | | |
468 | 477 | | |
469 | 478 | | |
470 | | - | |
471 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
472 | 484 | | |
473 | 485 | | |
474 | 486 | | |
| |||
0 commit comments