Skip to content

feat(otel): use synchronous span and log processors for debug endpoints#661

Merged
dpasiukevich merged 1 commit into
google:mainfrom
pawel-maciejczek:feature/telemetry-span-processors
Mar 18, 2026
Merged

feat(otel): use synchronous span and log processors for debug endpoints#661
dpasiukevich merged 1 commit into
google:mainfrom
pawel-maciejczek:feature/telemetry-span-processors

Conversation

@pawel-maciejczek
Copy link
Copy Markdown
Contributor

Batch processors were causing a delay between ending a span and that span being available in debug endpoints.
It was causing race conditions in adk-web - in most cases, the Trace tab didn't show the latest conversation turn.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a latency issue in debug telemetry endpoints by transitioning from asynchronous batch processors to synchronous simple processors for OpenTelemetry spans and logs. This change ensures that telemetry data is immediately available after generation, eliminating race conditions that previously caused delays and incomplete data display in the adk-web Trace tab, thereby improving the accuracy and responsiveness of debugging tools.

Highlights

  • OpenTelemetry Span Processor: Replaced the BatchSpanProcessor with SimpleSpanProcessor for OpenTelemetry spans within the debug telemetry service to ensure immediate processing.
  • OpenTelemetry Log Processor: Switched from BatchProcessor to SimpleProcessor for OpenTelemetry logs in the debug telemetry service, enabling synchronous log processing.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a race condition in debug endpoints by switching from asynchronous batch processors to synchronous simple processors for OpenTelemetry spans and logs. The change from NewBatchSpanProcessor to NewSimpleSpanProcessor and NewBatchProcessor to NewSimpleProcessor ensures that telemetry data is immediately available in the in-memory store, resolving the delay that caused issues in the adk-web UI. The changes are confined to debugtelemetry.go and are appropriate for their intended debugging context. The code is clear and includes comments explaining the rationale for using synchronous processors.

