You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: include handoffs when deciding to inject JSON
prompt
The JSON prompt injection was only triggered when tools list was non-empty,
but handoffs are converted to function tools and added separately. This meant
that agents using only handoffs with output_schema would not get the prompt
injection even when enable_structured_output_with_tools=True, causing Gemini
to error with 'Function calling with response mime type application/json is
unsupported.'
Changes:
- Combine tools and handoffs before checking if JSON prompt should be injected
- Add test case for handoffs-only scenario
- Update inline comment to clarify why handoffs must be included
This ensures the opt-in flag works correctly for multi-agent scenarios where
an agent might use handoffs without regular tools.
0 commit comments