a2aproject / a2aproject/a2a-samples

bug: `_store_user_auth()` is never called after OAuth flow completes in `calendar_agent/adk_agent_executor.py`

Abierto
#275 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
1.8k
Forks
751
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### What happened?

The `_store_user_auth()` method in calendar_agent/adk_agent_executor.py (around [L213–L219](https://github.com/a2aproject/a2a-samples/blob/main/samples/python/agents/birthday_planner_adk/calendar_agent/adk_agent_executor.py#L213-L219)) is never called after the OAuth2 flow completes.

The flow correctly redirects to `/authenticate` and includes a valid `code` parameter, but the call to `_store_user_auth()` is skipped because `context.call_context.user.is_authenticated` remains `False`.

Even after explicitly adding a debug log line at the top of `_store_user_auth()`, the log message is never printed — confirming that the method is not invoked at all.

**What I expected to happen**
After completing the OAuth redirect and receiving the authorization code (`code=...`), I expected the agent to exchange the code for an access token and store the credentials via `_store_user_auth()`.

**How to reproduce the issue**
1. Run the sample agent `birthday_planner_adk/calendar_agent`.
2. Trigger a message that requires calendar access.
3. Complete the OAuth2 flow in the browser.
4. Observe from logs that `_store_user_auth()` is never executed, even if debug logs are inserted into the method.

### Relevant log output

```shell
DEBUG:adk_agent_executor:Skipping event
DEBUG:adk_agent_executor:Yielding auth required response: https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=<...>.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar&state=<...>&access_type=offline&prompt=consent&redirect_uri=http://localhost:10007/authenticate
DEBUG:adk_agent_executor:Waiting for auth event
INFO: ::1:51692 - "GET /authenticate?state=<...>&code=<...>&scope=https://www.googleapis.com/auth/calendar HTTP/1.1" 200 OK
INFO:adk_agent_executor:Auth received, continuing
DEBUG:adk_agent_executor:_complete_auth_processing with auth_content: UserContent(
parts=[
Part(
function_response=FunctionResponse(
id='adk-...',
name='adk_request_credential',
response={...} # Contains no access_token
)
)
]
)
DEBUG:adk_agent_executor:_complete_auth_processing after _process_request context:
INFO:adk_agent_executor:[Calendar] execute exiting
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.