feat: agent callback updates and mission spec skill_id support#57
feat: agent callback updates and mission spec skill_id support#57jeremylongshore merged 2 commits intomainfrom
Conversation
Update auto_save_session_to_memory callback across all IAM agents: - Support both old (ctx) and new (callback_context) API - Handle invocation_context vs _invocation_context attribute - Add graceful fallback when no context provided Affected agents: bob, iam-adk, iam-cleanup, iam-doc, iam-fix-impl, iam-fix-plan, iam-index, iam-issue, iam-qa, iam-senior-adk-devops-lead Co-Authored-By: Claude <noreply@anthropic.com>
- Add optional skill_id field to WorkflowStep schema - Update compiler to pass skill_id when invoking agents - Enhance runner with skill_id parameter handling - Update sample mission YAML with skill_id examples This allows missions to specify exactly which skill to invoke rather than relying on agent defaults. Co-Authored-By: Claude <noreply@anthropic.com>
Summary of ChangesHello @jeremylongshore, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant improvements to agent callback handling and mission specification. It ensures that agent callbacks, specifically for session saving, are robust against changes in the ADK API by supporting multiple context signatures. Concurrently, the Mission Spec has been enhanced to provide more precise control over agent execution by enabling direct specification of the skill to be invoked for each workflow step, moving beyond implicit skill resolution. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces two main features: backward compatibility for agent callbacks and support for an explicit skill_id in mission specs. The changes for skill_id look good, though there's a minor improvement opportunity in exception handling. However, there is a critical copy-paste bug across 9 of the 10 updated agent files in the auto_save_session_to_memory callback. The logic to save the session is only implemented for the old callback signature, causing it to fail with the new API. I've left detailed comments with suggestions to fix this widespread issue.
| except Exception: | ||
| skill_id = f"{agent.replace('-', '_')}.execute" # Fallback on error |
There was a problem hiding this comment.
The except Exception: block is too broad and silently falls back to the default skill_id. This can hide underlying issues, such as a missing AgentCard file or a malformed one. It's better to catch specific exceptions or at least log the exception that occurred to aid in debugging.
| except Exception: | |
| skill_id = f"{agent.replace('-', '_')}.execute" # Fallback on error | |
| except Exception as e: | |
| logger.warning(f"Could not determine primary skill for agent '{agent}' from its AgentCard: {e}. Falling back to default skill pattern.") | |
| skill_id = f"{agent.replace('-', '_')}.execute" # Fallback on error |
Summary
auto_save_session_to_memoryacross all 10 IAM agents to support both old and new ADK callback API signaturesskill_idfield to workflow steps for explicit skill invocationChanges
Agent Callback Updates
ctx(old) andcallback_context(new) APIinvocation_contextvs_invocation_contextattribute accessMission Spec Enhancement
skill_idfield inWorkflowStepschemaTest Plan
make test🤖 Generated with Claude Code