Skip to content

Document and code comment are inconsistent for is_final_response() usage #4016

Closed

Description

@tosi29

Describe the bug

According to document,

Use is_final_response(): Rely on this helper method in your application/UI layer to identify complete, user-facing text responses. Avoid manually replicating its logic.

The document recommends to use is_final_response() method.

However, according to comment,

NOTE: This method is ONLY for use by Agent Development Kit.

This implies the method is internal and should not be used by application developers.

It looks inconsistent.
It is unclear whether this method is intended to be a public API for developers or strictly for internal use within the ADK.

To Reproduce
N/A

Expected behavior
Please clarify the intended usage of is_final_response().
If it is for public use (as per docs), the code comment "ONLY for use by Agent Development Kit" should be removed or rephrased.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Model Information:
N/A

Additional context
N/A

Activity

  1. added
    documentation
    on Dec 24, 2025
  2. added theissue type on Dec 24, 2025
  3. Akshat8510 commented on Jan 6, 2026

    @Akshat8510
    Contributor

    I'd like to work on this! It seems like a simple comment update to align the code with the public documentation. Please assign it to me.

  4. self-assigned this
    on Jan 6, 2026
  5. llalitkumarrr commented on Jan 6, 2026

    @llalitkumarrr
    Collaborator

    Hello @tosi29 ,

    The is_final_response() method on an event indicates whether that event represents the concluding output from the agent that authored it for that specific stage of the process.

    It is important to note that in a multi-agent conversation (e.g., Agent A calls Agent B):
    *Agent B will emit an event with is_final_response() == True when it has completed its task.
    *Agent A will later emit its own event with is_final_response() == True when it has finished its processing, potentially after receiving the response from Agent B.

    So, you can see multiple events where is_final_response() is True within a single user turn, one for each agent that finishes its part of the workflow. It does not just mean the end of the entire turn, but the end of an individual agent's contribution at that point.

    This issue also discuss the same.

  6. added
    answered
    on Jan 6, 2026
  7. tosi29 commented on Jan 7, 2026

    @tosi29
    Author

    @llalitkumarrr
    Thank you for the explanation, I understood the behavior.
    However, my question is about the intended usage policy.

    Since the document and code comment contradict each other, which one should we follow?
    Is this method intended to be public or internal?

  8. Akshat8510 commented on Jan 7, 2026

    @Akshat8510
    Contributor

    @llalitkumarrr, thank you for the detailed breakdown of how the method works.
    To follow up on @tosi29's point and get this issue resolved: since the documentation currently encourages developers to use this method, should we consider it Public API?

  9. added
    question
    on Jan 8, 2026
  10. llalitkumarrr commented on Jan 8, 2026

    @llalitkumarrr
    Collaborator

    Hello @tosi29 and @Akshat8510 ,

    This is primarily intended as framework internal concept but users can utilize this to examine various aspects of Events to build robust applications.

  11. Akshat8510 commented on Jan 8, 2026

    @Akshat8510
    Contributor

    @llalitkumarrr thank you for the clarification!
    Since you confirmed that users can utilize this method to build robust applications, the current code comment, which says 'ONLY for use by Agent Development Kit', is a bit too restrictive and misleading for developers.

  12. Akshat8510 commented on Jan 8, 2026

    @Akshat8510
    Contributor

    I'd like to submit a PR to update that comment to something more accurate, such as:
    'Primarily for internal framework use, but can be utilized by applications to identify concluding agent outputs.'

  13. Akshat8510 commented on Jan 8, 2026

    @Akshat8510
    Contributor

    This would align the code with both your explanation and the public documentation. May I be assigned to make this update?

  14. llalitkumarrr commented on Jan 8, 2026

    @llalitkumarrr
    Collaborator

    This is primarily intended as framework internal concept, hence the comment in the code. And developers could use this experimentation and exploration with while building applications.

  15. Akshat8510 commented on Jan 8, 2026

    @Akshat8510
    Contributor

    I completely understand that it is a framework-internal concept at its core.

    My concern is specifically with the word 'ONLY' in the current comment (ONLY for use by Agent Development Kit). For a developer, the word 'ONLY' implies that using the method is unsupported or might lead to breaking changes, which contradicts the 'experimentation and exploration' you mentioned.

  16. tosi29 commented on Jan 12, 2026

    @tosi29
    Author

    @llalitkumarrr
    Thank you for the clarification.

    If the intended usage is indeed for "experimentation and exploration" as you mentioned, I am concerned that the current documentation is misleading.
    It is currently listed under "Best Practices", and explicitly says "Rely on this helper method" and "Avoid manually replicating its logic", which strongly implies it is production-ready and stable.

    To avoid confusion and potential risks in production, I suggest updating both the documentation and the code comment to clearly state:
    "This method is experimental only, and not for production use."

    This would resolve the inconsistency by clarifying the stability level for developers.

  17. llalitkumarrr commented on Jan 14, 2026

    @llalitkumarrr
    Collaborator

    Hello,

    We understand this might be confusing. Please be assured that we will do the needful to clear this up.

  18. added
    needs review
    on Feb 6, 2026
  19. added a commit that references this issue on Jun 17, 2026
    978be4b
  20. added a commit that references this issue on Aug 11, 2026
    8b7d32b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

answereddocumentationneeds reviewquestion

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions