Skip to content

fix(adk): Python agents HITL resume and align memory API - #2751

Merged
EItanya merged 2 commits into
kagent-dev:release/v0.10.xfrom
supreme-gg-gg:fix/hitl-v0.10
Sep 8, 2026
Merged

EItanya merged 2 commits into
kagent-dev:release/v0.10.xfrom
supreme-gg-gg:fix/hitl-v0.10

Conversation

@supreme-gg-gg

@supreme-gg-gg supreme-gg-gg commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2731

Google ADK 1.38 (bumped in #2558) validates that dynamically confirmed tools recorded their confirmation request in session history. The Python executor stopped before that event was persisted, causing every ask_user response and tool approval to fail on resume.

This change preserves the confirmation response before pausing, and also updates the memory service to the current Google ADK interface.

This change is only applicable to release/v0.10.x branch. main already uses upstream executor which handles HITL pause properly. This also does not affect Go agents, since go-adk does not have the above validation

Copilot AI lite review requested due to automatic review settings September 8, 2026 19:03
@supreme-gg-gg
supreme-gg-gg requested a review from a team as a code owner September 8, 2026 19:03
Signed-off-by: Jet Chiang <[email protected]>
Signed-off-by: Jet Chiang <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The executor pause/resume fix is covered by a focused regression test and the memory interface updates are validated with unit tests and limited call-site surface area.

Pull request overview

This PR fixes Human-in-the-Loop (HITL) pause/resume for Python agents on release/v0.10.x by ensuring the ADK confirmation lifecycle is persisted correctly before pausing, and updates Kagent’s memory integration to match the current Google ADK memory service interface.

Changes:

  • Adjust A2aAgentExecutor run-loop to stop after the ADK confirmation tool response is persisted, preventing resume-time validation failures in ADK 1.38.
  • Update KagentMemoryService.add_memory and SaveMemoryTool to use ADK MemoryEntry objects and shared custom_metadata.
  • Add unit tests covering both the HITL pause/resume flow (via real ADK runner + serialized session reload) and the updated memory tool/service interface.
File summaries
File Description
python/packages/kagent-adk/src/kagent/adk/_agent_executor.py Ensures confirmation tool responses are persisted before pausing so HITL resume works with ADK 1.38 validation.
python/packages/kagent-adk/src/kagent/adk/_memory_service.py Aligns memory service API to accept ADK MemoryEntry sequences and shared metadata, generating embeddings in batch.
python/packages/kagent-adk/src/kagent/adk/tools/memory_tools.py Updates SaveMemoryTool to call the new add_memory(..., memories=[MemoryEntry(...)]) interface.
python/packages/kagent-adk/src/kagent/adk/models/_bedrock.py Import ordering cleanup.
python/packages/kagent-adk/tests/unittests/test_hitl_resume.py New regression test that exercises HITL pause/resume across session serialization boundaries.
python/packages/kagent-adk/tests/unittests/test_memory_tools.py New tests validating metadata merge semantics and error propagation for the updated memory interface.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 8, 2026
@EItanya
EItanya merged commit a3d26ea into kagent-dev:release/v0.10.x Sep 8, 2026
33 checks passed
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
kagent 0.10.1

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre><!-- Release notes generated using configuration in .github/release.yml at v0.10.1 -->

## What's Changed
### Features
* feat(adk): support responses API for Python ADK agents by @onematchfox in kagent-dev/kagent#2679
### Bug Fixes
* fix(adk): preserve A2A user identity before task resolution by @erauner12 in kagent-dev/kagent#2483
* fix(adk): Python agents HITL resume and align memory API by @supreme-gg-gg in kagent-dev/kagent#2751
### Other Changes
* ci: run workflows on Blacksmith runners (backport to release/v0.10.x) by @Charlesthebird in kagent-dev/kagent#2712


**Full Changelog**: https://github.com/kagent-dev/kagent/compare/v0.10.0...v0.10.1</pre>
  <p>View the full release notes at <a href="https://github.com/kagent-dev/kagent/releases/tag/v0.10.1">https://github.com/kagent-dev/kagent/releases/tag/v0.10.1</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!18719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants