Bug Report
Description
LoadSkillTool.run_async crashes with TypeError: 'NoneType' object is not iterable after a session rewind when the skills feature is enabled.
Steps to Reproduce
- Enable the
SKILL_TOOLSET experimental feature
- Run an agent session that activates a skill (populating
_adk_activated_skill_{agent_name} in state)
- Rewind the session to a point before the skill was activated
- Continue the session and trigger a
load_skill tool call
Root Cause
Runner._compute_state_delta_for_rewind (runners.py:716) sets state keys to None to mark them for deletion when they were added after the rewind point:
# runners.py:715-716
if key not in state_at_rewind_point:
rewind_state_delta[key] = None
This sets _adk_activated_skill_{agent_name} to None. Later, LoadSkillTool.run_async does:
# skill_toolset.py:155
activated_skills = list(tool_context.state.get(state_key, []))
Since the key exists with value None, dict.get() returns None (not the default []), and list(None) raises TypeError.
Stack Trace
File ".../google/adk/tools/skill_toolset.py", line 155, in run_async
activated_skills = list(tool_context.state.get(state_key, []))
TypeError: 'NoneType' object is not iterable
Suggested Fix
# skill_toolset.py:155
activated_skills = list(tool_context.state.get(state_key) or [])
This handles both missing keys and explicit None values. The same pattern should be applied to _resolve_additional_tools_from_state (line 742) for consistency, even though it currently doesn't crash due to the if not activated_skills guard on line 744.
Version
google-adk 1.3.0
Bug Report
Description
LoadSkillTool.run_asynccrashes withTypeError: 'NoneType' object is not iterableafter a session rewind when the skills feature is enabled.Steps to Reproduce
SKILL_TOOLSETexperimental feature_adk_activated_skill_{agent_name}in state)load_skilltool callRoot Cause
Runner._compute_state_delta_for_rewind(runners.py:716) sets state keys toNoneto mark them for deletion when they were added after the rewind point:This sets
_adk_activated_skill_{agent_name}toNone. Later,LoadSkillTool.run_asyncdoes:Since the key exists with value
None,dict.get()returnsNone(not the default[]), andlist(None)raisesTypeError.Stack Trace
Suggested Fix
This handles both missing keys and explicit
Nonevalues. The same pattern should be applied to_resolve_additional_tools_from_state(line 742) for consistency, even though it currently doesn't crash due to theif not activated_skillsguard on line 744.Version
google-adk 1.3.0