Skip to content

Merge pr 177 - #180

Merged
Sandeep-BA merged 81 commits into
mainfrom
merge-pr-177
Jul 16, 2026
Merged

Merge pr 177#180
Sandeep-BA merged 81 commits into
mainfrom
merge-pr-177

Conversation

@Sandeep-BA

Copy link
Copy Markdown
Collaborator

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

  • Closes: #issue_number
  • Related: #issue_number

2. Or, if no issue exists, describe the change:

If applicable, please follow the issue templates to provide as much detail as
possible.

Problem:
A clear and concise description of what the problem is.

Solution:
A clear and concise description of what you want to happen and why you choose
this solution.

Testing Plan

Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Please include a summary of passed java test results.

Manual End-to-End (E2E) Tests:

Please provide instructions on how to manually test your changes, including any
necessary setup or configuration. Please provide logs or screenshots to help
reviewers better understand the fix.

Checklist

  • I have read the CONTRIBUTING.md document.
  • My pull request contains a single commit.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

Add any other context or screenshots about the feature request here.

g0w6y and others added 30 commits May 26, 2026 11:37
… to localhost

The dev server defaulted to a wildcard CORS policy (Access-Control-Allow-Origin: *)
and registered the /run_live WebSocket endpoint with setAllowedOrigins("*"). Any page
loaded from an arbitrary origin could therefore read HTTP responses and complete a
cross-origin WebSocket handshake against a locally running dev server, giving a remote
site read and drive access to the agent.

- AdkWebCorsProperties: change the default allowed-origins fallback from ["*"] to
  ["http://localhost:8080", "http://127.0.0.1:8080"] so the dev UI keeps working out
  of the box while all other origins are rejected by the browser.
- WebSocketConfig: inject AdkWebCorsProperties and derive the WebSocket allowed-origins
  list from the same property, eliminating the separate hardcoded wildcard and keeping
  both policies in sync. Users who need a broader allowlist can set
  adk.web.cors.origins explicitly.
