Replies: 3 comments
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The Hi there, This is a great question. The issue you're encountering, The CauseThe The Solution: Pause and ResumeInstead of handling the interactive flow from within the agent's continuous run, you should manage it from your client code that orchestrates the agent. The recommended pattern is to "pause" the agent execution to get user credentials and then "resume" it. Here is the correct workflow:
This "pause and resume" cycle ensures that the interactive part happens outside the agent's This pattern is the standard way to handle authentication in ADK, as detailed in the official documentation. You can find a complete implementation of this flow in the Following this approach should resolve the [1] ADK Authentication Documentation: https://google.github.io/adk-docs/tools-custom/authentication/ |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @adk-bot, I’m using ADK Web, so I don’t explicitly instantiate a Runner myself. Instead, I’m iterating through events inside a loop/stream handler: What would you suggest in this case? |
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: This is a known issue with Hi @guilmour, This is a great question. The The CauseThe root of the problem is that the The Solution: Two-Phase Authentication FlowTo resolve this, you need to structure your application to explicitly manage the authentication lifecycle. This involves a two-phase process where your client code, which runs the agent, is responsible for handling the authentication request. Here’s the recommended approach:
You can find a detailed explanation and code examples of this two-phase authentication flow in the ADK documentation. [3, 4, 5] Following this pattern ensures that the I hope this helps you resolve the issue! References [1] https://github.com/google/adk-python/blob/main/src/google/adk/runners.py |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm running a multi-agent workflow using
LoopAgent.At some point, the agent calls an
MCPToolsetwith authentication enabled. To handle the interactive OAuth/OIDC flow, I followed the documentation and usedadk_request_credential, which correctly opens a popup window for the user to log in.However, after the popup closes, the agent crashes with the following error:
Does anyone know what might cause this issue?
Is it related to asyncio task handling or how the credential request is being awaited inside
LoopAgent?Any tips on debugging or properly integrating
adk_request_credentialin an async multi-agent setup would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions