Skip to content

fix(plugins): allow complete LoggingPlugin output - #7489

Open
Manitchahar wants to merge 1 commit into
google:mainfrom
Manitchahar:fix/logging-plugin-truncation
Open

Manitchahar wants to merge 1 commit into
google:mainfrom
Manitchahar:fix/logging-plugin-truncation

Conversation

@Manitchahar

Copy link
Copy Markdown

Link to Issue or Description of Change

Problem:
LoggingPlugin hard-codes truncation at 200 characters for text parts and system instructions, and 300 for tool arguments/results. Error details at the end of a long tool result never reach the log.

Solution:
Add two keyword-only constructor options. Defaults are unchanged; None disables truncation.

LoggingPlugin(max_content_length=None, max_args_length=None)

Only logging_plugin.py and its test file are touched.

Testing Plan

Unit Tests:

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

tests/unittests/plugins/test_logging_plugin.py: 31 passed on current main (20 new cases covering custom limits, exact-boundary lengths, zero, and None). Previously verified on Python 3.10–3.14.

Manual End-to-End (E2E) Tests:

Ran a real InMemoryRunner with a scripted local BaseLlm that calls a tool returning a long diagnostic. A marker placed after the default cutoff is hidden with the defaults and visible with custom or None limits, for tool results, model responses and system instructions.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective.
  • New and existing unit tests pass locally with my changes.

Additional context

Companion docs PR: google/adk-docs#2215

🤖 Generated with Claude Code

Expose the existing content and argument limits as keyword-only options. Preserve current defaults and accept None to disable truncation.

Fixes google#6056
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.

What's the purpose of logging if messages are truncated ? At least it should be configurable

2 participants