google / google/adk-python

Feature Request: Expose rewind functionality via Agent Engine REST API

Open
#4,121 3 comments 0 reactions 0 assignees View on GitHub
agent engine needs review
Dominant language
Python
Stars
21.5k
Forks
4k
Avg merge
1d 14h
Merged PRs (30d)
37

Description

## Feature Request

**Is your feature request related to a problem?**

Yes. The `runner.rewind_async()` method works great for local development, but when deploying to **Agent Engine (managed)**, there's no REST API endpoint to call the rewind functionality.

When trying to use the `appendEvent` endpoint with `rewind_before_invocation_id` in the actions object, the API returns:

```
Invalid JSON payload received. Unknown name "rewind_before_invocation_id" at 'event.actions': Cannot find field.
```

This means apps deployed to Agent Engine cannot implement "edit message" functionality that rewinds the conversation.

**Describe the solution you'd like**

Expose the rewind functionality via the Agent Engine REST API. Either:

1. Accept `rewind_before_invocation_id` in the `appendEvent` endpoint's `actions` object, OR
2. Add a dedicated `:rewind` endpoint like: `POST /sessions/{session_id}:rewind`

**Describe alternatives you've considered**

- **Self-hosting with `adk api_server`** - Works but loses the benefits of managed Agent Engine
- **UI-only fake rewind** - Just hide old messages and send new one, but AI still sees old context
- **Starting new sessions** - Poor UX, loses conversation history

**Additional context**

The rewind feature is documented at https://google.github.io/adk-docs/sessions/rewind/ and the Python SDK has `runner.rewind_async()` since v1.17.0. It would be great to have parity in the REST API for managed deployments.

**Environment**
- ADK version: 1.22.0
- Deployment: Vertex AI Agent Engine
- Region: us-central1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.