Skip to content

OIDC auth flow gets stuck if auth request is triggered by subagent #7182

Closed

Description

@aseelmannfuzzy

🔴 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

Describe the Bug:
We are currently experiencing problems when using the recommended OIDC auth flow (via Keycloak) for toolsets. The issue arises of the auth request is triggered by a tool call associated to a subagent (and not the root agent). This affects both the ADK Web UI as well as the ADK API server. For the former, the auth pop-up never shows up in such a case (instead, only a text box to enter a code manually is shown). By contrast, if the auth request is triggered by a tool call associated to the root agent, everything works as expected. Also, the issue arises with the current version 2.9.1 of ADK, but has also been observed with the earlier version 2.8.0.

Steps to Reproduce:

  1. Set up a root agent with a subagent, where the latter has a tool requiring auth with an OIDC flow
  2. Prompt the agent to make the subagent issue a tool call, triggering the auth request
  3. Observe that the auth is never resolved; in case of the ADK Web UI, the corresponding pop-up is never triggered but only shows a text box to enter a code
  4. The logs make absolutely no notice of this event

Expected Behavior:
Subagents should be treated in an equivalent manner as root agents when it comes to auth requests, resolving the auth flow as expected.

Observed Behavior:
In the case the auth request is triggered by a subagent, the auth flow gets stuck and is never resolved. In case of the ADK Web UI, the corresponding pop-up is never triggered.

Environment Details:

  • ADK Library Version (pip show google-adk): 2.9.1 (but also observed with 2.8.0)
  • Desktop OS:** Ubuntu 24.04.5 LTS inside WSL on Windows 11
  • Python Version (python -V): 3.13.13

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-3.7-flash via Vertex AI

🟡 Optional Information

Providing this information greatly speeds up the resolution process.

Regression:
Tested and confirmed with both 2.8.0 and 2.9.1, no information available about earlier versions.

Logs:
As mentioned above, the logs make absolutely no notice of the stuck auth flow. They are entirely inconclusive.

Screenshots / Video:
N/A

Additional Context:
N/A

Minimal Reproduction Code:
N/A

How often has this issue occurred?:
The problem is 100% reproducible with the described flow.

