Skip to content

Feat: Cleanup and Generalize determineAgentForResumption for LRO Session Resumption Routing#490

Merged
kalenkevich merged 4 commits into
google:mainfrom
AmaadMartin:feat/lro-session-resumption-routing
Jul 15, 2026
Merged

Feat: Cleanup and Generalize determineAgentForResumption for LRO Session Resumption Routing#490
kalenkevich merged 4 commits into
google:mainfrom
AmaadMartin:feat/lro-session-resumption-routing

Conversation

@AmaadMartin

@AmaadMartin AmaadMartin commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

  1. Link to an existing issue (if applicable):

  2. Or, if no issue exists, describe the change:

Problem: In adk-js, when a session resumes after a long-running tool invocation or Long Running Operation (LRO) completion across session boundaries, determineAgentForResumption needed cleanup and generalization to properly route execution back to the initiating sub-agent. Furthermore, adk-js lacked architectural parity with adk-python's ResumabilityConfig guarding, and had brittle assumptions where unresolved agent authors from a function response immediately defaulted to rootAgent without falling through to the transferable LLM agent scan.

Solution:

  • Introduced ResumabilityConfig (core/src/apps/resumability_config.ts) and integrated it into RunnerConfig and Runner to align with Python's reference architecture (runners.py).
  • Extracted and generalized function call resumption matching helpers (findMatchingFunctionCall and findEventByFunctionCallId) in core/src/agents/functions.ts, and standalone resumption utilities (determineAgentForResumption and isRoutableLlmAgent) in core/src/runner/runner.ts.
  • Enhanced determineAgentForResumption to check resumabilityConfig.isResumable when matching past function responses, and cleanly fall through to Case 2 (isRoutableLlmAgent scan) with a descriptive warning if the author is no longer found in rootAgent.

Testing Plan

Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Manual End-to-End (E2E) Tests:
Please provide instructions on how to manually test your changes, including any necessary setup or configuration.
Run the local end-to-end verification test verifying multi-agent LRO resumption routing across serialized session boundaries without mocks:
npx vitest run tests/e2e/routing/lro_resumption_routing_e2e_test.ts

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

kalenkevich added a commit to AmaadMartin/adk-js that referenced this pull request Jul 15, 2026
Comment thread core/src/apps/resumability_config.ts Outdated
@kalenkevich
kalenkevich force-pushed the feat/lro-session-resumption-routing branch from e86c4aa to 632fe1c Compare July 15, 2026 21:22
…econd timestamp collisions during fast in-memory integration tests
@kalenkevich
kalenkevich merged commit f72dcbc into google:main Jul 15, 2026
12 of 15 checks passed
@kalenkevich kalenkevich mentioned this pull request Jul 15, 2026
kalenkevich added a commit that referenced this pull request Jul 15, 2026
@kalenkevich kalenkevich mentioned this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants