Skip to content

Sync/upstream main 2026 03 23#150

Merged
Sandeep-BA merged 52 commits intomainfrom
sync/upstream-main-2026-03-23
Mar 23, 2026
Merged

Sync/upstream main 2026 03 23#150
Sandeep-BA merged 52 commits intomainfrom
sync/upstream-main-2026-03-23

Conversation

@Sandeep-BA
Copy link
Collaborator

No description provided.

salmanmkc and others added 30 commits January 23, 2026 08:49
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
PiperOrigin-RevId: 884881559
This change ensures that the OpenTelemetry context is correctly propagated across asynchronous boundaries throughout the ADK, primarily within RxJava streams.

### Key Changes

*   **Context Propagation:** Replaces manual `Scope` management (which often fails in reactive code) with `.compose(Tracing.withContext(context))`. This ensures the OTel context is preserved when work moves between different threads or schedulers.
*   **`Runner` Refactoring:**
    *   Adds a top-level `"invocation"` span to `runAsync` and `runLive` calls.
    *   Captures the context at entry points and propagates it through the internal execution flow (`runAsyncImpl`, `runLiveImpl`, `runAgentWithFreshSession`).
*   **`BaseLlmFlow` & `Functions`:** Updates preprocessing, postprocessing, and tool execution logic to maintain context. This ensures that spans created within tools or processors are correctly parented.
*   **`PluginManager`:** Ensures that plugin callbacks (like `afterRunCallback` and `onEventCallback`) execute within the captured context.
*   **Testing:** Adds several unit tests across `BaseLlmFlowTest`, `FunctionsTest`, `PluginManagerTest`, and `RunnerTest` that specifically verify context propagation using `ContextKey` and `Schedulers.computation()`.

### Files Modified
*   **`BaseLlmFlow.java`**, **`Functions.java`**, **`PluginManager.java`**, **`Runner.java`**: Core logic updates for context propagation.
*   **`LlmAgentTest.java`**, **`BaseLlmFlowTest.java`**, **`FunctionsTest.java`**, **`PluginManagerTest.java`**, **`RunnerTest.java`**: New tests for OTel integration.
*   **`BUILD` files**: Updated dependencies for OpenTelemetry APIs and SDK testing.

PiperOrigin-RevId: 884998997
InMemorySessionService sets a Session's last modified time based on when
the last appended event's timestamp. The timestamp in an event is
recorded in millis while the Session's timestamp is an Instant. During
the transformation, Events perform this converstion using division.
Before this change, the timestamp was truncated to the second, yet the
code was trying to extract nanos which were always 0. This fixes that
bug with a simple type change. I've also added a test to prevent
regressions.
This change introduces a new plugin for the Agent Development Kit (ADK) that logs agent execution events to BigQuery. It includes:
-   `BigQueryAgentAnalyticsPlugin`: A plugin that captures various agent lifecycle events (user messages, tool calls, model invocations) and sends them to BigQuery.
-   `BigQueryLoggerConfig`: Configuration options for the plugin, including project/dataset/table IDs, batching, and retry settings.
-   `BigQuerySchema`: Defines the BigQuery and Arrow schemas used for the event table.
-   `BatchProcessor`: Handles batching of events and writing them to BigQuery using the Storage Write API with Arrow format.
-   `JsonFormatter`: Utility for safely formatting JSON content for BigQuery.

PiperOrigin-RevId: 885133967
…um type for the metadata keys

PiperOrigin-RevId: 885539894
PiperOrigin-RevId: 885777704
These changes are now in sync with Python ADK

PiperOrigin-RevId: 886040294
… copy and add null handling for `artifactDelta` in the Builder

PiperOrigin-RevId: 886130618
PiperOrigin-RevId: 886166671
Release-As: 1.0.0-rc.1
PiperOrigin-RevId: 886198912
copybara-github and others added 22 commits March 19, 2026 12:32
PiperOrigin-RevId: 886764077
Merge google#1067

🤖 I have created a release *beep* *boop*
---

### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

COPYBARA_INTEGRATE_REVIEW=google#1067 from google:release-please--branches--main 0b85f5b
PiperOrigin-RevId: 886764460
This CL enables the simultaneous use of `output_schema` (structured output) and `tools` for models that do not natively support both features at once (specifically Gemini 1.x and 2.x on Vertex AI).

### Core Logic
The CL implements a workaround for models with this limitation:
1.  **Synthetic Tooling**: Instead of passing the `output_schema` directly to the model's configuration, it introduces a synthetic tool called `set_model_response`.
2.  **Schema Injection**: The parameters of this tool are set to the requested `output_schema`.
3.  **Instruction Prompting**: System instructions are appended, directing the model to provide its final response using this specific tool in the required format.
4.  **Response Interception**: The `BaseLlmFlow` is updated to check if `set_model_response` was called. If so, it extracts the JSON arguments and converts them into a standard model response event.

### Key Changes
*   **`OutputSchema.java` (New)**: A new `RequestProcessor` that detects when the workaround is needed, adds the `SetModelResponseTool`, and provides utilities for extracting the structured response.
*   **`SetModelResponseTool.java` (New)**: A marker tool that simply returns its input arguments, used to "capture" the structured output from the model.
*   **`ModelNameUtils.java`**: Added logic to identify Gemini 1.x and 2.x models and determine if they can handle native `output_schema` alongside tools.
*   **`BaseLlmFlow.java`**: Updated the flow logic to detect the synthetic tool response and generate the final output event.
*   **`Basic.java`**: Updated to prevent native `outputSchema` configuration when the workaround is active.
*   **`SingleFlow.java`**: Registered the new `OutputSchema` processor.

PiperOrigin-RevId: 886769688
…, and use JSpecify Nullable

- Migrate LangChain4j to a builder pattern
- Enhance token usage handling with TokenCountEstimator (from PR google#623)
- Upgrade to latest version of LangChain4j
- Replace javax.annotation.Nullable with org.jspecify.annotations.Nullable
PiperOrigin-RevId: 886828787
Ensure sequential event processing and persistence in ADK Runner. This
ensures that events are appended in order and returned from runAsync in
order. This aligns better with the Python implementation.

PiperOrigin-RevId: 886961696
PiperOrigin-RevId: 887389399
…already implemented, but adding tests from PR google#603)
PiperOrigin-RevId: 888064419
The `slf4j-simple` dependency and the exclusion of `logback-classic` are removed, allowing the default logging implementation provided by `google-adk-dev` to be used.

PiperOrigin-RevId: 888114465
Resolve core/pom.xml: keep upstream BigQuery/Arrow deps and fork extras
(HikariCP, DB drivers, Redis/Kafka, testcontainers, etc.).

Made-with: Cursor
- BaseArtifactService.loadArtifact now uses @nullable Integer version
- EventActions.stateDelta() exposed as Map; fix PostgresSessionService
- PartConverter.toGenaiPart returns Part; update RequestConverter and tests
- A2AMetadataKey.TYPE replaces removed PartConverter constant
- Runner.runAsync(Session,...) removed; A2aService uses SessionKey
- MediaSupportTest and artifact IT/unit tests updated accordingly

Made-with: Cursor
@Sandeep-BA Sandeep-BA merged commit e9dd3cc into main Mar 23, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.