You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make rewind session upon cancellation accessible via API server #7177
** 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.
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.
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 @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.
Activity
chelsealong commentedon Sep 18, 2026
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.
sanketpatil06 commentedon Sep 21, 2026
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?
aseelmannfuzzy commentedon Sep 21, 2026
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.
feat: expose session rewind as a REST endpoint