Files
awesome-llm-apps/advanced_ai_agents
awesomekoder 62c52a6b63 fix: resolve google_search tool and artifact loading issues in home renovation agent
Fixes #409

## Changes

### agent.py
- Replace singleton `google_search` with explicit `GoogleSearchTool(bypass_multi_tools_limit=True)`
  to enable compatibility with nested agent setups (ADK limitation workaround)
- Update SearchAgent instruction to be clearer about how the built-in search works
  (it's automatic, not a callable function)

### tools.py
- Add validation for common LLM hallucination patterns (e.g., `_v0` version numbers)
- Add fallback logic when artifact loading fails:
  1. Try corrected filename if version 0 detected
  2. Look up known artifact versions in session state
  3. Fall back to last generated rendering
- Improve error messages to show available artifacts

## Root Cause Analysis

1. **google_search not found**: The LLM was trying to call 'google_search' as a
   function, but GoogleSearchTool is a Gemini built-in capability that works
   automatically. Using `bypass_multi_tools_limit=True` and clearer instructions
   resolves the confusion.

2. **Artifact not found**: The LLM sometimes hallucinated incorrect filenames
   (e.g., `_v0.png` instead of `_v1.png`). Added robust fallback logic to
   recover gracefully.
2026-01-31 20:24:35 -08:00
..