Skip to content

BUG: ADK fails for the next user query just after the even compaction event has been generated #4000

Closed

Description

@MahorShekhar

Facing issues in getting response from ADK for the user input just after even compaction event has been generated.

  File "/Users/Shekhar/cosmos-adk-v3/venv/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 375, in _run_one_step_async
    async for event in agen:
      yield event
  File "/Users/Shekhar/cosmos-adk-v3/venv/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 465, in _preprocess_async
    async for event in agen:
      yield event
  File "/Users/Shekhar/cosmos-adk-v3/venv/lib/python3.13/site-packages/google/adk/flows/llm_flows/contents.py", line 50, in run_async
    llm_request.contents = _get_contents(
                           ~~~~~~~~~~~~~^
        invocation_context.branch,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
        invocation_context.session.events,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        agent.name,
        ^^^^^^^^^^^
    )
    ^
  File "/Users/Shekhar/cosmos-adk-v3/venv/lib/python3.13/site-packages/google/adk/flows/llm_flows/contents.py", line 354, in _get_contents
    events_to_process = _process_compaction_events(raw_filtered_events)
  File "/Users/Shekhar/cosmos-adk-v3/venv/lib/python3.13/site-packages/google/adk/flows/llm_flows/contents.py", line 265, in _process_compaction_events
    compaction.start_timestamp is not None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'start_timestamp'

Activity

  1. added
    core
    on Dec 22, 2025
  2. added theissue type on Dec 22, 2025
  3. added
    planned
    on Dec 23, 2025
  4. llalitkumarrr commented on Dec 29, 2025

    @llalitkumarrr
    Collaborator

    Hello @MahorShekhar ,

    Could you please provide more information to help us understand this issue better? A minimal reproducible code example would be very helpful.

    Also, if you are not already using the latest version, please upgrade to google-adk==1.21.0. You may also find this page in docs useful.

  5. removed
    planned
    on Dec 29, 2025
  6. MahorShekhar commented on Dec 29, 2025

    @MahorShekhar
    Author

    hi @llalitkumarrr this issue is related to this one : #3707

  7. llalitkumarrr commented on Dec 29, 2025

    @llalitkumarrr
    Collaborator

    We had two releases after this, could you please try to test with latest version?

  8. ryanovas commented on Dec 30, 2025

    @ryanovas
  9. llalitkumarrr commented on Jan 7, 2026

    @llalitkumarrr
    Collaborator

    Hi @MahorShekhar ,

    We are currently analyzing this issue. Could you please provide the reproduction steps and a minimal reproducible code snippet? That would help us a lot.

  10. nicwang119 commented on Jan 7, 2026

    @nicwang119

    Same issue as above


    Hello, @llalitkumarrr, I encountered the same error. I opened an issue yesterday, but it hasn’t been very helpful so far. I believe this may be the same issue described in #4082.

    I'm using google-adk version 1.21.0, and I also tried 1.20.0 and 1.19.0, but the issue persists across all of them.

    The code below reproduces the error — it was run entirely in a single cell on a Kaggle CPU notebook. The problem seems related to compaction, which is triggered at turn 4, as I set compaction_interval = 3.

    Let me know if you want to add any logs or stack trace reference as well.

    Thanks.


    Code snippet

    code_snippet.txt

    Code response

    code_response1.txt

  11. rparme commented on Jan 9, 2026

    @rparme

    Same issue with 1.19.0 and 1.21.0.
    We are also using a DatabaseSessionService.

  12. added
    needs review
    on Jan 14, 2026
  13. llalitkumarrr commented on Jan 14, 2026

    @llalitkumarrr
    Collaborator

    Hello @ankursharmas ,

    Could you please find some time to look into this and share your inputs?

  14. wuliang229 commented on Jan 20, 2026

    @wuliang229
    Collaborator

    This issue should be gone in the 1.22.1 version as ADK uses a new schema for the DatabaseSessionService.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreneeds review

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions