fix(adk): Gracefully handle invalid tool calls - #16
google-labs-jules[bot] wants to merge 5 commits into
Conversation
Adds the 'gen_ai.conversation.id' attribute to OpenTelemetry spans for LLM calls. This helps link conversation messages together in AI Evals platforms by using the existing session ID. This change is additive and does not remove the existing 'gcp.vertex.agent.session_id' attribute.
…n-id-8998566208331097961 Include gen_ai.conversation.id in OTEL spans
When an LLM calls a tool that is not registered with the current agent, the ADK crashes with a nil pointer dereference instead of gracefully handling the error. The `loopagent` accesses `event.Actions.Escalate` without checking if `event` is nil after an error is returned. This commit fixes the nil pointer dereference in the loopagent by adding a check to ensure `event` is not `nil` before accessing its properties. A new test case has also been added to reproduce the panic and verify the fix.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Removed genAiConversationID from telemetry attributes.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit fixes a nil pointer dereference in the loopagent that occurred when an LLM called a tool that was not registered with the current agent. The agent now gracefully handles the error and continues execution instead of crashing.
PR created automatically by Jules for task 14383741135971560686 started by @sheing-google