Adds end-to-end routing for apigee/openai/* models through an OpenAI-compatible
chat-completions backend:

  - ChatCompletionsClient interface + ChatCompletionsHttpClient (OkHttp) impl.
  - ApigeeLlm.ApiType (CHAT_COMPLETIONS / GENAI), auto-detected from the model
    prefix or set explicitly via Builder.apiType.
  - Streaming and non-streaming response paths (see screenshots).

PiperOrigin-RevId: 936778429
Build and test ADK Java against Java 25 (latest LTS) in addition to
Java 17 and 21.

PiperOrigin-RevId: 937330245
Replace the build-helper source-root hack (which forced each sample to re-exclude
every sibling in the compiler, source, and javadoc plugins) with a
google-adk-sample-github-tools module that samples depend on under the standard
src/main/java layout.

PiperOrigin-RevId: 937894603
… when resumability is enabled

Gated behind App.resumabilityConfig (opt-in, off by default), mirroring Python
ADK v1's ResumabilityConfig.is_resumable. When enabled, a resumed function
response re-enters its call's top-most SequentialAgent ancestor and fast-forwards
to the paused sub-agent, so the sequence continues to later sub-agents (e.g. run
C after B's HITL tool) and pauses on a pending long-running call. When disabled,
behavior matches Python ADK v1 with resumability off.

The LLM flow and LoopAgent also pause on a pending long-running call when
resumable, mirroring Python ADK v1, so a resumed agent does not keep re-calling
the model (a runaway loop that burns tokens). ParallelAgent needs no change: each
branch pauses via the flow.

PiperOrigin-RevId: 938479982
….0) build

Replace the dev server's bundled adk-web assets with the build shipped in ADK
Python v1 (google-adk 1.34.0; bundle main-TCIQIOZ3.js). This newer build
correctly handles streaming partial events (skips partial function-call events
and merges streaming text), fixing duplicated text and duplicated function-call
cards shown in the dev UI during token streaming. The v1 build is used rather
than the v2 build to stay compatible with the 1.x Java backend.

PiperOrigin-RevId: 938552583
- Drop the special-case buffering of function responses for "gemini-3" models;
  responses are merged regardless of model name.
- Emit each streaming function-call chunk as a partial and bundle the accumulated
  calls into a final aggregated response.
- Merge function-call arguments streamed across chunks (partialArgs/willContinue)
  into a single complete call, accumulating string chunks by JSONPath.
- Assign one client-side function-call ID per call and reuse it across the partial
  and final events so consumers can correlate them.
- Emit the final aggregated response even when the stream ends without a finish
  reason, surfacing a non-STOP finish (e.g. MAX_TOKENS) as an error code.
- Stop persisting partial events in the Runner so managed session services (e.g.
  VertexAiSessionService) no longer store duplicate function-call events.

PiperOrigin-RevId: 938566833
Introduces ClassPathSkillSource to the ADK core library to support loading skills directly from the Java classpath. This enables unified and incremental loading of skills, avoiding duplicate logic in downstream clients.

PiperOrigin-RevId: 938697445
PiperOrigin-RevId: 939766557
find_doc_issues filters open docs issues by code repository, and the agent only
documents Java, so the analyzer no longer mixes languages.

PiperOrigin-RevId: 939780483
…, and issue triage workflows

PiperOrigin-RevId: 939834590
damianmomotgoogle and others added 29 commits July 7, 2026 01:39
gemini-2.0-flash has been retired and returns HTTP 404, so the live Gemini
API integration test always failed. Use the gemini-flash-latest alias
instead.

PiperOrigin-RevId: 943746233
Merge google#1292

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

## [1.6.0](google/adk-java@v1.5.0...v1.6.0) (2026-07-06)

### Features

* Add ADK Issue Monitoring (Spam Detection) Agent sample for Java ([fd45dda](google@fd45dda))
* Add ADK Java Issue Triaging Agent sample ([fa94438](google@fa94438))
* Add ADK PR Triaging Agent for google/adk-java ([f14f644](google@f14f644))
* Add chat-completions API support to ApigeeLlm ([df73784](google@df73784))
* Add ClassPathSkillSource to load skills from the Java classpath ([587073a](google@587073a))
* Adds the ADK Stale Issue Auditor sample ([b6bd2dd](google@b6bd2dd))
* advance SequentialAgent to later sub-agents after a HITL resume when resumability is enabled ([407478b](google@407478b))
* **flows:** add RunConfig.groupFunctionResponsesInHistory to group function calls before responses ([1b9b395](google@1b9b395))
* Updated Spring AI to 2.0.0, ECJ, build works with Java 25 ([3f6665b](google@3f6665b))

### Bug Fixes

* **core:** allow Long values to match INTEGER schema type ([a6d41cf](google@a6d41cf))
* **dev:** keep '*' CORS default, drive WebSocket origins from config, warn on '*' ([5029081](google@5029081))
* **dev:** use localhost port wildcard for default CORS/WebSocket origins ([cb73317](google@cb73317))
* **flows:** end invocation on a deferred long-running tool call ([6dd4594](google@6dd4594))
* **gemini:** align streaming function-call handling with ADK Python ([37bb5e6](google@37bb5e6))
* ignore usage-only responses outside bidi ([a6cb87a](google@a6cb87a))
* Make dry_run configurable for ADK Java PR triage, spam detection, and issue triage workflows ([4225b07](google@4225b07))
* Make stale issue workflow configurable for dry runs ([d0edd41](google@d0edd41))
* map ChatResponse usage metadata to LlmResponse ([71f6929](google@71f6929))
* map token usage metadata for Anthropic Claude model ([f76c5f9](google@f76c5f9))
* Move @JsonCreator inside LiveRequest Builder ([d667db8](google@d667db8))
* preserve non-text output in streaming responses ([b8be90d](google@b8be90d))
* prevent cross-user session data disclosure in VertexAiSessionService ([d1b1d92](google@d1b1d92))
* Resolve NPE when McpTool description is null ([8ed64ea](google@8ed64ea))
* Safely handle empty model in GoogleSearchTool request processor ([e255192](google@e255192))
* scope ADK Java docs release analyzer to a single language ([07a2ec9](google@07a2ec9))
* **skills:** prevent path traversal in LocalSkillSource ([55392f6](google@55392f6))
* use daemon threads in OkHttp dispatchers to allow graceful JVM shutdown ([9b046b6](google@9b046b6))
* Use existing secrets and built-in token in ADK docs release analyzer workflow ([456234f](google@456234f))
* widen Integer to Long in castValue() for boxed Long parameter ([bc32948](google@bc32948))

---
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#1292 from google:release-please--branches--main 9eb8724
PiperOrigin-RevId: 943753451
…tory

Preserve the existing behavior of resolving absolute and relative (including
`..`) AgentTool config_path values, but log a deprecation warning when the
resolved path escapes the agent's base directory. This keeps backward
compatibility for tools that rely on absolute or parent-relative paths while
surfacing the risky access pattern ahead of disallowing it in a future release.
Spring AI OpenAI 2.0.0 casts `Prompt.getOptions()` directly to `OpenAiChatOptions` in `createRequest()` and only substitutes the model's own options when the prompt options are null. ADK built a provider-neutral `DefaultToolCallingChatOptions` whenever tools or generation config were present, so tool-enabled (and config-carrying) requests failed at runtime with:
  `java.lang.ClassCastException: DefaultToolCallingChatOptions cannot be cast to OpenAiChatOptions`.

Build the prompt options on top of the model's own default options
(`ChatModel.getOptions()`) via `mutate()`, overlaying the ADK tools and generation config. This keeps the concrete provider type the model expects and preserves provider settings such as API key, base URL, and model name. Falls back to the previous provider-neutral behavior when the model's options are unavailable or not tool-calling capable.

PiperOrigin-RevId: 945007278
`adkToMcpToolType` called `Optional.get()` on `parameters()` unguarded, so a
present declaration with no parameters (a valid no-argument tool) threw
`NoSuchElementException`. Build the MCP tool without an input schema when
parameters are absent.

Also make the method static so the utility class (`final`, `private`
constructor) is actually callable, and add `ConversionUtilsTest`.

PiperOrigin-RevId: 945099824
…drop stats)

Port of google#1318. Addresses preview-readiness gaps in the Java
BigQuery Agent Analytics (BQAA) plugin (google#1316), bringing it
closer to parity with the Python plugin and hardening the write path.

P1 — preview blockers:
- Secret redaction in `JsonFormatter`: sensitive keys (`client_secret`,
  `access_token`, `refresh_token`, `id_token`, `api_key`, `password`, and any
  `temp:*` key) are redacted to `[REDACTED]` during truncation, matching the
  Python plugin. Case-insensitive; redaction does not set `is_truncated`.
- Empty `STATE_DELTA` guard: a `STATE_DELTA` row is only emitted when the
  event's state delta is non-empty (parity with Python).
- Table bootstrap made production-safe (`ensureTableExists`): new tables get
  DAY time-partitioning on `timestamp`; `tableEnsured` is set only after a
  successful setup so a transient first-run failure is retried; concurrent
  `already exists` is treated as success.
- `root_agent_name` is populated from the invocation context instead of the
  sentinel default (null-safe).
- No-current-agent guard: the `agent` column falls back to the event author
  and then `"unknown"` instead of NPE-dropping the row.

P2 — reliability hardening:
- Drop accounting via `plugin.getDropStats()` (`queue_full` / `append_error` /
  `serialization_error`), folded into plugin-level totals at close.
- Storage Write regional routing: `StreamWriter` is built with
  `.setLocation(config.location())`.
- JVM shutdown hook drains queued rows if `close()` is never called.
- Schema auto-upgrade always diffs the actual schema (drops the version-label
  early return) and logs incompatible type/mode drift.
- span_id / parent_span_id always come from the BQAA internal execution tree
  rather than ambient OpenTelemetry, so parent_span_id references a logged row.

P3 — operational polish:
- Config validation of `batchSize` / `queueMaxSize` / `maxContentLength`.
- View DDL identifier validation in `createAnalyticsViews`.
- Recursion depth guard in `recursiveSmartTruncate`.
- Hot-path INFO logs lowered to FINE; `EventData` license header + Javadoc fix.

Unit tests added for redaction, empty-state-delta skip, config validation,
schema mode-drift warning, and root-agent-name initialization.

PiperOrigin-RevId: 945214206
It's not needed for core ADK Gemini any more (streaming aggregator maintains correct order) but was found to be still needed by other Gemini based integrations. Adding it for backward and forward compatibility

PiperOrigin-RevId: 945598657
…JsonSchema`

`Claude.functionDeclarationToAnthropicTool()` only read
`FunctionDeclaration.parameters()` and ignored `parametersJsonSchema()`. MCP
tools populate `parametersJsonSchema` instead of `parameters`, so their input
schema was converted into an empty `properties` map and Claude received tools
with no arguments, making them impossible to invoke.

When `parametersJsonSchema` is present, pass the whole JSON Schema through so
keys such as `$ref`/`$defs` are preserved, and recursively lowercase `type`
keywords for Anthropic. `updateTypeString` now also handles union `type` arrays
instead of failing on the `String` cast. This mirrors the Python
`anthropic_llm.py` implementation.

PiperOrigin-RevId: 945624831
…utor`

During A2A communication, `AgentExecutor` invoked the 4-argument
`Runner.runAsync`, which hardcodes `stateDelta = null` and silently dropped the
caller's incoming request metadata.

Route the incoming request metadata (`RequestContext.getParams().metadata()`)
into `RunConfig.customMetadata` under the `a2a_metadata` key, so downstream
processing can read it. This mirrors ADK Python and Go, which pass A2A request
metadata through the run config and leave the session state delta null, rather
than writing framework IDs into session state. Add tests for the metadata and
no-metadata cases.

PiperOrigin-RevId: 946936540
…streaming

Gemini can keep willContinue=true on the last partialArgs chunk and end a
function call with a separate empty part. Flush the buffered call on that end
marker so streamed calls are not dropped or merged.

PiperOrigin-RevId: 947029146
…rge steps

awaitPersisted folded a step's per-event barriers into a left-nested
Completable.andThen(...) chain. A single step can carry many events (an agent
transfer folds the sub-agent's events into the parent step), and the nested
chain recurses once per element on both subscription and completion, throwing
StackOverflowError for long sessions.

Await the barriers with Completable.concat instead, which drains its sources
iteratively and stays stack-safe while preserving the same await semantics
(order is irrelevant, as each subject retains its terminal state).

Adds a regression test that awaits 50k events in a single step.
…ss the ADK

Building a separate `OkHttpClient` per model or session leaks connection pools and
threads. This routes `Gemini`, `ChatCompletionsHttpClient`, and the sessions
`ApiClient` through `HttpClientFactory`, which caches one shared client per name so
the dispatcher and connection pool are reused.

Threading is injectable at construction rather than hard-coded:

- `getOrCreateSharedHttpClient(name)`: the shared client, OkHttp's default
  threading.
- `createHttpClient(executor)`: a new client whose dispatcher runs on the given
  executor; not cached, so the caller owns the executor and the returned client.
- `daemonExecutor(name)`: an unbounded daemon-thread pool so a standalone or CLI
  JVM can exit once work is done.
- `Gemini.builder().httpExecutorService(...)` and a new
  `ChatCompletionsHttpClient(HttpOptions, ExecutorService)` constructor accept the
  executor at construction. The sessions client issues synchronous requests, which
  do not use the dispatcher executor, so it shares the pool only.

`Gemini` forks the shared client with zeroed connect/read/write timeouts to keep
the prior infinite-timeout behavior.

Adds `HttpClientFactoryTest` covering caching by name, executor injection, and
daemon threads.

PiperOrigin-RevId: 947525602
Fix unconditional function call ID stripping in GeminiUtil. Previously, the Java ADK cleared both model-generated IDs (like call_123) and client-generated IDs, which broke compatibility with Gemini 3.5 Flash's Strict Response Matching convention.

PiperOrigin-RevId: 947550561
Add `com.google.adk.FunctionCallIds` as the single home for the "adk-" prefix and
its helpers (`generateClientFunctionCallId`, `isClientGeneratedFunctionCallId`),
replacing the copies.

PiperOrigin-RevId: 947573920
…-stackoverflow

PiperOrigin-RevId: 947631274
…a-dropping-issue-fix

PiperOrigin-RevId: 947644232
@Sandeep-BA
Sandeep-BA merged commit 47f79af into main Jul 16, 2026
0 of 5 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.