Skip to content

fix: add streaming_run_with_events handler for Gemini Enterprise integration#771

Closed
anishesg wants to merge 1 commit into
google:mainfrom
proudhare:fix/ph-issue-770
Closed

fix: add streaming_run_with_events handler for Gemini Enterprise integration#771
anishesg wants to merge 1 commit into
google:mainfrom
proudhare:fix/ph-issue-770

Conversation

@anishesg
Copy link
Copy Markdown
Contributor

Link to Issue or Description of Change

Closes: #770

Problem: Agents deployed to Vertex AI Agent Engine work in the Playground (which calls /api/stream_reasoning_engine with class_method: async_stream_query), but fail when integrated into Gemini Enterprise. Gemini Enterprise sends requests with class_method: streaming_agent_run_with_events, which was not registered in listStreamHandlers in server/agentengine/handler.go. This caused handleQuery in the controller to return "unrecognized class method: streaming_agent_run_with_events".

Solution: Registered a second streamQueryHandler instance for the streaming_agent_run_with_events method name with api_mode: "stream" in listStreamHandlers. The existing streamQueryHandler is fully parameterized by method name and already handles the streaming logic correctly — it just needed to be registered under the additional method name that Gemini Enterprise uses. This mirrors the pattern in the adk-python CLI deploy logic (see cli_deploy.py line 390).

Testing Plan

Unit Tests

  • Added or updated unit tests
  • All unit tests pass locally

Manual E2E Tests

  1. Deploy an adk-go agent to Vertex AI Agent Engine.
  2. Integrate the agent into Gemini Enterprise.
  3. Submit a query and confirm no "unrecognized class method" error in the logs.
  4. Verify the agent responds correctly in Gemini Enterprise.

Local build verification: go build ./server/agentengine/... passes without errors.

Checklist

  • Read CONTRIBUTING.md
  • Self-review completed
  • Code commented (especially complex areas)
  • Tests added and passing
  • Manual E2E testing completed
  • Dependent changes merged/published

Fixes #770

### Link to Issue or Description of Change

Signed-off-by: anish k <ak8686@princeton.edu>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new stream query handler, streaming_agent_run_with_events, to the listStreamHandlers function in server/agentengine/handler.go. I have no feedback to provide.

@kdroste-google kdroste-google self-requested a review April 30, 2026 11:13
@kdroste-google
Copy link
Copy Markdown
Collaborator

This solution won't work, sorry.
#777 is addressing the same issue - your comments are more than welcome!
I'm closing this PR
Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemini Enterprise integration fails with "unrecognized class method: streaming_agent_run_with_events"

2 participants