-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
core[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation
Description
Describe the bug
Unable to resume agents without specifying "new_message"
To Reproduce
- Create a new session
> curl -X POST -H "Content-Type: application/json" http://localhost:8000/apps/my_app/users/user/sessions
{"id":"a0eccf39-5499-4990-8b09-14a336a3c14e","appName":"my_app","userId":"user","state":{},"events":[],"lastUpdateTime":1767879087.399263}
- Start an invocation
> curl -X POST -H "Content-Type: application/json" -H "Accept: text/event-stream" -H "Cache-Control: no-cache" http://localhost:8000/run_sse --data '{"app_name": "my_app", "user_id": "user", "session_id": "a0eccf39-5499-4990-8b09-14a336a3c14e", "new_message": {"role": "user", "parts": [{"text": "Hello !"}]}}'
...
data: {...,"invocationId":"e-8679c93c-6a64-4669-a35a-d05c018cd40a", ...}
- Cut the server during the invocation
- Restart the adk server
- Try to resume the invocation using
> curl -X POST -H "Content-Type: application/json" -H "Accept: text/event-stream" -H "Cache-Control: no-cache" http://localhost:8000/run_sse --data '{"app_name": "my_app", "user_id": "user", "session_id": "a0eccf39-5499-4990-8b09-14a336a3c14e", "invocation_id": "e-8679c93c-6a64-4669-a35a-d05c018cd40a"}'
{"detail":[{"type":"missing","loc":["body","newMessage"],"msg":"Field required","input":{"app_name":"my_app","user_id":"user","session_id":"a0eccf39-5499-4990-8b09-14a336a3c14e","invocation_id":"e-8679c93c-6a64-4669-a35a-d05c018cd40a"}}]}%
Expected behavior
Should resume invocation with given id as stated in the documentation: https://google.github.io/adk-docs/runtime/resume/#resume-a-stopped-workflow.
Desktop (please complete the following information):
- OS: Linux
- Python version(python -V): 3.10.12
- ADK version(pip show google-adk): 1.21.0
Additional context
I think we only need to make Optional "newMessage" in the pydantic model here:
| new_message: types.Content |
Metadata
Metadata
Assignees
Labels
core[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation