Improvements
- Langfuse v4 compatibility:
addLangfuseExporternow sends thex-langfuse-ingestion-version: 4header, so traces use the Langfuse v4 observations-first data model instead of the delayed legacy path. It also copies the run input and output onto the rootcreate_agentobservation, setsgen_ai.conversation.idoncreate_agentandexecute_toolspans so they can be filtered by session, and mapskoog.node.input/koog.node.outputtolangfuse.observation.input/langfuse.observation.outputon node spans (#2227, #2340) - Gemini cached and thinking tokens in Langfuse: The Google client now also puts
thoughtsTokenCountintoResponseMetaInfo.metadata, in both the streaming and non-streaming paths.LangfuseSpanAdapterturns the cached and thinking token counts intolangfuse.observation.usage_details, so Langfuse prices Gemini calls correctly. Spans from other providers do not change (#2303)
Bug Fixes
- Every message part in Langfuse spans:
LangfuseSpanAdapternow writes the whole input history and the response as singlegen_ai.prompt/gen_ai.completionJSON arrays in the OpenAI message shape. Answer text, readable reasoning, all tool calls and all tool results are now visible. Previously, Claude 5 signature-only thinking blocks produced empty outputs, text next to reasoning or tool calls was lost, and only the first of several parallel tool results was kept. Writing one attribute per message list also keeps long runs under the OTel SDK's 128-attributes-per-span limit (#2298) - OpenTelemetry
invoke_agentspan and shutdown flush: Theinvoke_agentspan now reports the live conversation's assistant responses and real token usage, instead of echoing the configured prompt with zero usage. WithsetShutdownOnAgentClose(true),closeSdks()now flushes the batch processor before shutdown, so the final spans (includingcreate_agentandinvoke_agent) are no longer dropped (#2340) - Tool results order with missing tools:
MissingToolsConversionStrategy.Missingnow keeps the remaining tool results ahead of the text parts converted from missing tools. Before, a parallel call to an unregistered tool made Anthropic models (direct or via Bedrock Converse) reject the whole request instead of receiving a recoverable error (#2318) - Bedrock Converse fixes: String tool arguments such as
"1917"stay strings when history is replayed, and"Infinity"/"NaN"no longer fail the request.BedrockConverseParams.requestMetadatanow reachesConverseRequest/ConverseStreamRequest. Nested object parameters keep theirrequiredandadditionalPropertiesconstraints in the tool schema (#2316) - Multi-line SSE chunks in Ktor:
respondTextStreamandrespondInvocationText(withAccept: text/event-stream) now write each line of a chunk as its owndata:field, so spec-compliant clients no longer drop text after an embedded newline (#2289, #2292)
Build & CI
- Sharded Dokka and tuned CI memory: Split Dokka generation into four shards that are aggregated in a separate job, lowered the default Gradle heap and capped worker and Kotlin daemon memory, and bumped GitHub Actions versions (#2333)