Skip to content

feat(adk): add read tool hint to truncation notice#1118

Merged
N3kox merged 1 commit into
cloudwego:mainfrom
Zhang-986:codex/reduction-trunc-read-tool-hint
Jul 8, 2026
Merged

feat(adk): add read tool hint to truncation notice#1118
N3kox merged 1 commit into
cloudwego:mainfrom
Zhang-986:codex/reduction-trunc-read-tool-hint

Conversation

@Zhang-986

Copy link
Copy Markdown
Contributor

Summary

  • add the configured read tool name to default truncation notices, matching clear-stage notices
  • pass ReadFileToolName into the default truncation handler
  • cover custom read tool names in default truncation output

Fixes #1110.

Tests

  • go test ./adk/middlewares/reduction -run 'TestReductionMiddlewareTrunc/test_default_truncation_notice_includes_configured_read_tool_name' -count=1
  • go test ./adk/middlewares/reduction -count=1
  • go test ./adk/middlewares/reduction -coverprofile=/tmp/eino-reduction-1110.cover -covermode=count -count=1
  • local patch coverage estimate: 100% (7/7 changed statements)
  • go test ./adk/... -count=1
  • git diff --check

@Slideee

Slideee commented Jul 6, 2026

Copy link
Copy Markdown

这个 PR 能合并吗

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.34%. Comparing base (747023b) to head (94d5bb2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1118      +/-   ##
==========================================
+ Coverage   83.28%   83.34%   +0.06%     
==========================================
  Files         162      162              
  Lines       23397    23398       +1     
==========================================
+ Hits        19486    19501      +15     
+ Misses       2642     2629      -13     
+ Partials     1269     1268       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@N3kox

N3kox commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@Zhang-986
Hi, please apply the modifications in this PR to the newly added prompts #1090 when you have time.

@Zhang-986 Zhang-986 force-pushed the codex/reduction-trunc-read-tool-hint branch from cb2bb82 to 94d5bb2 Compare July 8, 2026 07:46
@Zhang-986

Copy link
Copy Markdown
Contributor Author

Fixed in 94d5bb2.

Applied the read tool hint to the streaming offload-saved prompts introduced by #1090, covering both default streamable and enhanced streamable truncation paths. I kept the hint on the offload-saved notice so it is only shown when the full output was actually saved.

Verified:

  • go test ./adk/middlewares/reduction -count=1
  • go test ./adk/... -count=1
  • git diff --check

@N3kox N3kox merged commit 922b6a8 into cloudwego:main Jul 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat(adk/reduction): add read tool name hint to truncation notice

3 participants