fix: replace deprecated gemini-2.0-flash-001 model with gemini-2.5-flash#625
fix: replace deprecated gemini-2.0-flash-001 model with gemini-2.5-flash#625rogerpasky wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces error handling when processing messages in adk_host_manager.py by wrapping the asynchronous runner loop in a try-except block and appending an error message to the conversation. It also updates the default model in host_agent.py to gemini/gemini-2.5-flash. The reviewer recommends replacing the generic print statement with proper logging using logging.exception to capture the full stack trace for better debugging.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| except Exception as e: | ||
| print(f'Error processing message: {e}') |
There was a problem hiding this comment.
Using print for error logging is discouraged in server applications. Since this block catches any generic Exception, logging the full stack trace using logging.exception is highly recommended to aid in debugging. Importing logging inline avoids modifying the file's import section outside of the diff hunk.
except Exception as e:
import logging
logging.exception('Error processing message')The model gemini-2.0-flash-001 is no longer available (returns 404). This causes the host agent in the demo UI to silently fail when processing messages, leaving conversations permanently stuck in 'pending' state with no response. Changes: - Update default model from gemini-2.0-flash-001 to gemini-2.5-flash in multiagent host_agent.py - Add error handling in adk_host_manager.py so LLM errors are surfaced to the user instead of being silently swallowed
e7694df to
5b5f52e
Compare
Problem
The model
gemini-2.0-flash-001used by the multiagent host agent has been deprecated and returns a404 NOT_FOUNDerror:This causes the demo UI to appear completely unresponsive — messages are sent but the agent never replies. The error is silently swallowed because
process_message_threadsafesubmits a coroutine viarun_coroutine_threadsafeand never retrieves the future's result.Fix
gemini-2.0-flash-001togemini-2.5-flashinsamples/python/hosts/multiagent/host_agent.pydemo/ui/service/server/adk_host_manager.pyso that when the LLM call fails, the error is:Testing
Verified end-to-end: the demo UI now responds correctly to user messages after the fix.