Skip to content

Make rewind session upon cancellation accessible via API server #7177

Closed

Description

@aseelmannfuzzy

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

🔴 Required Information

Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Is your feature request related to a specific problem?

Agents may sometimes exhibit a heavy tool use, resulting in long processing times. In such a situation, one often wants to abort the generation, return to the last state, and rephrase the query. When interacting with our agents, we heavily rely on the ADK API (adk api_server), which doesn't seem to support a clean way to abort a generation and rewind the session to the previous state.

Describe the Solution You'd Like

The Debug Web UI (adk web) provides a button that allows to cancel the generation and rewind the session to the previous state. An analogous feature for the ADK API (adk api_server) is needed.

Impact on your work

Since we are currently not able to abort generation in a clean way, users often get frustrated when the agents take a wrong path and get lost in the various tools.

Willingness to contribute

N/A

🟡 Recommended Information

Describe Alternatives You've Considered

The only alternative we see with the ADK API so far would be save the session before every turn, delete it upon cancellation, and regenerate the session with the previous copy (create with id), but this seems overly excessive, especially since the ADK Web UI already has the functionality we are looking for.

Proposed API / Implementation

I'd expect that something like runner.rewind_async would be present in the api_server.py and accessible through one of the endpoints.

Additional Context

N/A

Activity

  1. chelsealong commented on Sep 18, 2026

    @chelsealong
    Contributor

    Picking this one up now — opening a PR shortly. Flagging it here so nobody duplicates the work; if someone is already on it, say so and I will drop mine.

  2. added
    services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc
    on Sep 21, 2026
  3. sanketpatil06 commented on Sep 21, 2026

    @sanketpatil06

    Hi @aseelmannfuzzy, thanks for submitting this feature request. We noticed a linked PR #7178 that aims to address this.
    Could you please test it out and let us know if it meets your expectations before we proceed with the review and merge?

  4. added
    request clarification[Status] The maintainer need clarification or more information from the author
    on Sep 21, 2026
  5. aseelmannfuzzy commented on Sep 21, 2026

    @aseelmannfuzzy
    Author

    Hi @aseelmannfuzzy, thanks for submitting this feature request. We noticed a linked PR #7178 that aims to address this. Could you please test it out and let us know if it meets your expectations before we proceed with the review and merge?

    Hi @sanketpatil06 , thanks for the quick response. At first glance, I'd indeed expect such an endpoint to appear here, and it would certainly solve the problem. Still, I wonder how the ADK Web UI accomplishes the analogous task. I expected that such code already exists somewhere.

  6. added a commit that references this issue on Oct 22, 2026
    b01c5ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

request clarification[Status] The maintainer need clarification or more information from the authorservices[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions