Repository navigation
Conversation
`adk run` and `--replay` joined every text part of an event, so a thinking model's reasoning (e.g. Ollama `thinking` mapped to `thought=True` by LiteLlm) was printed glued to the answer. Fixes google#8102
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.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
The human-readable printers in
cli.py(_print_eventforadk run, andrun_input_fileforadk run --replay) join the text of every part in an event. LiteLlm maps a reasoning model'sthinking/reasoning_contenttoPart(text=..., thought=True), so the reasoning is printed glued to the answer:[assistant]: <thought text><final answer>.Solution:
Skip parts with
thought=Truein both printers, so only the answer is shown. JSONL output (--jsonl) is unchanged and still carries the thought parts. Showing thoughts separately behind a flag, which the issue also mentions, is left out.Testing Plan
Unit Tests:
New
test_print_event_hides_thought_partsandtest_run_input_file_hides_thought_parts. Onmain(9620b42) both fail, e.g.assert ['[agent]: thinking...Hi!'] == ['[agent]: Hi!']; with the fix:The test file's fake
Partclasses gained athoughtattribute, which the realtypes.Partalways has.test_cli_tools_click.pyhas the same 27 failures with and without this change (optional deps such assqlalchemynot installed in my environment). The full suite and tox were not run.pyink --checkandisort --check-onlypass on both files (Python 3.13).Manual End-to-End (E2E) Tests:
Not run (no local Ollama). The unit tests feed the printers an event with a thought part and an answer part.
Checklist
Additional context
AI-assisted; tests run locally.