fix(adk): preserve streaming tool output during reduction#1090
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1090 +/- ##
==========================================
+ Coverage 83.11% 83.24% +0.12%
==========================================
Files 162 162
Lines 23134 23397 +263
==========================================
+ Hits 19228 19476 +248
- Misses 2640 2649 +9
- Partials 1266 1272 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
172fd49 to
7a86258
Compare
|
Updated the PR to address the Codecov failures by adding targeted coverage for the new default streaming truncation paths. What changed:
Local checks:
Local diff coverage estimate for |
|
@Zhang-986 hi, thanks for your tackling #1064 - the blocking behavior is real and worth fixing However, my concern is that this PR seems to address the symptom rather than the root cause. As long as the default truncation format is That’s why I’m hesitant about this approach: it streams the prefix live, but once the threshold is crossed it still waits for EOF and then emits the full truncation notice, which includes I wonder if the cleaner fix is at the prompt layer: use a streaming-specific truncation format with a full-length head preview plus a trailing notice, and no tail preview. Then truncation can remain fully incremental: stream until the threshold, stop, emit the notice, and avoid both EOF waiting and duplicated content. Such as: Happy to discuss if I’m missing a constraint, but I’d be more comfortable with a prompt-level fix here. |
7a86258 to
aecf6ae
Compare
|
Implemented the prompt-level/default streaming fix:
Verification:
|
|
Updated the branch with commit What changed in the latest commit:
Local verification:
The latest fork workflow runs are currently waiting for maintainer approval ( |
|
@Zhang-986
|
Summary
MaxLengthForTrunc, emit the notice once the threshold is crossed, then drain remaining output for offload without forwarding itTruncHandlerbehavior unchangedFixes #1064.
Tests
go test ./adk/middlewares/reduction -run 'TestReductionMiddlewareTrunc/.*default.*streamable.*(terminal cases|nonblocking)' -count=1go test ./adk/middlewares/reduction -count=1go test ./adk/middlewares/reduction -coverprofile=/tmp/eino-reduction-after2.cover -covermode=count -count=1adk/middlewares/reduction/reduction.go: 217/227 coverable added lines hit, about 95.59%wrapDefaultStreamableTruncation94.4%,wrapDefaultEnhancedStreamableTruncation95.5%go test ./adk/... -count=1git diff --checkNote: the latest fork workflow runs are currently waiting for maintainer approval (
action_required), so Codecov has not recalculated for commit95ac44dyet.