Skip to content

fix: replace deprecated gemini-2.0-flash-001 model with gemini-2.5-flash#625

Open
rogerpasky wants to merge 1 commit into
a2aproject:mainfrom
rogerpasky:fix/update-deprecated-gemini-model
Open

fix: replace deprecated gemini-2.0-flash-001 model with gemini-2.5-flash#625
rogerpasky wants to merge 1 commit into
a2aproject:mainfrom
rogerpasky:fix/update-deprecated-gemini-model

Conversation

@rogerpasky

Copy link
Copy Markdown

Problem

The model gemini-2.0-flash-001 used by the multiagent host agent has been deprecated and returns a 404 NOT_FOUND error:

This model models/gemini-2.0-flash-001 is no longer available.
Please update your code to use a newer model for the latest features and improvements.

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_threadsafe submits a coroutine via run_coroutine_threadsafe and never retrieves the future's result.

Fix

  1. Updated the default model from gemini-2.0-flash-001 to gemini-2.5-flash in samples/python/hosts/multiagent/host_agent.py
  2. Added error handling in demo/ui/service/server/adk_host_manager.py so that when the LLM call fails, the error is:
    • Logged to stdout
    • Returned as a visible error message in the conversation
    • The message is removed from the pending queue (preventing permanent stuck state)

Testing

Verified end-to-end: the demo UI now responds correctly to user messages after the fix.

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

Copy link
Copy Markdown
Contributor

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 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.

Comment on lines +205 to +206
except Exception as e:
print(f'Error processing message: {e}')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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
@rogerpasky rogerpasky force-pushed the fix/update-deprecated-gemini-model branch from e7694df to 5b5f52e Compare June 25, 2026 14:45
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.

1 participant