Activity

  1. Junyi-Zheng commented on Sep 19, 2026

    @Junyi-Zheng

    I found a related issue where authentication responses are routed to the root agent instead of the requesting sub-agent when disallow_transfer_to_parent=True. I’ve implemented a focused fix and verified it with regression tests across Python 3.10–3.14. Would a PR addressing this routing behavior be welcome?

  2. added
    agent engine[Component] This issue is related to Vertex AI Agent Engine
    on Sep 21, 2026
  3. aseelmannfuzzy commented on Sep 21, 2026

    @aseelmannfuzzy
    Author

    Update: The specific problem described here might actually be related to a blocked pop-up due to a timed-out Transient User Activation, caused by the transfer to the subagent. After whitelisting the OIDC issuer explicitly, the problem disappeared.

    Nevertheless, this was easily missed since this was nowhere reflected in the logs or shown error messages. While this probably has to be handled by the UI frontend and can therefore not be resolved in case of the ADK API server directly, the ADK Web UI should handle this more gracefully.

  4. surajksharma07 commented on Sep 21, 2026

    @surajksharma07
    Collaborator

    @aseelmannfuzzy Good to hear whitelisting the OIDC issuer got the pop-up working. You're right that it's hard to spot since "Popup blocked!" only shows up in the browser console and not in the UI or server logs, worth flagging for ADK Web.

    If the API server case still gets stuck could you share whether the sub-agent has disallow_transfer_to_parent=True and whether resumability is enabled? In a local test on 2.9.2 the auth response went to the root agent in that setup which looks like what #7203 is addressing.

    As a workaround try setting disallow_transfer_to_parent=False on the sub-agent or turning on resumability and let us know if it resolves it on your side. Please test it thoroughly before raising any PR.

  5. Maniii97 commented on Sep 22, 2026

    @Maniii97

    Here is what seems to be going wrong and why.

    What is happening
    The investigation identifies that auth events from subagents have event.author set to the subagent's name (not root agent), and node_info.path is only set when event.author == self.name. However, the chain cannot be traced to a proven root cause because the critical link - how the UI uses this metadata to determine auth interface - requires inspection of UI code not available in this codebase.

    1. Why does the OIDC auth flow get stuck when triggered by a subagent?
      The ADK Web UI shows a text box for manual code entry instead of opening the OIDC authorization URL pop-up.
      Evidence: Issue OIDC auth flow gets stuck if auth request is triggered by subagent #7182: "the auth pop-up never shows up in such a case (instead, only a text box to enter a code manually is shown)"
    2. Why might subagent auth events be handled differently by the UI?
      Auth events from subagents have event.author set to the subagent's name, not the root agent's name.
      _Evidence: _functions.py:167 shows author=author or require_agent_name(invocation_context) which returns agent.name
    3. Why does event.author being the subagent's name potentially affect UI handling? (unproven — evidence ends here)
      The UI may use event metadata like author or node_info.path to determine auth handling, but this cannot be verified without UI code access.
      Evidence: Inference from symptom pattern, but UI handling logic is not in accessible codebase

    Not confirmed: The investigation reaches an unproven link about UI behavior that requires access to UI code not available in this codebase. The deepest proven cause (auth events have author=subagent.name) is not a root cause but a description of current behavior. A true root cause explaining why the UI shows text box instead of pop-up would require inspection of UI code to understand how auth event metadata influences interface selection.

    This is a starting point, not a final answer. Please check it against the actual code and behaviour before relying on it.

    I put this together with Operate (https://operatex.dev), an AI tool that reads the code and traces the likely cause, and reviewed it before posting.

    Case Link : https://operatex.dev/open-source/github/google/adk-python/issues/7182

  6. aseelmannfuzzy commented on Sep 22, 2026

    @aseelmannfuzzy
    Author

    @aseelmannfuzzy Good to hear whitelisting the OIDC issuer got the pop-up working. You're right that it's hard to spot since "Popup blocked!" only shows up in the browser console and not in the UI or server logs, worth flagging for ADK Web.

    If the API server case still gets stuck could you share whether the sub-agent has disallow_transfer_to_parent=True and whether resumability is enabled? In a local test on 2.9.2 the auth response went to the root agent in that setup which looks like what #7203 is addressing.

    As a workaround try setting disallow_transfer_to_parent=False on the sub-agent or turning on resumability and let us know if it resolves it on your side. Please test it thoroughly before raising any PR.

    We are already working with disallow_transfer_to_parent=False (almost exclusively), and until now use only plain agent declarations (so, only root_agent, no app, and therefore no resumability_config).

    Nevertheless, I quickly checked and wrapped the agent in an app with a resumability config, following https://adk.dev/runtime/resume/, but this didn't help either.

  7. surajksharma07 commented on Sep 24, 2026

    @surajksharma07
    Collaborator

    With disallow_transfer_to_parent=False and a plain root_agent the backend side works @aseelmannfuzzy. Ran a root -> sub-agent setup with a mock model (a plain tool and an OAuth2 toolset) on 2.9.1, 2.9.2 and current main and in every case the credential response went back to the sub-agent and the tool resumed. So #7203 which only covers disallow_transfer_to_parent=True isn't what you're running into.

    One catch with the resumability test: on 2.9.1/2.9.2 toolset auth on a sub-agent inside a resumable App fails when the credential comes back with "ValueError: Agent '<sub_agent>' cannot transfer to itself". That's fixed on main by 2c61b84 (#7077) but isn't in a release yet so leave resumability_config out for now.

    That leaves the silent blocked pop-up in ADK Web. The generic OAuth path only logs "Popup blocked!" to the browser console while the Agent Identity path already shows a snackbar so flagging that for the web UI.

    If the API server still gets stuck on your side could you share the adk_request_credential event and the function_response your client sends back (same call id, updated authConfig)? That would show where it stops.

  8. aseelmannfuzzy commented on Sep 25, 2026

    @aseelmannfuzzy
    Author

    With disallow_transfer_to_parent=False and a plain root_agent the backend side works @aseelmannfuzzy. Ran a root -> sub-agent setup with a mock model (a plain tool and an OAuth2 toolset) on 2.9.1, 2.9.2 and current main and in every case the credential response went back to the sub-agent and the tool resumed. So #7203 which only covers disallow_transfer_to_parent=True isn't what you're running into.

    One catch with the resumability test: on 2.9.1/2.9.2 toolset auth on a sub-agent inside a resumable App fails when the credential comes back with "ValueError: Agent '<sub_agent>' cannot transfer to itself". That's fixed on main by 2c61b84 (#7077) but isn't in a release yet so leave resumability_config out for now.

    That leaves the silent blocked pop-up in ADK Web. The generic OAuth path only logs "Popup blocked!" to the browser console while the Agent Identity path already shows a snackbar so flagging that for the web UI.

    If the API server still gets stuck on your side could you share the adk_request_credential event and the function_response your client sends back (same call id, updated authConfig)? That would show where it stops.

    I think the API server itself is not stuck. The last event in the stream is the one directly after the adk_request_credential, carrying the response "response": {"message": "Needs your authorization to access your data.", "pending": true}
    Our UI most likely suffers then from the same as the ADK Web UI: The popup is silently blocked and the auth process is interrupted. We never get to the point of sending the request to the OIDC client in the first place.

  9. surajksharma07 commented on Sep 28, 2026

    @surajksharma07
    Collaborator

    That lines up with what I see @aseelmannfuzzy. The {"pending": true, "message": "Needs your authorization to access your data."} response is RestApiTool pausing on purpose right after it emits adk_request_credential so the API server has done its part and the run is just waiting for your client to send the credential back.

    The pop-up gets blocked because it's opened from the event stream handler and not from a click and the browser's transient user activation only lasts a few seconds. The extra transfer_to_agent model turn is usually what pushes it past that window which is why you only hit it with sub-agents.

    As a workaround in your UI render a "Sign in" button when the adk_request_credential event arrives and call window.open from its click handler (and fall back to a full redirect if window.open returns null). Please give it a try on your side and test it thoroughly before raising any PR.

    ADK Web on 2.10.0 still only logs "Popup blocked!" to the console for the generic OAuth path so flagging that for the web UI. Also 2.10.0 now includes the "cannot transfer to itself" fix (#7077) in case you want to retry with resumability.

  10. DeanChensj commented on Oct 13, 2026

    @DeanChensj
    Collaborator

    Thanks everyone for working through this one, and especially @aseelmannfuzzy for reporting back once you found the cause on your side.

    Summarizing where things landed so we can close this out:

    • The symptom in this report (the OIDC pop-up never appearing when the auth request came from a sub-agent) turned out to be the browser blocking the pop-up after the transient user activation expired during the transfer to the sub-agent; whitelisting the OIDC issuer resolved it. You're right that this was far too easy to miss — "Popup blocked!" only shows in the browser console. That's a UI-side gap, and it belongs in the ADK Web repo rather than here; if you'd like, please open an issue there and link back to this one.
    • The backend routing edge case that came up during triage (a sub-agent with disallow_transfer_to_parent=True in a non-resumable app having its credential response routed to the root) was real, and it's now fixed on main by 86a47f6 and ea656b0. Thanks @Junyi-Zheng for digging into that path in fix: route authentication responses to requesting sub-agents #7203 — the fix that landed is smaller than the PR, but your analysis of where the routing went wrong was correct.

    If anyone still sees a sub-agent auth flow getting stuck on current main with the issuer whitelisted, please reopen with the sub-agent's disallow_transfer_to_parent / resumability settings and we'll pick it up right away.

  11. github-actions commented on Oct 13, 2026

    @github-actions

    Are you satisfied with the resolution of your issue?
    Yes
    No

  12. aseelmannfuzzy commented on Oct 16, 2026

    @aseelmannfuzzy
    Author

    Very good, thanks!

    But I wasn't aware that the ADK Web has it's own repo. Where can I find it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

agent engine[Component] This issue is related to Vertex AI Agent Enginerequest clarification[Status] The maintainer need clarification or more information from the author

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions