Group of 2 Under the hood
The turn-tracking and shutdown telemetry for SDK/print mode runs was rewritten, adding a tool-call breakdown and consolidating shutdown reporting
What
- Turn execution in SDK/non-interactive (print) mode now uses two new internal classes: one that tracks whether a turn is in flight and emits
tengu_sdk_result(ortengu_sdk_session_crash) on shutdown or crash, and another that runs each turn and emitstengu_sdk_resultwith a new breakdown of tool call counts into MCP tool calls, tool-search calls, and built-in tool calls. - A companion class manages adopting a model override at the end of a turn and logs
tengu_print_model_override_adoptedwith the previous and new model. - The telemetry sent when a run is shut down mid-way (status
terminated) now goes through one shared method (reportTerminatedOnShutdown) instead of being built inline, soaborted/runPhase/exitCodereporting is consistent.
Why This gives clearer visibility into how SDK-driven and print-mode sessions end and what kinds of tool calls they made, and makes the shutdown telemetry more consistent and easier to maintain.