@dpasiukevich dpasiukevich merged commit cadba57 into google:main Mar 18, 2026
4 checks passed
japerry911 added a commit to japerry911/adk-go that referenced this pull request Apr 1, 2026
* fix: enable llm variant for gemini 2.5 and below (google#562)

* fix: enable llm variant for gemini 2.5 and below

* chore: remove internal mutable session struct (google#572)

It does nothing, leftover from the refactoring.

* feat: Introduce Retry and Reflect plugin (google#564)

* Introduce Retry and Reflect pluging

* Address gemini-bot review comments

* Add some unit tests

* Run gofumpt -l -w .

* Improve the explanation of WithErrorIfRetryExceeded

* move guidances to templates

* feat: add MustNew func

---------

Co-authored-by: dpasiukevich <[email protected]>

* fix: format go.mod by direct and indirect dependencies (google#580)

Signed-off-by: Koichi Shiraishi <[email protected]>

* feat: implement v2 trace debug endpoints based on semconv spans and logs (google#570)

* feat(telemetry): add logging setup options

* feat: Implement new debug endpoints

* Apply suggestions from code review

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* resolve review comments

* go mod tidy

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* feat: improve telemetry GCP quota and resource projects validation to (google#584)

fail on whitespace

* feat: add otel structured logging (google#552)

* feat: Add OpenTelemetry structured logging for GenAI requests and responses.

* refactor: Align OpenTelemetry gen_ai event logging with ADK Python and clarify deviations from semconv.

* refactor: move logging to generateContent function

* refactor: rename logger to otelLogger

* feature: add genAICaptureMessageContent to telemetry.config and options

* refactor: update the logic behind guessAISystem

* add tests for log span propagation

* add logging tests to base_flow tests

* feat: Add genAICaptureMessageContent to the telemetry Providers struct initialization.

* feat(telemetry): add OTel logger initialization (google#573)

* feat(telemetry): add logging setup options

* fix flaky tests

* feat: add script for updating embedded adk-web (google#594)

* fix: runssehandler-causes-superfluous-responsewriteheader-on-errors (google#531)

* chore: Add a pull request template

* doc:pull_request_template

* refactor(doc):typo correction

* refactor(doc):apply suggestions

* refactor(doc):implement suggestions

* refactor(doc):add extra line

* feat: adka2a mode with artifact per non-partial event (google#599)

* implement alternative artifact production mode

* update artifact aggregation logic on remote agent

append=false, lastChunk=false: emit as partial, restart aggregation
append=false, lastChunk=true: emit as non partial, drop aggregation
append=true, lastChunk=false: emit as partial, update aggregation
append=true, lastChunk=true: emit as partial, update aggregation, emit aggregation as non partial, drop aggregation

* agent run processor tests

* mixed mode tests

* executor outputs test

* update explanation

* fix lint

* remove duplicate test

* feat: integrate debug endpoints with adk-web (google#597)

* feat: integrate debug endpoints with adk-web

The previous version was based on proposed V2 debug endpoints, which got abandoned
Adk web will support v1 endpoints and semconv spans.

* feat: Add unique event IDs to LLM responses for telemetry tracking and update API CORS to allow all origins.

* fix: deterministic remoteagent aggregate event emit order (google#603)

* deterministic update emit order

* remove duplication

* use func

* feat: refactor debugtelemetry - optimize trace access (google#593)

* refactor: improve traces lookup in DebugTelemetry and remove otel test dependency

* Introduce tool.WithConfirmation  (google#579)

Introduce *experimental* tool.WithConfirmation. 
It wraps a toolset to inject confirmation logic in each tool after they created.

* fix: race conditions in parallel agents (google#530)

* fix: race conditions in parallel agents

* fix

* file name

* refactor: centralize session concurrency management by removing mutexes from `MutableSession` and adding them to `InMemorySession`'s event and state updates, along with a new deadlock test.

* fix yield errgroup.Wait() err

* lint fix

* Add clone to state All and store a copy of the event to stored_session

* fix temp event state delta clear

* Add TestParallelAgent_StateSync

* lint fix

---------

Co-authored-by: jaxxjj <[email protected]>

* chore(deps): bump github.com/modelcontextprotocol/go-sdk (google#604)

Bumps the go_modules group with 1 update in the / directory: [github.com/modelcontextprotocol/go-sdk](https://github.com/modelcontextprotocol/go-sdk).


Updates `github.com/modelcontextprotocol/go-sdk` from 0.7.0 to 1.3.1
- [Release notes](https://github.com/modelcontextprotocol/go-sdk/releases)
- [Commits](modelcontextprotocol/go-sdk@v0.7.0...v1.3.1)

---
updated-dependencies:
- dependency-name: github.com/modelcontextprotocol/go-sdk
  dependency-version: 1.3.1
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: implements identityRequestProcessor to internal/llminternal (google#585)

* feat: implements identityRequestProcessor

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: quote agent name and description in identity processor to match adk-python

The Python reference wraps name/description in double quotes as delimiters.
Also removes variable shadowing of the agent import and cleans up string
building.

Signed-off-by: Koichi Shiraishi <[email protected]>

* chore: extract mockLLMAgent to helpers_test.go

Move the shared test mock from outputschema_processor_test.go to a
dedicated helpers_test.go to prevent fragile cross-file test coupling.

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: support testcase to identity request processors injects

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: update model to gemini-2.5-flash in test case

Since gemini-2.0-flash is deprecated, `go generate` can no longer generate testdata using httprr.

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: regenerate httprr testdata and fix test case

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: use `strings.Join` to make system promppt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Signed-off-by: Koichi Shiraishi <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: remove loopagent dependency from sequential agent (google#611)

* Remove loopagent dependency from sequential agent

* lint fix

* test: regenerate parallel agent test (google#614)

Include the recent changes where identityProcessor is added.

* fix: use LLMRequest.Model in Gemini GenerateContent calls (google#620)

* fix: use LLMRequest.Model in Gemini GenerateContent calls

The Gemini model implementation was hardcoding m.name when calling the
GenAI API, ignoring the LLMRequest.Model field. This field is set by
base_flow.go and can be modified by BeforeModelCallback, but the value
was never read. This made runtime model switching via callbacks silently
ineffective.

Add a modelName() helper that prefers req.Model when set, falling back
to the construction-time name. This preserves existing behavior (since
req.Model defaults to m.name via base_flow) while enabling callback-
driven model overrides.

* Update model/gemini/gemini_test.go

Co-authored-by: Dmitry Pasiukevich <[email protected]>

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: `generateRequestConfirmationEvent` creates events with empty ID (google#588)

* Update functions.go

* Update functions_test.go

* Add missing fields to adkrest data model and event's ModelVersion field (google#609)

* Add missing fields to adkrest data model and event's ModelVersion field

* lint fix

* test fix

* test: fixed expected model name (google#621)

* fix: output not rendering in non-TTY environments (google#536) (google#568)

* fix output not rendering in non-TTY environments (google#536)

* fix output not rendering in non-TTY environments (google#536)

* replace x/term with stdlib TTY detection

* move streamingMode resolution outside user loop

* chore: fix go sum

* chore: fix go sum

---------

Co-authored-by: dpasiukevich <[email protected]>

* Add http.RoundTripper to merge request's header values. (google#607)

* Add http.RoundTripper to merge request's header values.

* Modify gemini new to copy the config to avoid mutating the httpclient

* fix: switch to the new mcp.ErrSessionMissing (google#625)

* feat: add adk configurable and cli initializer (google#617)

* Add adk configurable and cli initializer

* lint fixes

* lint fix

* Add conversion checks

* lint fix

* Move configurable and cli to internal packages

* Move conformance loader to internal

* fix nit

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* chore: update internal version (google#628)

* Add replay plugin (google#618)

* Add replay plugin

* lint fixes

* lint fix

* Add allowedBaseDir to replay_plugin

* lint fix

* Move replay plugin to internal/configurable/comformance

* Add Python-isms to JSON-isms normalizer to replay plugin

* Simplify records unmarshaling

* Add example tool that adds examples to llm request (google#612)

* Add example tool that adds examples to llm request

* Add missing copyright header

* Add sanitization for example tool "End few-shot"

* lint fix

* all: run go fix ./... (google#634)

* Initialize EventActions' ArtifactDelta to empty map (google#610)

* Initialize artifact_delta to empty map

* lint fix

* Modify tests to check ArtifactDeltas

* lint fix

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* Change content "For context" formatting (google#613)

* Changes content "For context" to formatting

* Removed stringify pythonism from contents_processor

* Add custom description to gemini tool

* lint fix

* test fix

* merge fix RegisterToolFactory using geminitool

* Add runner options, WithStateDelta (google#615)

* Add pathPrefix config to api launcher (google#616)

* Add pathPrefix config to api launcher

* Add handle trailing and leading slashs

* feat: extension points for remoteagent part conversions (google#627)

extension points for part conversions

* feat: add apigee model (google#639)

* chore: sync codebase

* Modify append instructions to modify existig part. Add ExampleTool factory to configurable. (google#640)

* Modify append instructions to modify existig part. Add ExampleTool factory.

* lint fix

* Keep transfer_to_agent declaration and rewrite expected in replay plugin

* Remove callback print

* chore: upgrade GitHub Actions to latest versions (google#643)

Signed-off-by: Salman Muin Kayser Chishti <[email protected]>

* chore: upgrade GitHub Actions for Node 24 compatibility (google#642)

Signed-off-by: Salman Muin Kayser Chishti <[email protected]>
Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: do not retry confirmation requests as they are not really errors. (google#641)

* Do not retry confirmation requests as they are not really errors.

* Also exclude rejections from being retried same way

* Fix the typo in the name

* Address gemini-code-assist comment about scopedFailureCounters

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: skip vendor in copyright header test (google#636)

The copyright header walk should not descend into vendored sources.

Add vendor to the ignore list used by TestCopyrightHeader so the test only checks repository-owned Go files.

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* refactor: remove duplicated ConfirmationProvider (google#649)

* refactor: remove duplicated ConfirmationProvider

BREAKING CHANGE: there's already such entity in the tool package.

* refactor: rename tool.StringPredicate

* refactor: consistent memory service naming (google#650)

* refactor: consistent memory service naming

BREAKING CHANGE: updating the memory service naming to be consistent
with other ADKs prior releasing v1.0

* feat: remoteagent and executor subtask cleanup (google#645)

* If remoteagent run completes with an error or early break (yield returns false) - cancel rpc task will be sent to the remote server
* Added `A2ARemoteTaskCleanupCallback` callback option to `remoteagent.NewA2A`, it can be used to override the remote task cancellation behavior
* Extracted agent card resolution to `internal/agent/remoteagent` so that it can be reused in `adka2a` package
* Added internal remoteagent state which hold a spec for connecting to the remote server: agent card, resolver options, client factory, etc.
* Added the logic for cancelling subagent tasks in input-required when root agent task is cancelled. Cancellation is best-effort.
* Added `A2AExecutionCleanupCallback` to `adka2a.Executor` which gets invoked after execution or cancellation completes with either result or an error. The default behavior is to log an error.
* Fixed `A2AEventConverter` taking `ReadonlyContext` making it not possible to invoke the default adka2a.ToSessionEvent which requires an `InvocationContext`
* Fixed `adka2a.A2APartConverter` not used in remoteagent
* Fixed `updateAggregation` failing for nil-content events
* Updated a2a-go to `0.3.9`

* feat: add progressive SSE to streaming aggregator and parallel function call execution (google#654)

* Modify streaming aggregator to support progressive sse

* Add parallel execution, add replay test

* Remove previous TestStreamAggregator

* Remove unused httpr

* lint fixes

* Add check thoughtSignature to TestParallelFunctionCalls

* Change aggregator close to use response error code and message

* fix interleaved thought&text aggregation (google#655)

* fix: part converter not used in input required processor (google#657)

The main event processing pipeline checks for a part converter in
processor.go just after handling the inputRequiredProcessor.  If any
parts are found to be "input required" parts they are sliced off of the
content and put onto a new A2A message that is returned after the main
A2A message. Unfortunately that means that if there are any special
converters that would affect those parts they do not get the chance to
be invoked.

This change just plumbs through the existing converter and makes sure it
gets a chance to run.

* refactor: remove launcher dependency from adkrest (google#660)

* refactor: remove launcher dependency from adkrest

Launcher package may be revised in future (for example in favor of ADK
App).
Right now we need to make sure that we don't import the launcher as a
config type in critical packages, e.g. `server` packages.

BREAKING CHANGE: updated adkrest package, replaced NewHandler with
NewServer constructor.

* upd

* upd

* feat(otel): replace batch span and log processors with synchronous implementations (google#661)

* feature: update adk-web to the latest version (google#653)

`$ ./scripts/adk-web/update-adk-web.sh`

* chore(deps): bump google.golang.org/grpc (google#663)

Bumps the go_modules group with 1 update in the / directory: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.78.0 to 1.79.3
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.78.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update a2a-go and fix test race (google#664)

* update a2a-go and fix test race

* tidy

* Update to the latest version (google#666)

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* chore(deps): bump github.com/modelcontextprotocol/go-sdk (google#667)

Bumps the go_modules group with 1 update in the / directory: [github.com/modelcontextprotocol/go-sdk](https://github.com/modelcontextprotocol/go-sdk).


Updates `github.com/modelcontextprotocol/go-sdk` from 1.4.0 to 1.4.1
- [Release notes](https://github.com/modelcontextprotocol/go-sdk/releases)
- [Commits](modelcontextprotocol/go-sdk@v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: github.com/modelcontextprotocol/go-sdk
  dependency-version: 1.4.1
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Pasiukevich <[email protected]>

* feat: allow the runner to automatically create a session if AutoCreateSession is enabled. (google#622)

* feat: allow the runner to automatically create a session if `AutoCreateSession` is enabled.

* Update runner/runner.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* refactor: update memory req/resp names (google#671)

BREAKING CHANGE

---------

Signed-off-by: Koichi Shiraishi <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Salman Muin Kayser Chishti <[email protected]>
Co-authored-by: Dmitry Pasiukevich <[email protected]>
Co-authored-by: Çağlar Onur <[email protected]>
Co-authored-by: dpasiukevich <[email protected]>
Co-authored-by: Koichi Shiraishi <[email protected]>
Co-authored-by: Paweł Maciejczek <[email protected]>
Co-authored-by: indurireddy-TF <[email protected]>
Co-authored-by: Rohit Yanamadala <[email protected]>
Co-authored-by: Yaroslav <[email protected]>
Co-authored-by: João Westerberg <[email protected]>
Co-authored-by: jaxxjj <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: David Mora <[email protected]>
Co-authored-by: Daniel Novikov <[email protected]>
Co-authored-by: Foued Benzaid <[email protected]>
Co-authored-by: Hyang-Ah Hana Kim <[email protected]>
Co-authored-by: Serob Nahapetyan <[email protected]>
Co-authored-by: Salman Chishti <[email protected]>
Co-authored-by: Zack Birkenbuel <[email protected]>
Co-authored-by: Karol Droste <[email protected]>
Co-authored-by: Mikalai Senkevich <[email protected]>
japerry911 added a commit to japerry911/adk-go that referenced this pull request Apr 1, 2026
* fix: enable llm variant for gemini 2.5 and below (google#562)

* fix: enable llm variant for gemini 2.5 and below

* chore: remove internal mutable session struct (google#572)

It does nothing, leftover from the refactoring.

* feat: Introduce Retry and Reflect plugin (google#564)

* Introduce Retry and Reflect pluging

* Address gemini-bot review comments

* Add some unit tests

* Run gofumpt -l -w .

* Improve the explanation of WithErrorIfRetryExceeded

* move guidances to templates

* feat: add MustNew func

---------

Co-authored-by: dpasiukevich <[email protected]>

* fix: format go.mod by direct and indirect dependencies (google#580)

Signed-off-by: Koichi Shiraishi <[email protected]>

* feat: implement v2 trace debug endpoints based on semconv spans and logs (google#570)

* feat(telemetry): add logging setup options

* feat: Implement new debug endpoints

* Apply suggestions from code review

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* resolve review comments

* go mod tidy

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* feat: improve telemetry GCP quota and resource projects validation to (google#584)

fail on whitespace

* feat: add otel structured logging (google#552)

* feat: Add OpenTelemetry structured logging for GenAI requests and responses.

* refactor: Align OpenTelemetry gen_ai event logging with ADK Python and clarify deviations from semconv.

* refactor: move logging to generateContent function

* refactor: rename logger to otelLogger

* feature: add genAICaptureMessageContent to telemetry.config and options

* refactor: update the logic behind guessAISystem

* add tests for log span propagation

* add logging tests to base_flow tests

* feat: Add genAICaptureMessageContent to the telemetry Providers struct initialization.

* feat(telemetry): add OTel logger initialization (google#573)

* feat(telemetry): add logging setup options

* fix flaky tests

* feat: add script for updating embedded adk-web (google#594)

* fix: runssehandler-causes-superfluous-responsewriteheader-on-errors (google#531)

* chore: Add a pull request template

* doc:pull_request_template

* refactor(doc):typo correction

* refactor(doc):apply suggestions

* refactor(doc):implement suggestions

* refactor(doc):add extra line

* feat: adka2a mode with artifact per non-partial event (google#599)

* implement alternative artifact production mode

* update artifact aggregation logic on remote agent

append=false, lastChunk=false: emit as partial, restart aggregation
append=false, lastChunk=true: emit as non partial, drop aggregation
append=true, lastChunk=false: emit as partial, update aggregation
append=true, lastChunk=true: emit as partial, update aggregation, emit aggregation as non partial, drop aggregation

* agent run processor tests

* mixed mode tests

* executor outputs test

* update explanation

* fix lint

* remove duplicate test

* feat: integrate debug endpoints with adk-web (google#597)

* feat: integrate debug endpoints with adk-web

The previous version was based on proposed V2 debug endpoints, which got abandoned
Adk web will support v1 endpoints and semconv spans.

* feat: Add unique event IDs to LLM responses for telemetry tracking and update API CORS to allow all origins.

* fix: deterministic remoteagent aggregate event emit order (google#603)

* deterministic update emit order

* remove duplication

* use func

* feat: refactor debugtelemetry - optimize trace access (google#593)

* refactor: improve traces lookup in DebugTelemetry and remove otel test dependency

* Introduce tool.WithConfirmation  (google#579)

Introduce *experimental* tool.WithConfirmation. 
It wraps a toolset to inject confirmation logic in each tool after they created.

* fix: race conditions in parallel agents (google#530)

* fix: race conditions in parallel agents

* fix

* file name

* refactor: centralize session concurrency management by removing mutexes from `MutableSession` and adding them to `InMemorySession`'s event and state updates, along with a new deadlock test.

* fix yield errgroup.Wait() err

* lint fix

* Add clone to state All and store a copy of the event to stored_session

* fix temp event state delta clear

* Add TestParallelAgent_StateSync

* lint fix

---------

Co-authored-by: jaxxjj <[email protected]>

* chore(deps): bump github.com/modelcontextprotocol/go-sdk (google#604)

Bumps the go_modules group with 1 update in the / directory: [github.com/modelcontextprotocol/go-sdk](https://github.com/modelcontextprotocol/go-sdk).


Updates `github.com/modelcontextprotocol/go-sdk` from 0.7.0 to 1.3.1
- [Release notes](https://github.com/modelcontextprotocol/go-sdk/releases)
- [Commits](modelcontextprotocol/go-sdk@v0.7.0...v1.3.1)

---
updated-dependencies:
- dependency-name: github.com/modelcontextprotocol/go-sdk
  dependency-version: 1.3.1
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: implements identityRequestProcessor to internal/llminternal (google#585)

* feat: implements identityRequestProcessor

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: quote agent name and description in identity processor to match adk-python

The Python reference wraps name/description in double quotes as delimiters.
Also removes variable shadowing of the agent import and cleans up string
building.

Signed-off-by: Koichi Shiraishi <[email protected]>

* chore: extract mockLLMAgent to helpers_test.go

Move the shared test mock from outputschema_processor_test.go to a
dedicated helpers_test.go to prevent fragile cross-file test coupling.

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: support testcase to identity request processors injects

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: update model to gemini-2.5-flash in test case

Since gemini-2.0-flash is deprecated, `go generate` can no longer generate testdata using httprr.

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: regenerate httprr testdata and fix test case

Signed-off-by: Koichi Shiraishi <[email protected]>

* fix: use `strings.Join` to make system promppt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Signed-off-by: Koichi Shiraishi <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: remove loopagent dependency from sequential agent (google#611)

* Remove loopagent dependency from sequential agent

* lint fix

* test: regenerate parallel agent test (google#614)

Include the recent changes where identityProcessor is added.

* fix: use LLMRequest.Model in Gemini GenerateContent calls (google#620)

* fix: use LLMRequest.Model in Gemini GenerateContent calls

The Gemini model implementation was hardcoding m.name when calling the
GenAI API, ignoring the LLMRequest.Model field. This field is set by
base_flow.go and can be modified by BeforeModelCallback, but the value
was never read. This made runtime model switching via callbacks silently
ineffective.

Add a modelName() helper that prefers req.Model when set, falling back
to the construction-time name. This preserves existing behavior (since
req.Model defaults to m.name via base_flow) while enabling callback-
driven model overrides.

* Update model/gemini/gemini_test.go

Co-authored-by: Dmitry Pasiukevich <[email protected]>

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: `generateRequestConfirmationEvent` creates events with empty ID (google#588)

* Update functions.go

* Update functions_test.go

* Add missing fields to adkrest data model and event's ModelVersion field (google#609)

* Add missing fields to adkrest data model and event's ModelVersion field

* lint fix

* test fix

* test: fixed expected model name (google#621)

* fix: output not rendering in non-TTY environments (google#536) (google#568)

* fix output not rendering in non-TTY environments (google#536)

* fix output not rendering in non-TTY environments (google#536)

* replace x/term with stdlib TTY detection

* move streamingMode resolution outside user loop

* chore: fix go sum

* chore: fix go sum

---------

Co-authored-by: dpasiukevich <[email protected]>

* Add http.RoundTripper to merge request's header values. (google#607)

* Add http.RoundTripper to merge request's header values.

* Modify gemini new to copy the config to avoid mutating the httpclient

* fix: switch to the new mcp.ErrSessionMissing (google#625)

* feat: add adk configurable and cli initializer (google#617)

* Add adk configurable and cli initializer

* lint fixes

* lint fix

* Add conversion checks

* lint fix

* Move configurable and cli to internal packages

* Move conformance loader to internal

* fix nit

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* chore: update internal version (google#628)

* Add replay plugin (google#618)

* Add replay plugin

* lint fixes

* lint fix

* Add allowedBaseDir to replay_plugin

* lint fix

* Move replay plugin to internal/configurable/comformance

* Add Python-isms to JSON-isms normalizer to replay plugin

* Simplify records unmarshaling

* Add example tool that adds examples to llm request (google#612)

* Add example tool that adds examples to llm request

* Add missing copyright header

* Add sanitization for example tool "End few-shot"

* lint fix

* all: run go fix ./... (google#634)

* Initialize EventActions' ArtifactDelta to empty map (google#610)

* Initialize artifact_delta to empty map

* lint fix

* Modify tests to check ArtifactDeltas

* lint fix

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* Change content "For context" formatting (google#613)

* Changes content "For context" to formatting

* Removed stringify pythonism from contents_processor

* Add custom description to gemini tool

* lint fix

* test fix

* merge fix RegisterToolFactory using geminitool

* Add runner options, WithStateDelta (google#615)

* Add pathPrefix config to api launcher (google#616)

* Add pathPrefix config to api launcher

* Add handle trailing and leading slashs

* feat: extension points for remoteagent part conversions (google#627)

extension points for part conversions

* feat: add apigee model (google#639)

* chore: sync codebase

* Modify append instructions to modify existig part. Add ExampleTool factory to configurable. (google#640)

* Modify append instructions to modify existig part. Add ExampleTool factory.

* lint fix

* Keep transfer_to_agent declaration and rewrite expected in replay plugin

* Remove callback print

* chore: upgrade GitHub Actions to latest versions (google#643)

Signed-off-by: Salman Muin Kayser Chishti <[email protected]>

* chore: upgrade GitHub Actions for Node 24 compatibility (google#642)

Signed-off-by: Salman Muin Kayser Chishti <[email protected]>
Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: do not retry confirmation requests as they are not really errors. (google#641)

* Do not retry confirmation requests as they are not really errors.

* Also exclude rejections from being retried same way

* Fix the typo in the name

* Address gemini-code-assist comment about scopedFailureCounters

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: skip vendor in copyright header test (google#636)

The copyright header walk should not descend into vendored sources.

Add vendor to the ignore list used by TestCopyrightHeader so the test only checks repository-owned Go files.

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* refactor: remove duplicated ConfirmationProvider (google#649)

* refactor: remove duplicated ConfirmationProvider

BREAKING CHANGE: there's already such entity in the tool package.

* refactor: rename tool.StringPredicate

* refactor: consistent memory service naming (google#650)

* refactor: consistent memory service naming

BREAKING CHANGE: updating the memory service naming to be consistent
with other ADKs prior releasing v1.0

* feat: remoteagent and executor subtask cleanup (google#645)

* If remoteagent run completes with an error or early break (yield returns false) - cancel rpc task will be sent to the remote server
* Added `A2ARemoteTaskCleanupCallback` callback option to `remoteagent.NewA2A`, it can be used to override the remote task cancellation behavior
* Extracted agent card resolution to `internal/agent/remoteagent` so that it can be reused in `adka2a` package
* Added internal remoteagent state which hold a spec for connecting to the remote server: agent card, resolver options, client factory, etc.
* Added the logic for cancelling subagent tasks in input-required when root agent task is cancelled. Cancellation is best-effort.
* Added `A2AExecutionCleanupCallback` to `adka2a.Executor` which gets invoked after execution or cancellation completes with either result or an error. The default behavior is to log an error.
* Fixed `A2AEventConverter` taking `ReadonlyContext` making it not possible to invoke the default adka2a.ToSessionEvent which requires an `InvocationContext`
* Fixed `adka2a.A2APartConverter` not used in remoteagent
* Fixed `updateAggregation` failing for nil-content events
* Updated a2a-go to `0.3.9`

* feat: add progressive SSE to streaming aggregator and parallel function call execution (google#654)

* Modify streaming aggregator to support progressive sse

* Add parallel execution, add replay test

* Remove previous TestStreamAggregator

* Remove unused httpr

* lint fixes

* Add check thoughtSignature to TestParallelFunctionCalls

* Change aggregator close to use response error code and message

* fix interleaved thought&text aggregation (google#655)

* fix: part converter not used in input required processor (google#657)

The main event processing pipeline checks for a part converter in
processor.go just after handling the inputRequiredProcessor.  If any
parts are found to be "input required" parts they are sliced off of the
content and put onto a new A2A message that is returned after the main
A2A message. Unfortunately that means that if there are any special
converters that would affect those parts they do not get the chance to
be invoked.

This change just plumbs through the existing converter and makes sure it
gets a chance to run.

* refactor: remove launcher dependency from adkrest (google#660)

* refactor: remove launcher dependency from adkrest

Launcher package may be revised in future (for example in favor of ADK
App).
Right now we need to make sure that we don't import the launcher as a
config type in critical packages, e.g. `server` packages.

BREAKING CHANGE: updated adkrest package, replaced NewHandler with
NewServer constructor.

* upd

* upd

* feat(otel): replace batch span and log processors with synchronous implementations (google#661)

* feature: update adk-web to the latest version (google#653)

`$ ./scripts/adk-web/update-adk-web.sh`

* chore(deps): bump google.golang.org/grpc (google#663)

Bumps the go_modules group with 1 update in the / directory: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.78.0 to 1.79.3
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.78.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update a2a-go and fix test race (google#664)

* update a2a-go and fix test race

* tidy

* Update to the latest version (google#666)

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* chore(deps): bump github.com/modelcontextprotocol/go-sdk (google#667)

Bumps the go_modules group with 1 update in the / directory: [github.com/modelcontextprotocol/go-sdk](https://github.com/modelcontextprotocol/go-sdk).


Updates `github.com/modelcontextprotocol/go-sdk` from 1.4.0 to 1.4.1
- [Release notes](https://github.com/modelcontextprotocol/go-sdk/releases)
- [Commits](modelcontextprotocol/go-sdk@v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: github.com/modelcontextprotocol/go-sdk
  dependency-version: 1.4.1
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Pasiukevich <[email protected]>

* feat: allow the runner to automatically create a session if AutoCreateSession is enabled. (google#622)

* feat: allow the runner to automatically create a session if `AutoCreateSession` is enabled.

* Update runner/runner.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* refactor: update memory req/resp names (google#671)

BREAKING CHANGE

* Conformance fixes for change to yaml format and progressive sse (google#672)

Co-authored-by: Mikalai Senkevich <[email protected]>

* fix: preserve error details and finish reason in streaming response aggregator and update test expectations (google#678)

* feat: Implement and test recursive agent lookup by name. (google#626)

* feat: Implement and test recursive agent lookup by name.

* refactor: convert `TestFindAgent` to a table-driven test and enable parallel execution.

* feat: Introduce a `FindAgent` method on `llmAgent` to locate sub-agents by name, replacing the `runner` package's internal `findAgent` helper.

* feat: add GetArtifactVersion method to artifact service (google#575)

* feat: add GetArtifactVersion method to artifact service

* chore: remove adk-go main executable.

* Update artifact/service.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Extract resolveVersion helper in gcsartifact.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: custom runner provider for adka2a executor (google#680)

* custom runner provider for adka2a executor

* remove the mandatory dependency on runnerConfig

* Add session service test suite (google#675)

* Add session service test suite

* lint fix

* lint fix

---------

Co-authored-by: Dmitry Pasiukevich <[email protected]>

* fix: fix data part conversions (google#689)

* fix data part conversions

* fix: correct json envelope for datapart (google#695)

* chore: update a2a-go and fix double cleanup (google#698)

* update a2a-go and fix double cleanup

* tidy

---------

Signed-off-by: Koichi Shiraishi <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Salman Muin Kayser Chishti <[email protected]>
Co-authored-by: Dmitry Pasiukevich <[email protected]>
Co-authored-by: Çağlar Onur <[email protected]>
Co-authored-by: dpasiukevich <[email protected]>
Co-authored-by: Koichi Shiraishi <[email protected]>
Co-authored-by: Paweł Maciejczek <[email protected]>
Co-authored-by: indurireddy-TF <[email protected]>
Co-authored-by: Rohit Yanamadala <[email protected]>
Co-authored-by: Yaroslav <[email protected]>
Co-authored-by: João Westerberg <[email protected]>
Co-authored-by: jaxxjj <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: David Mora <[email protected]>
Co-authored-by: Daniel Novikov <[email protected]>
Co-authored-by: Foued Benzaid <[email protected]>
Co-authored-by: Hyang-Ah Hana Kim <[email protected]>
Co-authored-by: Serob Nahapetyan <[email protected]>
Co-authored-by: Salman Chishti <[email protected]>
Co-authored-by: Zack Birkenbuel <[email protected]>
Co-authored-by: Karol Droste <[email protected]>
Co-authored-by: Mikalai Senkevich <[email protected]>
hanorik pushed a commit to hanorik/adk-go that referenced this pull request Apr 8, 2026
kdroste-google pushed a commit to kdroste-google/adk-go that referenced this pull request Apr 8, 2026
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.

2 participants