Repository navigation
fix(llminternal): keep ModelVersion on the aggregated streaming response - #2070
Merged
wolo-lab merged 2 commits intoNov 6, 2026
Merged
Conversation
Close built the aggregated response, the one a streamed turn is stored as, without ModelVersion, so a streamed model turn lost the model version that every chunk and a non-streamed response report. Copy it from the last chunk, as adk-python's StreamingResponseAggregator.close does.
Contributor
|
Hi @adityasingh2400 Thank you for the fix! I reviewed the changes and confirmed that they correctly preserve ModelVersion in the aggregated streaming response, aligning with the ADK-Python implementation. The regression test also covers the reported issue. @wolo-lab Could you please take a look at this PR? |
wolo-lab
force-pushed
the
fix/stream-aggregator-model-version
branch
from
November 6, 2026 10:57
6c64062 to
2447fe0
Compare
wolo-lab
approved these changes
Nov 6, 2026
wolo-lab
added a commit
that referenced
this pull request
Nov 16, 2026
…2071, #1249, #2070, #2190, #2301, #2310, #2308) (#2350) * fix(llminternal): keep a streamed text chunk's thought signature on the merged part (#2071) (cherry picked from commit 28201d6) * test(llminternal): pin keep-last semantics for streaming usage metadata (#1249) (cherry picked from commit afe6c86) * fix(llminternal): keep ModelVersion on the aggregated streaming response (#2070) (cherry picked from commit 8be9129) * fix(llminternal): drop nil parts in the streaming aggregator (#2190) (cherry picked from commit 46ff99b) * fix(llminternal): skip live responses that carry nothing (#2301) (cherry picked from commit 8cddb9d) * fix(llminternal): keep responses that carry only grounding metadata (#2310) (cherry picked from commit fc6de07) * fix(llminternal): keep streamed function-call and event ids stable (#2308) (cherry picked from commit 3188db9)
campoy
added a commit
to temporalio/ai-integrations
that referenced
this pull request
Nov 17, 2026
#601) ## What was changed ADK Go 2.8.0 came out today, and the nightly picks it up. Five tests fail with it. Each one pins ADK behavior that 2.8.0 changes on purpose: | Test | What ADK 2.8.0 changes | |---|---| | `TestAggregateResponsesGeminiTerminalAuthoritative` | Gemini's last streamed response keeps `ModelVersion` (google/adk-go#2070) | | `TestGeminiModelErrorIsNonRetryable` (blocked prompt, empty reply) | A non-streamed reply with no candidates is a response with an `ErrorCode`, not an `empty response` error (google/adk-go#2068) | | `TestMCPToolConfirmationResumeHonorsCurrentToolFilter` | A call to an unknown tool gets adk-python's message instead of "not found" (google/adk-go#2316) | | `TestRemoteSubAgentErrorNotRetried`, `TestRemoteSubAgentStreaming` | A remote agent returns A2A errors from `Run` instead of turning them into error events (google/adk-go#1740) | The plugin code needs no change: it follows the new behavior, and nothing is retried that wasn't before. For example, an A2A error still fails after one Activity attempt; with 2.8.0 it now also fails the run, as it does without Temporal. go.mod keeps ADK 2.6.0, so CI tests 2.6.0 on pull requests and the newest ADK every night. A new test helper, `ADKAtLeast`, reads the ADK version from go.mod, and each of these tests expects the behavior of the version it runs on. Why go.mod and not the build info? I tried the build info first, but test binaries don't record dependency versions: `debug.ReadBuildInfo` returns no deps at all. go.mod works because `-mod=readonly` keeps it equal to the versions in the build. This makes `golang.org/x/mod` a direct dependency, for tests only. The blocked-prompt stub now has a `blockReasonMessage`, so on 2.8.0 the test can check that the block reason reaches the run as an error event. The README described the old behavior in two places: A2A errors and a blocked Gemini prompt. Both now say what changes from 2.8.0. ## Why? A red nightly blocks the `go/googleadk` release. Couldn't we raise the floor to 2.8.0 and drop the old behavior instead? It would make the tests simpler, but 2.8.0 came out today, and its release notes list a breaking change of its own. That's too new to require from everyone at GA. ## Checklist 1. Closes: no issue yet. The nightly hasn't run since ADK 2.8.0 came out. A run with the newest dependencies on `main` shows the failures: https://github.com/temporalio/ai-integrations/actions/runs/44004694511 2. How was this tested: in `go/googleadk`, - with the committed go.mod (ADK 2.6.0), `make lint`, `make test` (with and without `-race`) and `make build` pass. - with the newest allowed dependencies (`make sync-latest`, ADK 2.8.0), `make lint`, `make test TEST_ARGS=-race` and `make build` pass. Before this change, `make test` failed in the five tests above. - with ADK pinned back to 2.7.1 and everything else at its newest, the five tests passed before this change, so 2.8.0 is the only cause. 3. Any docs updates needed? The README, updated here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Linked issue
Problem:
The response
Closebuilds, which is what a streamed turn is stored as, doesn't copyModelVersion, so every streamed model turn has an empty model version.Solution:
Copy
s.response.ModelVersiononto the responseClosereturns, as adk-python's aggregator does (src/google/adk/utils/streaming_utils.py:598-608).Behavior change
Streamed model turns now carry the model version the API reported, as non-streamed turns already do.
TestParallelFunctionCallsexpected the empty value, so its expectations are updated to the versions in its existing recordings. Nothing was re-recorded.Testing Plan
Unit Tests:
Added
TestCloseKeepsModelVersion. The recordedTestParallelFunctionCalls(3 models) now also checks the version.With your source change reverted and your tests kept, which test fails?
With the change,
go test -race -count=1 ./internal/llminternal/...passes,go build ./...succeeds, andgolangci-lint runreports 0 issues, withgolangci-lint fmt --diffandgo mod tidy -diffboth empty.Manual End-to-End (E2E) Tests:
N/A, covered by the unit test and the existing recordings.
Checklist