You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by we...@apache.org on 2026/10/22 05:56:45 UTC

(flink-agents) branch main updated: [runtime] Support subgraph execution on the non-coroutine parallel engine (#1299)

This is an automated email from the ASF dual-hosted git repository.

wenjin272 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git


The following commit(s) were added to refs/heads/main by this push:
     new 9e54e0df3 [runtime] Support subgraph execution on the non-coroutine parallel engine (#1299)
9e54e0df3 is described below

commit 9e54e0df317a5e7bd494a3a37f67a03935f8d26b
Author: Gen Luo <86...@users.noreply.github.com>
AuthorDate: Thu Oct 22 13:56:39 2026 +0800

    [runtime] Support subgraph execution on the non-coroutine parallel engine (#1299)
    
    Generated-by: Qoder 0.4.8
    Co-Authored-By: Qoder <no...@qoder.com>
---
 docs/content/docs/development/calling-llms/chat.md |  11 +-
 .../docs/development/calling-llms/model_routing.md |   2 +-
 .../docs/development/multi-agent/subagents.md      |  22 +-
 docs/content/docs/operations/configuration.md      |   4 +-
 .../test/PythonResourceWorkerLifetimeScenario.java |   3 -
 .../internal_subagent_test.py                      |  56 +-
 python/flink_agents/runtime/base_subagent.py       |  28 +-
 python/flink_agents/runtime/chat_future.py         |   7 +-
 .../flink_agents/runtime/flink_runner_context.py   |  82 ++-
 python/flink_agents/runtime/internal_subagent.py   | 210 +++++--
 python/flink_agents/runtime/subagent_handles.py    |  67 ++-
 .../runtime/task_lifecycle_listener.py             |  53 +-
 .../runtime/tests/test_base_subagent.py            | 135 ++++-
 .../flink_agents/runtime/tests/test_chat_call.py   |  16 +-
 .../runtime/tests/test_flink_runner_context.py     |  55 +-
 .../runtime/tests/test_internal_subagent.py        | 353 ++++++++++++
 .../tests/test_internal_subagent_descriptor.py     |  16 +-
 .../runtime/tests/test_task_lifecycle_bridge.py    | 273 ++++++++-
 .../runtime/async/AsyncExecutorThreadFactory.java  |  17 +-
 .../runtime/async/ContinuationActionExecutor.java  |  83 ++-
 .../runtime/async/ContinuationNativeCallable.java  |   2 +-
 .../flink/agents/runtime/chat/ChatCallManager.java | 123 ----
 .../flink/agents/runtime/chat/ChatCallOwner.java   |  67 ---
 .../flink/agents/runtime/chat/ChatContext.java     |  50 --
 .../agents/runtime/chat/ChatDurableFuture.java     |  54 ++
 .../flink/agents/runtime/chat/ChatInvocation.java  |  74 ---
 .../runtime/chat/ChatSubgraphDefinition.java       |  82 ++-
 .../agents/runtime/context/ChatDurableFuture.java  |  70 ---
 .../runtime/context/JavaRunnerContextImpl.java     |   3 +-
 .../agents/runtime/context/RunnerContextImpl.java  | 200 +++++--
 .../lifecycle/ComponentExecutionListener.java      |   5 +-
 .../runtime/lifecycle/TaskLifecycleListener.java   |  57 +-
 .../flink/agents/runtime/memory/MemoryScope.java   |  51 ++
 .../runtime/operator/ActionExecutionOperator.java  | 501 ++++++++++++----
 .../runtime/operator/ActionTaskContextManager.java | 107 +++-
 .../parallel/ActionTaskLifecycleException.java     |  61 ++
 ...java => ParallelExecutionContextLifecycle.java} |  17 +-
 .../parallel/ParallelExecutionCoordinator.java     | 230 +++++++-
 .../operator/parallel/ParallelExecutionLock.java   |   4 +-
 .../operator/parallel/ParallelExecutionTask.java   |   7 +-
 .../operator/parallel/UncapturableException.java   |  56 ++
 .../agents/runtime/subagent/BaseSubagentSetup.java |  50 +-
 .../runtime/subagent/DeferredSubagentFuture.java   |  14 +-
 .../subagent/InternalSubagentDefinition.java       | 109 ++++
 ...gentFuture.java => InternalSubagentFuture.java} | 103 ++--
 .../subagent/InternalSubagentInvocation.java       |  73 +--
 .../runtime/subagent/InternalSubagentSetup.java    | 239 ++------
 .../PhasedSubagentFuture.java}                     |  17 +-
 .../runtime/subagent/SubagentFutureGroup.java      |  48 +-
 .../runtime/subgraph/SubgraphCallManager.java      |   5 +-
 .../runtime/subgraph/SubgraphDefinition.java       |  50 +-
 .../agents/runtime/subgraph/SubgraphEvent.java     |   9 +-
 .../agents/runtime/subgraph/SubgraphExecution.java | 226 ++++++++
 .../runtime/subgraph/SubgraphInvocation.java       |  83 ++-
 .../runtime/utils/DeterministicIdAllocator.java    |  24 +-
 .../IdAllocatorSource.java}                        |  18 +-
 .../runtime/async/ContinuationActionExecutor.java  |  14 +-
 .../async/ContinuationActionExecutorTest.java      | 501 +++++++++++++---
 .../agents/runtime/chat/ChatCallDeadlockTest.java  | 190 ++++++
 .../agents/runtime/chat/ChatCallOwnerTest.java     |  45 --
 .../ChatCallTest.java}                             | 223 +++----
 .../{context => chat}/ChatDurableFutureTest.java   | 105 ++--
 .../runtime/chat/ChatSubgraphDefinitionTest.java   |  14 +-
 .../JavaRunnerContextImplAsyncExecutionTest.java   |  16 +-
 .../runtime/context/PythonBridgeContractTest.java  | 137 +++++
 .../RunnerContextImplDurableExecuteTest.java       |  84 +++
 .../RunnerContextImplExecutionReporterTest.java    |  10 +-
 .../RunnerContextPendingEventsContractTest.java    |  12 +-
 .../context/TestMemoryObservationFlush.java        |   4 +
 .../TaskLifecycleListenerNotificationTest.java     | 250 ++++++--
 .../metrics/BuiltInExecutionMetricsTest.java       |   1 +
 ...onExecutionOperatorCapacityIntegrationTest.java |  71 ++-
 ...cutionOperatorDrainDeadlockIntegrationTest.java | 341 +++++++----
 .../operator/ActionExecutionOperatorTest.java      | 101 +++-
 .../operator/ActionTaskContextManagerTest.java     | 122 +++-
 .../agents/runtime/operator/ChatCallTest.java      |  13 +-
 .../runtime/operator/JavaActionTaskTest.java       |   1 +
 .../agents/runtime/operator/SubgraphCallTest.java  |  11 +-
 .../operator/SubgraphParallelExecutionTest.java    | 641 +++++++++++++++++++++
 .../operator/SubgraphParallelFailoverTest.java     | 281 +++++++++
 .../parallel/ParallelExecutionCoordinatorTest.java | 361 +++++++++++-
 .../ParallelExecutionPythonResourceTest.java       |   3 -
 .../runtime/subagent/BaseSubagentSetupTest.java    |  64 +-
 .../subagent/DeferredSubagentSubmitTest.java       |  28 +-
 .../subagent/InternalSubagentGuardTest.java        |   4 +-
 .../subagent/InternalSubagentMatchTest.java        |  17 +-
 .../SubagentFutureGroupMixedBatchTest.java         |  84 +++
 .../runtime/subgraph/RoutingOnlyDefinition.java    |  63 ++
 .../runtime/subgraph/SubgraphInvocationTest.java   |  46 +-
 .../utils/DeterministicIdAllocatorTest.java        |  44 ++
 90 files changed, 6456 insertions(+), 1828 deletions(-)

diff --git a/docs/content/docs/development/calling-llms/chat.md b/docs/content/docs/development/calling-llms/chat.md
index 102278405..e5659746f 100644
--- a/docs/content/docs/development/calling-llms/chat.md
+++ b/docs/content/docs/development/calling-llms/chat.md
@@ -222,9 +222,14 @@ tool timeouts apply; `ctx.chat` adds no whole-call timeout.
 <span id="java-runtime-requirements"></span>
 
 {{< hint warning >}}
-Java `ctx.chat` calls require JDK 21.
-Earlier JDK versions are not supported: awaiting the call throws before sending
-the request. Use [Chat Events](#chat-events) on those versions.
+A Java `ctx.chat` call needs a runtime that releases the operator while the chat
+graph runs: JDK 21+ with continuation-based execution, or the experimental
+parallel execution engine on JDK 11–20. With neither, awaiting the call throws
+before the request is sent; use [Chat Events](#chat-events) on those versions.
+See [JDK and Scheduling Requirements]({{< ref "docs/development/create-agent/actions#jdk-and-scheduling-requirements" >}})
+for the parallel engine's plan and configuration prerequisites. On that engine the
+waiting Action keeps its worker thread, so concurrent or nested chat calls can
+exhaust the worker pool.
 Python `ctx.chat` calls do not require JDK 21.
 A job that runs on JDK 21 also needs
 `--add-exports=java.base/jdk.internal.vm=ALL-UNNAMED` in `env.java.opts.all`,
diff --git a/docs/content/docs/development/calling-llms/model_routing.md b/docs/content/docs/development/calling-llms/model_routing.md
index c59efbc4f..d9a21eb60 100644
--- a/docs/content/docs/development/calling-llms/model_routing.md
+++ b/docs/content/docs/development/calling-llms/model_routing.md
@@ -252,7 +252,7 @@ ChatResult result = ctx.chat(
         .await();
 ```
 
-Use the result in the same Action. Java awaits require JDK 21 and the runtime
+Use the result in the same Action. Java awaits require the runtime
 configuration described in [Using ctx.chat]({{< ref "docs/development/calling-llms/chat#using-ctx-chat" >}}).
 {{< /tab >}}
 {{< /tabs >}}
diff --git a/docs/content/docs/development/multi-agent/subagents.md b/docs/content/docs/development/multi-agent/subagents.md
index b207ba9fa..4ddefef8b 100644
--- a/docs/content/docs/development/multi-agent/subagents.md
+++ b/docs/content/docs/development/multi-agent/subagents.md
@@ -1281,7 +1281,12 @@ If you supply your own IDs, keep them unchanged when the same call is retried.
 
 ### Result types after recovery
 
-Python persists result payloads with cloudpickle and restores their Python types.
+Python persists the result payload of an external sub-agent call with cloudpickle
+and restores its Python types. An internal call's result is recorded by the Java
+runtime as JSON, so a Python caller reads JSON values from it: map keys are
+strings, and nested containers and nulls decode as Python JSON values. Custom
+Python objects are not preserved, and the values are the same on the first
+execution and after recovery.
 Java persists them as JSON, so a custom object returned by `getResult()` can be
 restored as a map after recovery. Use `getResult(Class<T>)` to obtain the expected
 Java type on both the first execution and after recovery.
@@ -1324,9 +1329,18 @@ Trace Log selection does not affect metrics collection.
 - Create an internal child with the same Java or Python Agent API as its parent.
   An external setup and the action invoking it must use the same language;
   cross-language calls to external setups are not supported.
-- Calling an internal sub-agent from Java requires JDK 21+ with the Continuation
-  API available. This additional requirement does not apply to Python callers or
-  external sub-agents.
+- Calling an internal sub-agent from Java requires a runtime that releases the
+  operator while the child graph runs: JDK 21+ with the Continuation API, or the
+  experimental parallel execution engine on JDK 11–20. With neither, resolving the
+  call fails before the child starts. See
+  [JDK and Scheduling Requirements]({{< ref "docs/development/create-agent/actions#jdk-and-scheduling-requirements" >}}).
+  This additional requirement does not apply to Python callers or external
+  sub-agents.
+- On the parallel execution engine, every Action of an internal child must be a
+  Java Action, or the job fails when the operator opens. A caller that waits there
+  keeps its worker thread, so concurrent or nested internal calls can exhaust the
+  worker pool. See
+  [Runtime and async execution]({{< ref "docs/operations/configuration#runtime-and-async-execution" >}}).
 - There is no per-call sub-agent timeout setting.
 - For multiple model-driven calls, enabling `tool-call.async` with
   `async.batch.parallelism` above 1 allows external async tasks to overlap if the
diff --git a/docs/content/docs/operations/configuration.md b/docs/content/docs/operations/configuration.md
index 1fd208f5f..8d969236f 100644
--- a/docs/content/docs/operations/configuration.md
+++ b/docs/content/docs/operations/configuration.md
@@ -212,8 +212,8 @@ the built-in [parallel tool-call batches]({{< ref "docs/development/calling-llms
 | `async.batch.timeout.ms` | -1 (disabled) | long (milliseconds) | Overall timeout for one `ctx.gather(...)` batch, in milliseconds. Non-positive values disable it. A timeout does not guarantee that running calls stop and cannot undo their external effects. See [Tool Use]({{< ref "docs/development/calling-llms/tool_use#timeouts-and-external-effects" >}}) for built-in tool-batch behavior. |
 | `job-identifier` | none | String | Stable job identifier used to scope Mem0 long-term memory. Keep an explicit value unchanged across restores. If unset, the initial Flink JobID is stored in operator state and reused when restoring a checkpoint or savepoint. |
 | `max-in-flight-input-records` | 100 | int | Maximum input records in flight per Agent operator subtask on the experimental parallel engine. Must be positive. The limit is ignored by continuation-based execution and plans containing Python Actions. See [Execution Requirements]({{< ref "docs/development/create-agent/actions#execution-requirements" >}}). |
-| `num-async-threads` | os cpu count * 2 | int | Worker threads per async execution pool on each Agent operator subtask. Must be positive. `async.batch.parallelism` separately limits concurrency within each batch; see [Execution Requirements]({{< ref "docs/development/create-agent/actions#execution-requirements" >}}) for scheduling behavior. |
-| `parallel-execution.enabled` | true | boolean | **Experimental.** Enable the parallel engine for eligible plans with only Java Actions when continuation-based execution is unavailable. `false` selects serial execution. Ignored by the continuation engine and plans containing Python Actions. See [Execution Requirements]({{< ref "docs/development/create-agent/actions#execution-requirements" >}}) for JDK and Python Resource requirements. |
+| `num-async-threads` | os cpu count * 2 | int | Worker threads per async execution pool on each Agent operator subtask. Must be positive. On the experimental parallel engine the pool keeps one core worker and grows to the larger of 10 and twice this value, because a call that waits inline holds its worker while the work queued behind it draws from the same pool; exhausting that pool stalls the job until Flink's checkpoint timeout fails it. `async.batch.parallelism` separately limits con [...]
+| `parallel-execution.enabled` | true | boolean | **Experimental.** Enable the parallel engine for eligible plans with only Java Actions when continuation-based execution is unavailable. `false` selects serial execution. Ignored by the continuation engine and plans containing Python Actions. On JDK 11–20, Java `ctx.chat` and internal sub-agent calls need this engine, and an internal child with a non-Java Action fails the job when the operator opens. See [Execution Requirements]({{< ref " [...]
 
 ### Memory
 
diff --git a/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/PythonResourceWorkerLifetimeScenario.java b/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/PythonResourceWorkerLifetimeScenario.java
index 4cca6211f..15b3bc154 100644
--- a/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/PythonResourceWorkerLifetimeScenario.java
+++ b/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/PythonResourceWorkerLifetimeScenario.java
@@ -322,9 +322,6 @@ public final class PythonResourceWorkerLifetimeScenario {
             this.taskIndex = taskIndex;
         }
 
-        @Override
-        public void restoreContext() {}
-
         @Override
         public void execute() {
             try {
diff --git a/python/flink_agents/e2e_tests/e2e_tests_integration/internal_subagent_test.py b/python/flink_agents/e2e_tests/e2e_tests_integration/internal_subagent_test.py
index 008692224..2a8ac0777 100644
--- a/python/flink_agents/e2e_tests/e2e_tests_integration/internal_subagent_test.py
+++ b/python/flink_agents/e2e_tests/e2e_tests_integration/internal_subagent_test.py
@@ -19,12 +19,13 @@
 
 A child agent registered through a descriptor exercises the whole
 operator round-trip: the Python-compiled child plan is materialized into a Java
-``InternalSubagentSetup``, the call event is sent on the mailbox thread, the
-mailbox is released while the caller awaits, and the child's actions are
-dispatched and their output accumulated into the caller's ``Result``.
+``InternalSubagentSetup``, the call is issued on the mailbox thread, and the
+handle then polls it, yielding the mailbox between polls so the child's actions
+are dispatched and their output accumulated into the caller's ``Result``.
 
-Unlike the Java caller path, this does not need JDK 21: a Python coroutine
-releases the mailbox by yielding at ``await``.
+Issuing the call reads the caller's durable slot first, so a replay of an
+already completed call installs the recorded result and the child graph never
+starts — the same pre-dispatch skip the Java caller path has.
 
 The common subgraph runtime routes child events privately and accumulates outputs
 into the call result. The operator separately selects the child's ``ResourceScope``
@@ -40,6 +41,7 @@ future yields the ``Result``.
 and replays it identically after a failover.
 """
 
+import json
 import os
 import sysconfig
 from pathlib import Path
@@ -82,6 +84,20 @@ class EchoChildAgent(Agent):
         ctx.send_event(OutputEvent(output=f"echo:{InputEvent.from_event(event).input}"))
 
 
+class StructuredChildAgent(Agent):
+    """Child agent whose output is a nested payload rather than a string."""
+
+    @action(InputEvent.EVENT_TYPE)
+    @staticmethod
+    def payload(event: Event, ctx: RunnerContext) -> None:
+        """Emit a nested structure with a null in it."""
+        ctx.send_event(
+            OutputEvent(
+                output={"answer": "hello", "nested": {"7": [1, None]}, "absent": None}
+            )
+        )
+
+
 class FailingChildAgent(Agent):
     """Child agent failing instead of producing output."""
 
@@ -129,12 +145,27 @@ class RootAgent(Agent):
             ctx.send_event(OutputEvent(output=f"failed:{result.error_message}"))
 
 
-def _run_and_collect(child: Agent, tmp_path: Path) -> str:
+class ReportingRootAgent(Agent):
+    """Caller agent that renders the child's payload instead of forwarding it."""
+
+    @action(InputEvent.EVENT_TYPE)
+    @staticmethod
+    async def orchestrate(event: Event, ctx: RunnerContext) -> None:
+        """Emit the child's payload as canonical JSON."""
+        prompt = InputEvent.from_event(event).input
+        child = ctx.get_resource(CHILD_SCOPE, ResourceType.AGENT)
+        future = await child.submit(ctx, prompt)
+        result = await future
+        rendered = json.dumps(result.result[0], sort_keys=True)
+        ctx.send_event(OutputEvent(output=rendered))
+
+
+def _run_and_collect(child: Agent, tmp_path: Path, root: Agent | None = None) -> str:
     env = StreamExecutionEnvironment.get_execution_environment()
     env.set_parallelism(1)
     input_stream = env.from_collection(["hello"])
 
-    root = RootAgent()
+    root = root or RootAgent()
     root.add_resource(
         CHILD_SCOPE,
         ResourceType.AGENT,
@@ -189,3 +220,14 @@ def test_python_internal_subagent_nested_call(tmp_path: Path) -> None:
     assert "relayed:echo:deep:hello" in contents, (
         f"nested call did not complete; collected: {contents!r}"
     )
+
+
+def test_python_internal_subagent_structured_payload(tmp_path: Path) -> None:
+    """A nested payload reaches the caller as Python containers, not Java objects.
+
+    Rendering it with ``json`` is the assertion: a Java object would not serialize.
+    """
+    contents = _run_and_collect(StructuredChildAgent(), tmp_path, ReportingRootAgent())
+    expected = '{"absent": null, "answer": "hello", "nested": {"7": [1, null]}}'
+
+    assert expected in contents, f"payload did not arrive; collected: {contents!r}"
diff --git a/python/flink_agents/runtime/base_subagent.py b/python/flink_agents/runtime/base_subagent.py
index 4ee473a54..8df7649e4 100644
--- a/python/flink_agents/runtime/base_subagent.py
+++ b/python/flink_agents/runtime/base_subagent.py
@@ -182,15 +182,21 @@ class BaseSubagentSetup(SubagentSetup, TaskLifecycleListener, ABC):
         )
 
     def on_action_transferred(self, from_task: Any, to_task: Any) -> None:
-        """Move the finishing task's bookkeeping onto the generated task."""
+        """Unbind the yielding task and preserve its bookkeeping for resumption."""
         from_identity = Namespace.from_task(from_task).task_identity
-        to_identity = Namespace.from_task(to_task).task_identity
+        to_namespace = Namespace.from_task(to_task)
+        to_identity = to_namespace.task_identity
+        self._clear_current_namespace(from_identity)
+        if from_identity == to_identity:
+            # A worker-to-mailbox handoff retains the same task: it resumes the
+            # same logical action, so its allocator and registry must survive.
+            return
         allocator = self._per_task_allocators.pop(from_identity, None)
         if allocator is not None:
             self._per_task_allocators[to_identity] = allocator
         registry = self._per_task_registries.pop(from_identity, None)
         if registry is not None:
-            registry.set_action_name(Namespace.from_task(to_task).action_name)
+            registry.set_action_name(to_namespace.action_name)
             self._per_task_registries[to_identity] = registry
 
     def on_action_finishing(self, task: Any) -> None:
@@ -198,9 +204,8 @@ class BaseSubagentSetup(SubagentSetup, TaskLifecycleListener, ABC):
 
         The replay-reuse path reaches the same finalization through
         ``on_action_reused``, keeping the prepared/terminal pairing intact on
-        both paths. A failed invocation intentionally skips this cleanup: the
-        failure fails the run and the task is replayed on the restarted
-        operator, so stale entries cannot outlive the run.
+        both paths. A failed invocation only clears the current binding,
+        leaving its allocator and registry for the existing failure handling.
         """
         self._current_namespace = None
         identity = Namespace.from_task(task).task_identity
@@ -213,6 +218,17 @@ class BaseSubagentSetup(SubagentSetup, TaskLifecycleListener, ABC):
         """Reuse is a terminal outcome like finishing, so share finalization."""
         self.on_action_finishing(task)
 
+    def on_action_failed(self, task: Any, error: Any) -> None:
+        """Unbind only the failed task without finalizing pending calls."""
+        self._clear_current_namespace(Namespace.from_task(task).task_identity)
+
+    def _clear_current_namespace(self, identity: str) -> None:
+        if (
+            self._current_namespace is not None
+            and self._current_namespace.task_identity == identity
+        ):
+            self._current_namespace = None
+
     # --------------------------------------------------------------------------------
     # Identity injected by the framework
     # --------------------------------------------------------------------------------
diff --git a/python/flink_agents/runtime/chat_future.py b/python/flink_agents/runtime/chat_future.py
index 4cc21eca3..94c5cf374 100644
--- a/python/flink_agents/runtime/chat_future.py
+++ b/python/flink_agents/runtime/chat_future.py
@@ -28,12 +28,11 @@ from flink_agents.api.runner_context import DurableFuture, Outcome
 
 
 class _ChatFuture(DurableFuture[ChatResult]):
-    """Resolve through the Java chat coordinator, without occupying a worker."""
+    """Resolve through the Java chat call chain, without occupying a worker."""
 
     def __init__(self, ctx: Any, request: ChatRequestEvent) -> None:
         super().__init__()
         self._ctx = ctx
-        self._calls = ctx.getChatContext().getManager()
         self._request_json = request.model_dump_json()
         self._call_id: str | None = None
 
@@ -50,9 +49,9 @@ class _ChatFuture(DurableFuture[ChatResult]):
 
     def _resolve(self) -> Any:
         if self._call_id is None:
-            self._call_id = self._calls.prepareCall(self._ctx, self._request_json)
+            self._call_id = self._ctx.prepareChatCall(self._request_json)
         while True:
-            response_json = self._calls.tryCompleteCall(self._ctx, self._call_id)
+            response_json = self._ctx.tryCompleteChatCall(self._call_id)
             if response_json is not None:
                 response = ChatResponseEvent.from_event(Event.from_json(response_json))
                 try:
diff --git a/python/flink_agents/runtime/flink_runner_context.py b/python/flink_agents/runtime/flink_runner_context.py
index efd88b1da..c03e66854 100644
--- a/python/flink_agents/runtime/flink_runner_context.py
+++ b/python/flink_agents/runtime/flink_runner_context.py
@@ -21,7 +21,7 @@ import logging
 import os
 import time
 from collections.abc import Mapping
-from concurrent.futures import ThreadPoolExecutor
+from concurrent.futures import CancelledError, ThreadPoolExecutor
 from dataclasses import dataclass
 from functools import partial
 from typing import Any, Callable, Dict, Literal
@@ -49,6 +49,7 @@ from flink_agents.api.runner_context import (
     Outcome,
     RunnerContext,
 )
+from flink_agents.api.subagent import SubagentResult
 from flink_agents.api.trace import ExecutionReporter
 from flink_agents.runtime.chat_future import _ChatFuture
 from flink_agents.runtime.close_utils import failure_of, first_or_logged
@@ -673,8 +674,8 @@ class FlinkRunnerContext(RunnerContext, ExecutionReporter):
         # registered via add_task_lifecycle_listener() (aligned with the Java
         # operator's taskLifecycleListeners).
         self.__task_lifecycle_listeners: list = []
-        # The namespace of the task the operator last reported prepared, extracted
-        # eagerly so no pemja reference is retained across calls. Replayed onto a
+        # The namespace of the task's current prepared phase, extracted eagerly
+        # so no pemja reference is retained across calls. Replayed onto a
         # sub-agent handle materialized lazily during the action body — see
         # __observe_subagent_setup().
         self.__prepared_namespace: Any = None
@@ -875,7 +876,10 @@ class FlinkRunnerContext(RunnerContext, ExecutionReporter):
 
     def notify_action_transferred(self, from_task: Any, to_task: Any) -> None:
         """Fan out the operator's onActionTransferred to the listeners."""
-        self.__capture_prepared_namespace(to_task)
+        # A transfer may retain the same task (a worker-to-mailbox handoff on the
+        # parallel engine), so the next phase's namespace is left to its own
+        # onActionPrepared rather than assumed to be the successor's here.
+        self.__prepared_namespace = None
         for listener in self.__task_lifecycle_listeners:
             listener.on_action_transferred(from_task, to_task)
 
@@ -898,8 +902,35 @@ class FlinkRunnerContext(RunnerContext, ExecutionReporter):
 
     def notify_action_failed(self, task: Any, error: Any) -> None:
         """Fan out the operator's onActionFailed to the task lifecycle listeners."""
+        from flink_agents.runtime.base_subagent import Namespace
+
+        try:
+            failed_identity = Namespace.from_task(task).task_identity
+        except Exception:
+            # Placeholder tasks expose no accessor surface; nothing to unbind.
+            failed_identity = None
+        if (
+            failed_identity is not None
+            and self.__prepared_namespace is not None
+            and self.__prepared_namespace.task_identity == failed_identity
+        ):
+            self.__prepared_namespace = None
         for listener in self.__task_lifecycle_listeners:
-            listener.on_action_failed(task, error)
+            # Guarded per listener, so one listener's failure neither starves the
+            # remaining ones nor derails the failure being reported. Exception
+            # rather than BaseException: a KeyboardInterrupt or SystemExit raised
+            # here is not a listener bug, and swallowing it into a warning would
+            # hide an operator's attempt to stop the process.
+            try:
+                listener.on_action_failed(task, error)
+            except CancelledError:  # noqa: PERF203
+                # CancelledError derives from Exception, so the guard below would
+                # otherwise demote the caller's control flow to a warning.
+                raise
+            except Exception:
+                # The warning is the whole report: `error` is a pemja proxy, so
+                # nothing attached to it reaches the throwable Java rethrows.
+                logger.warning("Task failure listener failed", exc_info=True)
 
     def notify_record_finished(self, key: Any) -> None:
         """Fan out the operator's onRecordFinished to the task lifecycle listeners."""
@@ -1739,31 +1770,48 @@ class FlinkRunnerContext(RunnerContext, ExecutionReporter):
             kwargs,
         )
 
-    def bootstrap_subagent_call(
+    def bootstrap_internal_subagent_call(
         self, scope: str, session_id: str, call_id: str, prompt: Any
     ) -> None:
-        """Bootstrap an internal sub-agent call under the assigned identity.
+        """Issue an internal sub-agent call under the assigned identity.
 
         Implements
         :class:`~flink_agents.runtime.internal_subagent.InternalSubagentCallFactory`.
-        Delegates to the Java ``RunnerContextImpl.bootstrapSubagentCallForScope``,
-        which resolves the materialized sub-agent setup by ``scope`` and sends
-        the bootstrap event. Must run on the mailbox thread.
+        Delegates to the Java
+        ``RunnerContextImpl.bootstrapInternalSubagentCallForScope``, which
+        resolves the materialized sub-agent setup by ``scope``, reads the
+        caller's durable slot, and sends the bootstrap event only on a miss.
+        Must run on the mailbox thread.
         """
-        self._j_runner_context.bootstrapSubagentCallForScope(
+        self._j_runner_context.bootstrapInternalSubagentCallForScope(
             scope, session_id, call_id, prompt
         )
 
-    def await_subagent_call(self, session_id: str, call_id: str) -> list:
-        """Block until the identified internal sub-agent call quiesces.
+    def try_complete_internal_subagent_call(
+        self, session_id: str, call_id: str
+    ) -> SubagentResult | None:
+        """Take an issued internal sub-agent call's result, if it has one.
 
         Implements
         :class:`~flink_agents.runtime.internal_subagent.InternalSubagentCallFactory`.
-        Delegates to the Java ``RunnerContextImpl.awaitSubagentCall``. Must run
-        off the mailbox thread (e.g. on the durable-execution async worker) so
-        the mailbox stays free to dispatch the child agent's actions.
+        Delegates to the Java ``RunnerContextImpl.tryCompleteInternalSubagentCall``,
+        which returns ``None`` while the child graph still runs and the result as
+        JSON once it does not, so the payload's types come from the bridge rather
+        than from the child. A child failure rides inside the result rather than
+        being raised, so anything raised here belongs to the call itself. Must run
+        on the mailbox thread.
         """
-        return list(self._j_runner_context.awaitSubagentCall(session_id, call_id))
+        result_json = self._j_runner_context.tryCompleteInternalSubagentCall(
+            session_id, call_id
+        )
+        if result_json is None:
+            return None
+        payload = json.loads(result_json)
+        return SubagentResult(
+            success=payload["success"],
+            result=payload["result"],
+            error_message=payload["errorMessage"],
+        )
 
     @property
     @override
diff --git a/python/flink_agents/runtime/internal_subagent.py b/python/flink_agents/runtime/internal_subagent.py
index 3e794c44a..49a7d3a22 100644
--- a/python/flink_agents/runtime/internal_subagent.py
+++ b/python/flink_agents/runtime/internal_subagent.py
@@ -23,33 +23,37 @@ the compiled descriptor carries the child
 name) in a ``JavaResourceProvider`` referencing the Java runtime setup.
 This Python caller owns the invocation behavior.
 
-Execution mode is the deferred one, inherited from
-:class:`~flink_agents.runtime.deferred_subagent.DeferredSubagentSetup`:
-:meth:`submit` returns a deferred handle whose request is prepared on the
-first resolve. :meth:`prepare` then runs the mailbox-confined bootstrap —
-sending the call event through the runtime context — and returns the
-``(id, call, reconcile)`` triple whose call waits off the mailbox thread for
-the child to quiesce, so the operator can dispatch the child agent's actions
-in between. The wait releases the
-mailbox through the await-only resolve contract: a synchronous Python action
-holds the mailbox for its whole ``pemja`` invocation, so it can never yield
-for the operator to dispatch the child's actions and a blocking wait would
-deadlock.
-
-Sending the bootstrap event outside the durable boundary is deliberate: a
+Execution is the same graph-call chain the Java side and the built-in chat
+call run. :meth:`submit` returns a handle that does nothing until it is
+resolved; resolving issues the call through the runtime context, then polls it
+to completion, yielding the mailbox between polls so the operator can dispatch
+the child agent's actions. Both phases run on the mailbox thread, so an action
+resolving a handle must be a coroutine: a synchronous action holds the mailbox
+for its whole ``pemja`` invocation and could never let the child run.
+
+Issuing the call also reads the caller's durable slot, on the Java side and
+before the bootstrap event is emitted, so replaying an already completed call
+installs the recorded result and the child graph never starts. Sending the
+bootstrap event outside a durable boundary is deliberate for the same reason: a
 replayed send carries the same event attributes, so the child action resolves
 to the same persisted action state and replays its recorded output instead of
 running again.
 """
 
-from typing import Any, List, Protocol, runtime_checkable
+from concurrent.futures import CancelledError
+from typing import Any, Protocol, runtime_checkable
 
 from flink_agents.api.runner_context import RunnerContext
-from flink_agents.api.subagent import SubagentResult
+from flink_agents.api.subagent import (
+    SubagentFuture,
+    SubagentFutures,
+    SubagentResult,
+)
 from flink_agents.plan.agent_plan import AgentPlan
-from flink_agents.runtime.deferred_subagent import (
-    DeferredSubagentSetup,
-    PreparedTriple,
+from flink_agents.runtime.base_subagent import BaseSubagentSetup
+from flink_agents.runtime.subagent_handles import (
+    PendingSubagentCallRegistry,
+    SubagentFutureGroup,
 )
 
 
@@ -57,79 +61,161 @@ from flink_agents.runtime.deferred_subagent import (
 class InternalSubagentCallFactory(Protocol):
     """Runtime hook a ``RunnerContext`` implements to drive internal sub-agents.
 
-    Split into a mailbox-thread ``bootstrap`` (sends the call event) and an
-    off-mailbox ``await``, because a Python action cannot cooperatively yield
-    the mailbox from inside one blocking call the way the Java continuation
-    path does.
+    Both halves run on the mailbox thread. The handle yields between polls, so
+    the child's actions are dispatched in between rather than being waited for
+    inside one blocking call.
     """
 
-    def bootstrap_subagent_call(
+    def bootstrap_internal_subagent_call(
         self, scope: str, session_id: str, call_id: str, prompt: Any
     ) -> None:
-        """Send the call event for ``scope`` under the assigned identity.
+        """Issue the call for ``scope`` under the assigned identity.
 
-        Must be invoked on the mailbox thread; it sends the bootstrap event.
+        Must be invoked on the mailbox thread; it sends the bootstrap event
+        unless the caller's durable slot already holds the result.
         """
         ...
 
-    def await_subagent_call(self, session_id: str, call_id: str) -> List[Any]:
-        """Block until the identified call quiesces and return its outputs.
+    def try_complete_internal_subagent_call(
+        self, session_id: str, call_id: str
+    ) -> SubagentResult | None:
+        """Take the issued call's result, or None while its child still runs.
 
-        Must be invoked off the mailbox thread so the mailbox can dispatch the
-        child agent's actions while this waits.
+        Must be invoked on the mailbox thread. A child failure comes back
+        inside the result rather than being raised, so anything raised here
+        belongs to the call itself and must reach the caller.
         """
         ...
 
 
-class InternalSubagentSetup(DeferredSubagentSetup):
+class InternalSubagentFuture(SubagentFuture):
+    """Handle to one internal sub-agent call, issued and polled to completion.
+
+    Unlike a deferred external handle it carries no durable callable of its
+    own: the Java runtime owns this call's durable slot, reading it before the
+    child graph starts and recording the terminal result once it quiesces.
+    """
+
+    def __init__(
+        self,
+        session_id: str,
+        call_id: str,
+        ctx: InternalSubagentCallFactory,
+        scope: str,
+        prompt: Any,
+        registry: PendingSubagentCallRegistry | None = None,
+    ) -> None:
+        """Initialize with the identity and everything issuing the call needs."""
+        super().__init__(session_id, call_id)
+        self._ctx = ctx
+        self._scope = scope
+        self._prompt = prompt
+        self._registry = registry
+        self._issued = False
+        self._done = False
+        self._cancelled = False
+        self._value: SubagentResult | None = None
+        if registry is not None:
+            registry.track_pending_subagent_call(self.identity)
+
+    def done(self) -> bool:
+        """Whether the invocation has been resolved or cancelled."""
+        return self._done or self._cancelled
+
+    def cancel(self) -> None:
+        """Cancel before the call is issued: nothing was sent, so there is
+        nothing to undo. An already resolved handle ignores the request.
+        """
+        if self._done:
+            return
+        self._cancelled = True
+        if self._registry is not None:
+            self._registry.untrack_pending_subagent_call(self.identity)
+
+    def prepare(self) -> None:
+        """Issue the call if it has not been issued yet.
+
+        Mailbox-confined: must run on the mailbox thread.
+        """
+        if self._cancelled:
+            msg = f"Sub-agent call cancelled: {self.identity}"
+            raise CancelledError(msg)
+        if not self._issued:
+            self._ctx.bootstrap_internal_subagent_call(
+                self._scope, self._session_id, self._call_id, self._prompt
+            )
+            self._issued = True
+
+    def execute(self) -> Any:
+        """Poll the issued call to completion, yielding the mailbox in between.
+
+        A child failure converges into a failed :class:`SubagentResult`, as it
+        does on the Java side. A fault of the call itself propagates and fails
+        the action rather than being reported as the child's answer.
+        """
+        self.prepare()
+        while True:
+            result = self._ctx.try_complete_internal_subagent_call(
+                self._session_id, self._call_id
+            )
+            if result is not None:
+                self._resolve(result)
+                return
+            yield
+
+    def combine(self, *others: SubagentFuture) -> SubagentFutures:
+        """Group this handle with others for a batched resolve."""
+        return SubagentFutureGroup((self, *others))
+
+    def __await__(self) -> Any:
+        """Resolve the invocation, releasing the mailbox while waiting."""
+        if self._cancelled:
+            msg = f"Sub-agent call cancelled: {self.identity}"
+            raise CancelledError(msg)
+        if not self._done:
+            yield from self.execute()
+        return self._value
+
+    def _resolve(self, value: SubagentResult) -> None:
+        self._value = value
+        self._done = True
+        if self._registry is not None:
+            self._registry.untrack_pending_subagent_call(self.identity)
+
+
+class InternalSubagentSetup(BaseSubagentSetup):
     """Compiled internal sub-agent, produced during ``AgentPlan`` compilation.
 
     Holds the child agent's compiled ``plan`` and its ``scope`` (the
     resource name used for runtime resolution). The child work is orchestrated
-    by the operator: the async callable delegates to
-    :class:`InternalSubagentCallFactory` on the runtime context. The
-    :meth:`submit` behavior is inherited as-is from the deferred base:
-    explicit identities, deferred issue, and the await-only resolve.
+    by the operator: the handle delegates to
+    :class:`InternalSubagentCallFactory` on the runtime context. Identity
+    assignment, deferred issue and the pending-call registry are inherited from
+    :class:`~flink_agents.runtime.base_subagent.BaseSubagentSetup`.
     """
 
     plan: AgentPlan
     scope: str
 
-    def prepare(
+    async def submit_with_identity(
         self,
         ctx: RunnerContext,
         prompt: Any,
         session_id: str,
         call_id: str,
-    ) -> PreparedTriple:
-        """Send the call event and return the prepared triple.
-
-        Runs on the mailbox thread when the deferred handle is first resolved,
-        as sending the bootstrap event requires; the returned call only
-        awaits completion and runs off the mailbox thread so the operator can
-        dispatch the child agent's actions in between.
-        """
+    ) -> SubagentFuture:
+        """Return the handle issuing this call when it is resolved."""
         if not isinstance(ctx, InternalSubagentCallFactory):
             msg = (
                 "InternalSubagentSetup requires a runtime context that "
                 "implements InternalSubagentCallFactory"
             )
             raise NotImplementedError(msg)
-        scope = self.scope
-        # Mailbox-thread phase: the event carries the assigned identity, so a
-        # replayed send reproduces the same event attributes.
-        ctx.bootstrap_subagent_call(scope, session_id, call_id, prompt)
-
-        def _call() -> SubagentResult:
-            # Runs off the mailbox thread (Python async worker), so the mailbox
-            # is free to dispatch the child agent's actions until the call
-            # quiesces. A child failure surfaces as a failed Result (mirroring
-            # Java's InternalSubagentSetup) rather than propagating out of the
-            # call.
-            try:
-                output = ctx.await_subagent_call(session_id, call_id)
-            except Exception as e:
-                return SubagentResult.error(e)
-            return SubagentResult.ok(output)
-
-        return (f"{session_id}#{call_id}", _call, None)
+        return InternalSubagentFuture(
+            session_id,
+            call_id,
+            ctx,
+            self.scope,
+            prompt,
+            registry=self.pending_call_registry(),
+        )
diff --git a/python/flink_agents/runtime/subagent_handles.py b/python/flink_agents/runtime/subagent_handles.py
index 07d4f91e9..1770eadc3 100644
--- a/python/flink_agents/runtime/subagent_handles.py
+++ b/python/flink_agents/runtime/subagent_handles.py
@@ -21,7 +21,7 @@ These companions are execution-mode agnostic. The execution modes build
 on them, so the framework never needs to know how a request is issued.
 """
 
-from typing import Any
+from typing import Any, Protocol, runtime_checkable
 
 from flink_agents.api.subagent import (
     SubagentFuture,
@@ -30,6 +30,23 @@ from flink_agents.api.subagent import (
 )
 
 
+@runtime_checkable
+class PhasedSubagentFuture(Protocol):
+    """A handle with separate preparation and execution phases.
+
+    :class:`SubagentFutureGroup` prepares every member before executing any;
+    preparation need not issue the call.
+    """
+
+    def prepare(self) -> Any:
+        """Prepare the call without waiting for it. Idempotent."""
+        ...
+
+    def execute(self) -> Any:
+        """Wait for the prepared call, preparing it first if awaited on its own."""
+        ...
+
+
 class PendingSubagentCallRegistry:
     """The per-action-execution set of sub-agent handles submitted but
     not yet resolved.
@@ -119,22 +136,20 @@ class SubagentFutureGroup(SubagentFutures):
     def __await__(self) -> Any:
         """Wait for every handle in submission order.
 
-        Pending deferred handles are prepared before any execution
-        starts, then executed one by one.
+        Pending phased handles are prepared before any execution starts, then
+        executed one by one.
         """
-        # Late import: deferred handles build on this module.
-        from flink_agents.runtime.deferred_subagent import DeferredSubagentFuture
-
         pending = [
             future
             for future in self._futures
-            if isinstance(future, DeferredSubagentFuture) and not future.done()
+            if isinstance(future, PhasedSubagentFuture) and not future.done()
         ]
+        _check_not_mixed_internal_and_deferred(pending)
         for future in pending:
             future.prepare()
-        # TODO(#926): execute the prepared calls as one batch once durable
-        # execution supports batched submission; until then the prepared
-        # calls are executed one by one.
+        # TODO(#926): wait for the issued calls as one batch once durable
+        # execution supports batched submission; until then they are waited
+        # for one by one.
         for future in pending:
             yield from future.execute()
         outcomes = []
@@ -142,3 +157,35 @@ class SubagentFutureGroup(SubagentFutures):
             outcome = yield from future.__await__()
             outcomes.append(outcome)
         return outcomes
+
+
+def _check_not_mixed_internal_and_deferred(pending: list) -> None:
+    """Fail when a group mixes internal and deferred handles: the two consult
+    the calling action's durable journal in different phases, so mixing them
+    currently breaks durable recovery.
+    """
+    # Imported here because both modules import this one for SubagentFutureGroup.
+    from flink_agents.runtime.deferred_subagent import DeferredSubagentFuture
+    from flink_agents.runtime.internal_subagent import InternalSubagentFuture
+
+    internal = None
+    deferred = None
+    for future in pending:
+        if isinstance(future, InternalSubagentFuture):
+            internal = future
+        elif isinstance(future, DeferredSubagentFuture):
+            deferred = future
+    if internal is not None and deferred is not None:
+        msg = (
+            f"A combined sub-agent group cannot mix the internal call "
+            f"{_describe(internal)} with the deferred call {_describe(deferred)}: "
+            f"the two consult this action's durable journal in different phases, "
+            f"so recovery cannot replay the reads in the written order. Resolve "
+            f"the two calls separately."
+        )
+        raise RuntimeError(msg)
+
+
+def _describe(future: SubagentFuture) -> str:
+    """Name a handle the way the Java-side rejection does."""
+    return f"{type(future).__name__} {future.identity}"
diff --git a/python/flink_agents/runtime/task_lifecycle_listener.py b/python/flink_agents/runtime/task_lifecycle_listener.py
index 5f7c1ae1f..2da4ee413 100644
--- a/python/flink_agents/runtime/task_lifecycle_listener.py
+++ b/python/flink_agents/runtime/task_lifecycle_listener.py
@@ -26,15 +26,20 @@ class TaskLifecycleListener:
     Mirrors the Java ``TaskLifecycleListener``: the operator drives Python
     actions on the JVM and forwards each lifecycle callback here over pemja.
     Every callback defaults to a no-op, so an implementation overrides only
-    the ones it cares about.
-
-    Pairing semantics: ``on_action_prepared`` pairs with exactly one terminal
-    callback -- ``on_action_finishing`` followed by ``on_action_finished`` on
-    normal completion, ``on_action_reused`` when a replay skips an
-    already-completed action, ``on_action_failed`` on invocation failure, or
-    ``on_action_transferred`` when a non-finished task hands its context over
-    to the task it generated. ``on_action_started`` fires at most once per
-    action execution; the gate is checkpointed with the task, so a failover
+    the ones it cares about. Callbacks are serialized within one operator:
+    on the mailbox thread for cooperative execution, or under the execution
+    lock for parallel execution. No fixed thread affinity is guaranteed.
+
+    Pairing semantics: ``on_action_prepared`` enters an execution phase after
+    the task's contexts are bound, not necessarily another body invocation.
+    The phase ends with ``on_action_finishing`` followed by
+    ``on_action_finished`` on normal completion, ``on_action_reused`` when a
+    replay skips an already-completed action, or ``on_action_transferred``
+    when the task yields execution. A transfer may retain the same task,
+    including a worker-to-mailbox handoff. ``on_action_failed`` reports a task
+    processing failure; it is not a phase exit and does not imply an open
+    phase. ``on_action_started`` fires at most once per action execution; the
+    gate is checkpointed with the task, so a failover
     replay re-emits ``on_record_start`` but not ``on_action_started``.
 
     Exception contract: the framework allows a listener to inspect state and
@@ -42,24 +47,31 @@ class TaskLifecycleListener:
     """
 
     def on_record_start(self, key: Any) -> None:
-        """The first task of an input record is about to be prepared.
+        """An input record was admitted for processing.
 
-        Also re-emitted when an in-flight record resumes after a failover,
-        so listeners observe a paired bracket for the replayed round.
+        Fires whether or not the record triggers any action. Also re-emitted
+        when an in-flight record resumes after a failover, so listeners
+        observe a paired bracket for the replayed round.
         """
 
     def on_action_prepared(self, task: Any) -> None:
-        """A task's context is wired up and it is ready to run.
+        """A task's contexts are fully bound for the phase it is entering.
 
-        Fires on every preparation, including re-preparation of a suspended
-        or resumed task.
+        Fires again after a handoff or suspension; the phase need not invoke
+        the action body again.
         """
 
     def on_action_started(self, task: Any) -> None:
         """An action execution is about to run for the first time."""
 
     def on_action_transferred(self, from_task: Any, to_task: Any) -> None:
-        """A non-finished task handed its context to the task it generated."""
+        """A task is yielding execution.
+
+        Unbind the current task and move bookkeeping from ``from_task`` to
+        ``to_task``, preserving it unchanged when both identify the same task.
+        What comes next is either ``on_action_prepared`` for a further phase
+        or ``on_action_failed``.
+        """
 
     def on_action_finishing(self, task: Any) -> None:
         """A task completed but its result is not persisted yet.
@@ -81,15 +93,22 @@ class TaskLifecycleListener:
         """
 
     def on_action_failed(self, task: Any, error: Any) -> None:
-        """An action invocation failed.
+        """Processing an action task failed.
 
         Purely observational: perceive the failure for logging, metrics, or
         bookkeeping cleanup, but never compensate or decide on rethrowing.
+
+        Not a phase exit, and it does not imply an open phase: a task that
+        failed after a transfer arrives here with no ``on_action_prepared`` in
+        between, so cleanup must tolerate a task it already unbound.
         """
 
     def on_record_finished(self, key: Any) -> None:
         """Every task spawned by an input record has completed.
 
+        A record that spawned none is retired here as well, so the bracket
+        ``on_record_start`` opened always closes.
+
         Implementations must make their per-record cleanup idempotent: after
         a failover replay the notification may not arrive again for records
         that completed before the snapshot.
diff --git a/python/flink_agents/runtime/tests/test_base_subagent.py b/python/flink_agents/runtime/tests/test_base_subagent.py
index eb96a8c79..d51a12ca5 100644
--- a/python/flink_agents/runtime/tests/test_base_subagent.py
+++ b/python/flink_agents/runtime/tests/test_base_subagent.py
@@ -152,24 +152,38 @@ def test_replay_assigns_the_same_ids() -> None:
 
 
 def test_allocation_continues_across_task_steps() -> None:
-    """Each step of a suspended task re-prepares with the same facts, and
-    the allocator persists, so the session ordinal continues instead of
-    restarting.
-    """
+    """Same-task handoffs preserve allocator ordinals and pending handles."""
     setup = _RecordingBaseSetup()
-    setup.on_action_prepared(_FakeTask())
+    task = _FakeTask()
+    setup.on_action_prepared(task)
     first = _run(setup.submit(None, "p"))
+    allocator = setup._current_allocator()
+    registry = setup.pending_call_registry()
+    registry.track_pending_subagent_call(first.identity)
 
-    setup.on_action_prepared(_FakeTask())
+    setup.on_action_transferred(task, task)
+    assert setup.pending_call_registry() is None
+    with pytest.raises(RuntimeError, match="No prepared action task"):
+        _run(setup.submit(None, "outside execution"))
+
+    setup.on_action_prepared(task)
+    assert setup._current_allocator() is allocator
+    assert setup.pending_call_registry() is registry
     second = _run(setup.submit(None, "p"))
+    next_call = _run(setup.submit(None, "p", first.session_id))
 
     assert first.session_id.endswith("-0")
     assert second.session_id.endswith("-1")
-    assert second.session_id != first.session_id
+    assert next_call.call_id == f"{first.session_id}-2"
+    with pytest.raises(RuntimeError, match=first.identity):
+        registry.check_empty()
+    registry.untrack_pending_subagent_call(first.identity)
+    setup.on_action_finishing(task)
+    assert setup.pending_call_registry() is None
 
 
 def test_transfer_moves_bookkeeping_onto_a_different_continuation() -> None:
-    """The generated task may carry a different identity than the finishing
+    """The generated task may carry a different identity than the yielding
     task, so the allocator and the pending-call registry are re-keyed onto
     it instead of assumed equal.
     """
@@ -179,10 +193,17 @@ def test_transfer_moves_bookkeeping_onto_a_different_continuation() -> None:
 
     setup.on_action_prepared(from_task)
     first = _run(setup.submit(None, "p"))
-    setup.pending_call_registry().track_pending_subagent_call("sid#call-1")
+    allocator = setup._current_allocator()
+    registry = setup.pending_call_registry()
+    registry.track_pending_subagent_call("sid#call-1")
     setup.on_action_transferred(from_task, to_task)
+    assert setup.pending_call_registry() is None
+    with pytest.raises(RuntimeError, match="No prepared action task"):
+        _run(setup.submit(None, "outside execution"))
 
     setup.on_action_prepared(to_task)
+    assert setup._current_allocator() is allocator
+    assert setup.pending_call_registry() is registry
     second = _run(setup.submit(None, "p"))
 
     # The allocator moved with the execution: the session ordinal continues
@@ -192,23 +213,48 @@ def test_transfer_moves_bookkeeping_onto_a_different_continuation() -> None:
 
     # The pending-call registry moved as well, and adopted the continuation's
     # action: finishing the continuation still reports the handle tracked
-    # under the finishing task.
+    # under the yielding task.
     with pytest.raises(RuntimeError, match=r"act-next.*sid#call-1"):
         setup.on_action_finishing(to_task)
+    assert setup.pending_call_registry() is None
+    assert not setup._per_task_allocators
+    assert not setup._per_task_registries
 
 
-def test_finished_task_drops_its_bookkeeping() -> None:
-    """After the task finishes, short forms have no task to assign from."""
+@pytest.mark.parametrize("terminal", ["on_action_finishing", "on_action_reused"])
+def test_finished_task_drops_its_bookkeeping(terminal: str) -> None:
+    """After either normal terminal, no current binding or bookkeeping remains."""
     setup = _RecordingBaseSetup()
     setup.on_action_prepared(_FakeTask())
     _run(setup.submit(None, "p"))
+    setup.pending_call_registry()
 
-    setup.on_action_finishing(_FakeTask())
+    getattr(setup, terminal)(_FakeTask())
 
+    assert setup.pending_call_registry() is None
+    assert not setup._per_task_allocators
+    assert not setup._per_task_registries
     with pytest.raises(RuntimeError, match="No prepared action task"):
         _run(setup.submit(None, "p"))
 
 
+@pytest.mark.parametrize("terminal", ["on_action_finishing", "on_action_reused"])
+def test_normal_terminals_still_reject_pending_calls(terminal: str) -> None:
+    """Finishing and reuse retain the existing unresolved-handle check."""
+    setup = _RecordingBaseSetup()
+    task = _FakeTask()
+    setup.on_action_prepared(task)
+    _run(setup.submit(None, "p"))
+    setup.pending_call_registry().track_pending_subagent_call("sid#pending")
+
+    with pytest.raises(RuntimeError, match="sid#pending"):
+        getattr(setup, terminal)(task)
+
+    assert setup.pending_call_registry() is None
+    assert not setup._per_task_allocators
+    assert not setup._per_task_registries
+
+
 def test_new_action_restarts_call_ordinal_for_a_reused_session_id() -> None:
     """Ids assigned without an explicit id are only valid within one action
     execution: a new task starts the per-session call ordinal at 1 again, so
@@ -258,19 +304,82 @@ def test_interleaved_executions_of_one_action_keep_apart() -> None:
     first = _run(setup.submit(None, "p"))
     left = setup.pending_call_registry()
     left.track_pending_subagent_call(first.identity)
+    setup.on_action_transferred(first_task, first_task)
+    assert setup.pending_call_registry() is None
 
     setup.on_action_prepared(second_task)
     _run(setup.submit(None, "p"))
     setup.on_action_finishing(second_task)
+    assert setup.pending_call_registry() is None
 
     # The finished execution dropped only its own bookkeeping.
     setup.on_action_prepared(first_task)
     resumed = _run(setup.submit(None, "p"))
     assert resumed.session_id.endswith("-1")
     assert setup.pending_call_registry() is left
+    with pytest.raises(RuntimeError, match=first.identity):
+        left.check_empty()
 
     left.untrack_pending_subagent_call(first.identity)
     setup.on_action_finishing(first_task)
+    assert setup.pending_call_registry() is None
+
+
+def test_failure_unbinds_only_matching_task_without_finalizing_calls() -> None:
+    """Failure preserves both tasks' bookkeeping without checking pending calls."""
+    setup = _RecordingBaseSetup()
+    failed = _FakeTask(action_name="failed")
+    other = _FakeTask(action_name="other")
+    setup.on_action_prepared(failed)
+    first = _run(setup.submit(None, "p"))
+    allocator = setup._current_allocator()
+    registry = setup.pending_call_registry()
+    registry.track_pending_subagent_call(first.identity)
+    setup.on_action_transferred(failed, failed)
+
+    setup.on_action_prepared(other)
+    other_handle = _run(setup.submit(None, "p"))
+    other_allocator = setup._current_allocator()
+    other_registry = setup.pending_call_registry()
+    other_registry.track_pending_subagent_call(other_handle.identity)
+    setup.on_action_failed(failed, RuntimeError("failed"))
+    assert setup._current_allocator() is other_allocator
+    assert setup.pending_call_registry() is other_registry
+    assert setup._current_namespace.action_name == "other"
+
+    # A fresh proxy for the same task must match by task facts, not Python identity.
+    setup.on_action_failed(_FakeTask(action_name="other"), RuntimeError("other"))
+    assert setup.pending_call_registry() is None
+    with pytest.raises(RuntimeError, match="No prepared action task"):
+        _run(setup.submit(None, "outside execution"))
+
+    setup.on_action_prepared(failed)
+    assert setup._current_allocator() is allocator
+    assert setup.pending_call_registry() is registry
+    with pytest.raises(RuntimeError, match=first.identity):
+        registry.check_empty()
+    setup.on_action_transferred(failed, failed)
+    setup.on_action_prepared(other)
+    assert setup._current_allocator() is other_allocator
+    assert setup.pending_call_registry() is other_registry
+    with pytest.raises(RuntimeError, match=other_handle.identity):
+        other_registry.check_empty()
+
+
+def test_transfer_without_bookkeeping_does_not_materialize_it() -> None:
+    """Handoffs do not create allocators or registries before they are needed."""
+    setup = _RecordingBaseSetup()
+    task = _FakeTask()
+    continuation = _FakeTask(action_name="continuation")
+    setup.on_action_prepared(task)
+    setup.on_action_transferred(task, task)
+    setup.on_action_prepared(task)
+    setup.on_action_transferred(task, continuation)
+    setup.on_action_prepared(continuation)
+
+    assert not setup._per_task_allocators
+    assert not setup._per_task_registries
+    assert setup._current_namespace.action_name == "continuation"
 
 
 def test_explicit_identity_passes_through_untouched() -> None:
diff --git a/python/flink_agents/runtime/tests/test_chat_call.py b/python/flink_agents/runtime/tests/test_chat_call.py
index 01b26cee9..c9cbd7f12 100644
--- a/python/flink_agents/runtime/tests/test_chat_call.py
+++ b/python/flink_agents/runtime/tests/test_chat_call.py
@@ -36,20 +36,12 @@ class Bridge:
         self.starts = 0
         self.polls = 0
 
-    def getChatContext(self):
-        return self
-
-    def getManager(self):
-        return self
-
-    def prepareCall(self, ctx, request_json):
-        assert ctx is self
+    def prepareChatCall(self, request_json):
         self.starts += 1
         self.request = Event.from_json(request_json)
         return "call-1"
 
-    def tryCompleteCall(self, ctx, call_id):
-        assert ctx is self
+    def tryCompleteChatCall(self, call_id):
         assert call_id == "call-1"
         self.polls += 1
         return self.response.model_dump_json() if self.response else None
@@ -129,11 +121,11 @@ def test_bridge_failure_is_not_cached_as_chat_outcome(monkeypatch):
     ctx, bridge = context()
     future = ctx.chat("model", [])
 
-    def fail_poll(ctx, call_id) -> None:
+    def fail_poll(call_id) -> None:
         msg = "state unavailable"
         raise RuntimeError(msg)
 
-    monkeypatch.setattr(bridge, "tryCompleteCall", fail_poll)
+    monkeypatch.setattr(bridge, "tryCompleteChatCall", fail_poll)
     with pytest.raises(RuntimeError, match="state unavailable"):
         next(future.__await__())
     assert not future._is_done()
diff --git a/python/flink_agents/runtime/tests/test_flink_runner_context.py b/python/flink_agents/runtime/tests/test_flink_runner_context.py
index 572f51a56..a0ac23a70 100644
--- a/python/flink_agents/runtime/tests/test_flink_runner_context.py
+++ b/python/flink_agents/runtime/tests/test_flink_runner_context.py
@@ -71,6 +71,7 @@ class _FakeJavaRunnerContext:
     def __init__(self) -> None:
         self.sensory_memory = _FakeJavaSensoryMemory()
         self.sent_event_json: str | None = None
+        self.subagent_result_json: str | None = None
 
     def getSensoryMemory(self) -> _FakeJavaSensoryMemory:
         return self.sensory_memory
@@ -78,8 +79,13 @@ class _FakeJavaRunnerContext:
     def sendEventJson(self, event_json: str) -> None:
         self.sent_event_json = event_json
 
+    def tryCompleteInternalSubagentCall(
+        self, session_id: str, call_id: str
+    ) -> str | None:
+        return self.subagent_result_json
 
-def _send_event_context() -> tuple[FlinkRunnerContext, _FakeJavaRunnerContext]:
+
+def _bridge_context() -> tuple[FlinkRunnerContext, _FakeJavaRunnerContext]:
     java_context = _FakeJavaRunnerContext()
     ctx = FlinkRunnerContext.__new__(FlinkRunnerContext)
     ctx._j_runner_context = java_context
@@ -87,7 +93,7 @@ def _send_event_context() -> tuple[FlinkRunnerContext, _FakeJavaRunnerContext]:
 
 
 def test_send_event_offloads_attachments_before_forwarding() -> None:
-    ctx, java_context = _send_event_context()
+    ctx, java_context = _bridge_context()
     payload = {"value": "original"}
     event = Event(type="AttachmentStep", attachments={"payload": payload})
 
@@ -102,7 +108,7 @@ def test_send_event_offloads_attachments_before_forwarding() -> None:
 
 
 def test_send_event_preserves_identity_and_payload() -> None:
-    ctx, java_context = _send_event_context()
+    ctx, java_context = _bridge_context()
 
     event = Event(type="result", attributes={"source": "user"})
     ctx.send_event(event)
@@ -112,3 +118,46 @@ def test_send_event_preserves_identity_and_payload() -> None:
     assert forwarded.id == event.id
     assert forwarded.get_type() == event.get_type()
     assert forwarded.get_attr("source") == "user"
+
+
+# What the Java bridge hands over: byte for byte the payload
+# ``InternalSubagentBridgeTest`` pins, so both halves of the bridge are asserted
+# against one representation.
+_SUBAGENT_RESULT_JSON = (
+    '{"success":true,"result":[{"1":"answer","nested":{"7":[1,null]},'
+    '"absent":null}],"errorMessage":null}'
+)
+
+
+def test_internal_subagent_poll_reports_a_running_call_as_none() -> None:
+    ctx, _ = _bridge_context()
+
+    assert ctx.try_complete_internal_subagent_call("session", "call") is None
+
+
+def test_internal_subagent_poll_decodes_the_bridge_json() -> None:
+    ctx, java_context = _bridge_context()
+    java_context.subagent_result_json = _SUBAGENT_RESULT_JSON
+
+    result = ctx.try_complete_internal_subagent_call("session", "call")
+
+    assert result is not None
+    assert result.success
+    assert result.error_message is None
+    assert result.result == [
+        {"1": "answer", "nested": {"7": [1, None]}, "absent": None}
+    ]
+
+
+def test_internal_subagent_poll_decodes_a_child_failure() -> None:
+    ctx, java_context = _bridge_context()
+    java_context.subagent_result_json = (
+        '{"success":false,"result":null,"errorMessage":"child refused"}'
+    )
+
+    result = ctx.try_complete_internal_subagent_call("session", "call")
+
+    assert result is not None
+    assert not result.success
+    assert result.result is None
+    assert result.error_message == "child refused"
diff --git a/python/flink_agents/runtime/tests/test_internal_subagent.py b/python/flink_agents/runtime/tests/test_internal_subagent.py
new file mode 100644
index 000000000..28d9cc303
--- /dev/null
+++ b/python/flink_agents/runtime/tests/test_internal_subagent.py
@@ -0,0 +1,353 @@
+################################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+"""Tests for the internal sub-agent handle's issue-then-poll resolution.
+
+The handle drives the same graph-call chain the Java side and the built-in chat
+call run, split across mailbox turns:
+``bootstrap_internal_subagent_call`` issues the call once, and
+``try_complete_internal_subagent_call`` is polled until it reports the
+child's result. Both are mailbox-confined, so waiting between polls is a bare
+``yield`` rather than a blocking wait.
+"""
+
+from concurrent.futures import CancelledError
+from typing import Any
+
+import pytest
+
+from flink_agents.api.agents.agent import Agent
+from flink_agents.api.subagent import SubagentResult
+from flink_agents.plan.agent_plan import AgentPlan
+from flink_agents.plan.configuration import AgentConfiguration
+from flink_agents.runtime.deferred_subagent import DeferredSubagentFuture
+from flink_agents.runtime.internal_subagent import (
+    InternalSubagentFuture,
+    InternalSubagentSetup,
+)
+from flink_agents.runtime.subagent_handles import PendingSubagentCallRegistry
+from flink_agents.runtime.tests.test_base_subagent import _run
+
+
+class _PollingContext:
+    """Fake runtime context recording issues and serving canned results."""
+
+    def __init__(self) -> None:
+        self.bootstrapped: list[tuple[str, str, str, Any]] = []
+        self.polled: list[str] = []
+        self.outputs: dict[str, list] = {}
+        self.child_failures: dict[str, str] = {}
+        self.poll_faults: dict[str, Exception] = {}
+        self.issued_before_first_poll: int | None = None
+
+    def bootstrap_internal_subagent_call(
+        self, scope: str, session_id: str, call_id: str, prompt: Any
+    ) -> None:
+        """Record the issue, keyed the way the poll is."""
+        self.bootstrapped.append((scope, session_id, call_id, prompt))
+
+    def try_complete_internal_subagent_call(
+        self, session_id: str, call_id: str
+    ) -> SubagentResult | None:
+        """Report the recorded result, or None while the child still runs."""
+        identity = f"{session_id}#{call_id}"
+        if self.issued_before_first_poll is None:
+            self.issued_before_first_poll = len(self.bootstrapped)
+        self.polled.append(identity)
+        if identity in self.poll_faults:
+            raise self.poll_faults[identity]
+        if identity in self.child_failures:
+            return SubagentResult.error(self.child_failures[identity])
+        outputs = self.outputs.get(identity)
+        return None if outputs is None else SubagentResult.ok(list(outputs))
+
+
+class _PlainContext:
+    """Context without the internal sub-agent hooks."""
+
+
+class _ImmediateAwaitable:
+    """Awaitable resolving without yielding, mirroring a cached durable result."""
+
+    def __init__(self, value: Any) -> None:
+        self._value = value
+
+    def __await__(self) -> Any:
+        return self._value
+        yield  # pragma: no cover - makes this a generator function
+
+
+class _MixedContext(_PollingContext):
+    """Polling context that also serves a deferred handle's durable call.
+
+    Records how many internal calls had been issued when the first durable
+    wait started.
+    """
+
+    def __init__(self) -> None:
+        super().__init__()
+        self.issued_before_first_durable: int | None = None
+
+    def durable_execute_async(
+        self,
+        func: Any,
+        *args: Any,
+        reconciler: Any = None,
+        durable_id: str | None = None,
+        **kwargs: Any,
+    ) -> Any:
+        """Run the deferred callable, noting what was already issued."""
+        if self.issued_before_first_durable is None:
+            self.issued_before_first_durable = len(self.bootstrapped)
+        return _ImmediateAwaitable(func(*args))
+
+
+def _future(
+    ctx: Any,
+    prompt: Any = "ping",
+    registry: PendingSubagentCallRegistry | None = None,
+    session_id: str = "sid-1",
+    call_id: str = "call-1",
+) -> InternalSubagentFuture:
+    return InternalSubagentFuture(
+        session_id, call_id, ctx, "reviewer", prompt, registry=registry
+    )
+
+
+def _deferred(ctx: Any, prompt: Any, call_id: str) -> DeferredSubagentFuture:
+    """The other kind of handle: an external call run through durable execution."""
+    return DeferredSubagentFuture(
+        "sid-1",
+        call_id,
+        ctx,
+        lambda: (f"sid-1#{call_id}", lambda: SubagentResult.ok([prompt]), None),
+    )
+
+
+def test_submit_issues_nothing_until_the_handle_is_resolved() -> None:
+    """Issuing happens on resolve, so a dropped handle starts no child."""
+    ctx = _PollingContext()
+    registry = PendingSubagentCallRegistry("my_action")
+    future = _future(ctx, registry=registry)
+
+    assert ctx.bootstrapped == []
+    assert future.done() is False
+    assert registry.is_empty() is False
+
+    ctx.outputs[future.identity] = ["echo:ping"]
+    assert _run(future).result == ["echo:ping"]
+    assert ctx.bootstrapped == [("reviewer", "sid-1", "call-1", "ping")]
+    assert registry.is_empty() is True
+
+
+def test_handle_polls_until_the_child_reports_outputs() -> None:
+    """A pending child yields the mailbox instead of blocking on it."""
+    ctx = _PollingContext()
+    future = _future(ctx)
+    waiter = future.__await__()
+
+    assert next(waiter) is None
+    assert ctx.bootstrapped == [("reviewer", "sid-1", "call-1", "ping")]
+    assert future.done() is False
+
+    ctx.outputs[future.identity] = ["first", "second"]
+    with pytest.raises(StopIteration) as stop:
+        next(waiter)
+    assert stop.value.value.result == ["first", "second"]
+    # One issue and two polls: the pending one and the terminal one.
+    assert len(ctx.bootstrapped) == 1
+    assert ctx.polled == [future.identity] * 2
+
+
+def test_resolved_handle_keeps_its_value_without_polling_again() -> None:
+    """A second resolve replays the outcome rather than re-issuing the call."""
+    ctx = _PollingContext()
+    future = _future(ctx)
+    ctx.outputs[future.identity] = ["done"]
+
+    first = _run(future)
+    polls = len(ctx.polled)
+    second = _run(future)
+
+    assert second is first
+    assert len(ctx.bootstrapped) == 1
+    assert len(ctx.polled) == polls
+
+
+def test_recorded_child_result_never_yields_the_mailbox() -> None:
+    """A replayed call installs its recorded result at issue time."""
+    ctx = _PollingContext()
+    future = _future(ctx)
+    ctx.outputs[future.identity] = ["replayed"]
+
+    waiter = future.__await__()
+    with pytest.raises(StopIteration) as stop:
+        next(waiter)
+
+    assert stop.value.value.result == ["replayed"]
+    assert ctx.polled == [future.identity]
+
+
+def test_child_failure_resolves_as_a_failed_result() -> None:
+    """A child's own failure is a result the caller inspects, not a raise."""
+    ctx = _PollingContext()
+    registry = PendingSubagentCallRegistry("my_action")
+    future = _future(ctx, registry=registry)
+    ctx.child_failures[future.identity] = "ValueError: child refused"
+
+    result = _run(future)
+
+    assert result == SubagentResult.error("ValueError: child refused")
+    assert future.done() is True
+    assert registry.is_empty() is True
+
+
+def test_fault_of_the_call_itself_reaches_the_caller() -> None:
+    """The contrast: a fault of the call itself is not its child's outcome.
+
+    A slot that cannot be written used to be folded into the child's failure,
+    resolving the handle so the call was never retried.
+    """
+    ctx = _PollingContext()
+    registry = PendingSubagentCallRegistry("my_action")
+    future = _future(ctx, registry=registry)
+    ctx.poll_faults[future.identity] = RuntimeError("could not record the slot")
+
+    with pytest.raises(RuntimeError, match="could not record the slot"):
+        _run(future)
+
+    assert future.done() is False
+    assert registry.is_empty() is False
+
+    # Nothing was resolved, so a retry polls again rather than replaying a result.
+    ctx.poll_faults.clear()
+    ctx.outputs[future.identity] = ["late"]
+    assert _run(future).result == ["late"]
+    assert registry.is_empty() is True
+
+
+def test_group_issues_every_member_before_polling_any() -> None:
+    """A batch runs its child graphs concurrently, in submission order."""
+    ctx = _PollingContext()
+    first = _future(ctx, "a", call_id="call-1")
+    second = _future(ctx, "b", call_id="call-2")
+    third = _future(ctx, "c", call_id="call-3")
+    for future in (first, second, third):
+        ctx.outputs[future.identity] = [future.call_id]
+
+    outcomes = _run(first.combine(second, third))
+
+    assert [outcome.result for outcome in outcomes] == [
+        ["call-1"],
+        ["call-2"],
+        ["call-3"],
+    ]
+    assert ctx.issued_before_first_poll == 3
+    assert [call_id for _, _, call_id, _ in ctx.bootstrapped] == [
+        "call-1",
+        "call-2",
+        "call-3",
+    ]
+
+
+@pytest.mark.parametrize("internal_first", [True, False])
+def test_group_rejects_a_mixed_internal_and_deferred_batch(
+    internal_first: bool,
+) -> None:
+    """A batch holding both kinds is refused before any member is prepared, in
+    either order: mixing them currently breaks durable recovery.
+    """
+    ctx = _MixedContext()
+    internal = _future(ctx, "inner", call_id="call-i")
+    ctx.outputs[internal.identity] = ["child"]
+    deferred = _deferred(ctx, "outer", "call-d")
+    group = (
+        internal.combine(deferred) if internal_first else deferred.combine(internal)
+    )
+
+    with pytest.raises(
+        RuntimeError, match="cannot mix the internal call InternalSubagentFuture"
+    ):
+        _run(group)
+
+    assert ctx.bootstrapped == []
+    assert ctx.issued_before_first_durable is None
+    assert internal.done() is False
+    assert deferred.done() is False
+
+
+def test_group_rejects_an_internal_handle_separated_by_a_deferred_one() -> None:
+    """A deferred handle anywhere in the batch makes it mixed."""
+    ctx = _MixedContext()
+    first = _future(ctx, "inner-1", call_id="call-i1")
+    second = _future(ctx, "inner-2", call_id="call-i2")
+    for future in (first, second):
+        ctx.outputs[future.identity] = [future.call_id]
+    deferred = _deferred(ctx, "outer", "call-d")
+
+    with pytest.raises(
+        RuntimeError, match="cannot mix the internal call InternalSubagentFuture"
+    ):
+        _run(first.combine(deferred, second))
+
+    assert ctx.bootstrapped == []
+
+
+def test_group_allows_a_resolved_deferred_handle_before_an_internal_one() -> None:
+    """A resolved member is skipped by both loops, so it mixes no phases."""
+    ctx = _MixedContext()
+    internal = _future(ctx, "inner", call_id="call-i")
+    ctx.outputs[internal.identity] = ["child"]
+    deferred = _deferred(ctx, "outer", "call-d")
+    assert _run(deferred).result == ["outer"]
+
+    outcomes = _run(deferred.combine(internal))
+
+    assert [outcome.result for outcome in outcomes] == [["outer"], ["child"]]
+    assert internal.done() is True
+
+
+def test_cancel_before_resolve_issues_nothing() -> None:
+    """A cancelled handle sends no bootstrap event and unregisters."""
+    ctx = _PollingContext()
+    registry = PendingSubagentCallRegistry("my_action")
+    future = _future(ctx, registry=registry)
+
+    future.cancel()
+
+    assert future.done() is True
+    assert registry.is_empty() is True
+    with pytest.raises(CancelledError):
+        future.prepare()
+    with pytest.raises(CancelledError):
+        _run(future)
+    assert ctx.bootstrapped == []
+
+
+def test_setup_requires_a_context_implementing_the_call_factory() -> None:
+    """A context without the hooks cannot drive the chain."""
+    setup = InternalSubagentSetup(
+        scope="reviewer",
+        plan=AgentPlan.from_agent(Agent(), AgentConfiguration()),
+    )
+
+    with pytest.raises(NotImplementedError, match="InternalSubagentCallFactory"):
+        _run(setup.submit(_PlainContext(), "ping", "sid-1", "call-1"))
+
+    future = _run(setup.submit(_PollingContext(), "ping", "sid-1", "call-1"))
+    assert isinstance(future, InternalSubagentFuture)
+    assert future.identity == "sid-1#call-1"
diff --git a/python/flink_agents/runtime/tests/test_internal_subagent_descriptor.py b/python/flink_agents/runtime/tests/test_internal_subagent_descriptor.py
index 59b6e2fc7..9e03a72a0 100644
--- a/python/flink_agents/runtime/tests/test_internal_subagent_descriptor.py
+++ b/python/flink_agents/runtime/tests/test_internal_subagent_descriptor.py
@@ -34,6 +34,7 @@ from flink_agents.plan.configuration import AgentConfiguration
 from flink_agents.plan.resource_provider import JavaResourceProvider
 from flink_agents.runtime.internal_subagent import InternalSubagentCallFactory
 from flink_agents.runtime.resource_cache import ResourceCache
+from flink_agents.runtime.tests.test_base_subagent import _run
 
 
 class Request(BaseModel):
@@ -71,16 +72,17 @@ def test_descriptor_round_trip_builds_a_python_caller_with_metadata() -> None:
     assert cache.get_resource("second", ResourceType.AGENT).scope == "second"
     assert json.dumps(provider.descriptor.arguments) == before
     assert cache.get_resource("child", ResourceType.AGENT) is setup
-    # The Python caller retains mailbox bootstrap plus deferred worker await.
+    # The Python caller issues on the mailbox thread, then polls the child to completion.
     ctx = create_autospec(InternalSubagentCallFactory, instance=True, spec_set=True)
-    ctx.await_subagent_call.return_value = ["answer"]
-    _, call, _ = setup.prepare(ctx, {"question": "hello"}, "session", "call")
-    ctx.bootstrap_subagent_call.assert_called_once_with(
+    ctx.try_complete_internal_subagent_call.return_value = SubagentResult.ok(["answer"])
+    future = _run(
+        setup.submit_with_identity(ctx, {"question": "hello"}, "session", "call")
+    )
+    assert _run(future) == SubagentResult.ok(["answer"])
+    ctx.bootstrap_internal_subagent_call.assert_called_once_with(
         "child", "session", "call", {"question": "hello"}
     )
-    result = call()
-    assert result == SubagentResult.ok(["answer"])
-    ctx.await_subagent_call.assert_called_once_with("session", "call")
+    ctx.try_complete_internal_subagent_call.assert_called_once_with("session", "call")
     cache.close()
 
 
diff --git a/python/flink_agents/runtime/tests/test_task_lifecycle_bridge.py b/python/flink_agents/runtime/tests/test_task_lifecycle_bridge.py
index 2b82bbd85..ecf5a93d7 100644
--- a/python/flink_agents/runtime/tests/test_task_lifecycle_bridge.py
+++ b/python/flink_agents/runtime/tests/test_task_lifecycle_bridge.py
@@ -23,10 +23,24 @@ registered ``TaskLifecycleListener``s. These tests exercise that registration
 and fan-out with a recording listener, without a live interpreter.
 """
 
+from concurrent.futures import CancelledError
+from dataclasses import replace
 from typing import Any
+from unittest.mock import Mock
 
+import pytest
+
+from flink_agents.api.resource import ResourceType
+from flink_agents.runtime.base_subagent import Namespace
 from flink_agents.runtime.flink_runner_context import FlinkRunnerContext
+from flink_agents.runtime.resource_cache import ResourceCache
 from flink_agents.runtime.task_lifecycle_listener import TaskLifecycleListener
+from flink_agents.runtime.tests.test_base_subagent import (
+    _FakeProvider,
+    _FakeTask,
+    _RecordingBaseSetup,
+    _run,
+)
 
 
 class _RecordingListener(TaskLifecycleListener):
@@ -63,14 +77,20 @@ class _RecordingListener(TaskLifecycleListener):
         self.calls.append(("record_finished", key))
 
 
-def _context() -> FlinkRunnerContext:
-    """Build a FlinkRunnerContext with an empty listener registry.
-
-    Bypasses ``__init__`` (which needs a Java runner context) and starts from
-    an empty registry, as the operator does before registering listeners.
-    """
+def _context(*setup_names: str) -> FlinkRunnerContext:
+    """Build a context with fake Java accessors and lazily resolved resources."""
     ctx = FlinkRunnerContext.__new__(FlinkRunnerContext)
     ctx._FlinkRunnerContext__task_lifecycle_listeners = []
+    ctx._FlinkRunnerContext__prepared_namespace = None
+    ctx._j_runner_context = Mock()
+    ctx._j_runner_context.getActiveScopePlanJson.return_value = None
+    ctx._FlinkRunnerContext__resource_cache = ResourceCache(
+        {
+            ResourceType.AGENT: {
+                name: _FakeProvider(_RecordingBaseSetup()) for name in setup_names
+            }
+        }
+    )
     return ctx
 
 
@@ -79,22 +99,30 @@ def test_fan_out_forwards_every_callback_in_order() -> None:
     ctx = _context()
     listener = _RecordingListener()
     ctx.add_task_lifecycle_listener(listener)
+    task = _FakeTask()
+    continuation = _FakeTask(sequence_number=2)
 
     ctx.notify_record_start("k")
-    ctx.notify_action_prepared("t")
-    ctx.notify_action_started("t")
-    ctx.notify_action_transferred("t", "t2")
-    ctx.notify_action_finishing("t2")
-    ctx.notify_action_finished("t2")
+    ctx.notify_action_prepared(task)
+    ctx.notify_action_started(task)
+    ctx.notify_action_transferred(task, continuation)
+    ctx.notify_action_prepared(continuation)
+    ctx.notify_action_transferred(continuation, continuation)
+    ctx.notify_action_prepared(continuation)
+    ctx.notify_action_finishing(continuation)
+    ctx.notify_action_finished(continuation)
     ctx.notify_record_finished("k")
 
     assert listener.calls == [
         ("record_start", "k"),
-        ("action_prepared", "t"),
-        ("action_started", "t"),
-        ("action_transferred", "t", "t2"),
-        ("action_finishing", "t2"),
-        ("action_finished", "t2"),
+        ("action_prepared", task),
+        ("action_started", task),
+        ("action_transferred", task, continuation),
+        ("action_prepared", continuation),
+        ("action_transferred", continuation, continuation),
+        ("action_prepared", continuation),
+        ("action_finishing", continuation),
+        ("action_finished", continuation),
         ("record_finished", "k"),
     ]
 
@@ -138,6 +166,7 @@ def test_module_entries_delegate_to_the_context() -> None:
     frc.notify_record_start(ctx, "k")
     frc.notify_action_prepared(ctx, "t")
     frc.notify_action_transferred(ctx, "t", "t2")
+    frc.notify_action_prepared(ctx, "t2")
     frc.notify_action_finishing(ctx, "t2")
     frc.notify_action_finished(ctx, "t2")
     frc.notify_record_finished(ctx, "k")
@@ -146,12 +175,224 @@ def test_module_entries_delegate_to_the_context() -> None:
         "record_start",
         "action_prepared",
         "action_transferred",
+        "action_prepared",
         "action_finishing",
         "action_finished",
         "record_finished",
     ]
 
 
+@pytest.mark.parametrize("same_task", [True, False])
+def test_transfer_waits_for_preparation_before_binding_lazy_setups(
+    same_task: bool,
+) -> None:
+    """Lazy handles adopt only an active prepared phase across interleaved tasks."""
+    ctx = _context("before", "gap", "interleaved", "resumed")
+    task = _FakeTask(key="caller", action_name="caller-action")
+    continuation = task if same_task else _FakeTask(action_name="continuation")
+    other = _FakeTask(key="other", action_name="other-action")
+
+    ctx.notify_action_prepared(task)
+    before = ctx.get_resource("before", ResourceType.AGENT)
+    assert before._current_namespace == replace(
+        Namespace.from_task(task), subagent_name="before"
+    )
+    first = _run(before.submit(None, "p"))
+    allocator = before._current_allocator()
+    registry = before.pending_call_registry()
+    registry.track_pending_subagent_call(first.identity)
+
+    ctx.notify_action_transferred(task, continuation)
+    assert ctx._FlinkRunnerContext__prepared_namespace is None
+    assert before.pending_call_registry() is None
+    gap = ctx.get_resource("gap", ResourceType.AGENT)
+    assert gap._current_namespace is None
+    assert not gap._per_task_allocators
+    assert not gap._per_task_registries
+    with pytest.raises(RuntimeError, match="No prepared action task"):
+        _run(gap.submit(None, "outside execution"))
+
+    ctx.notify_action_prepared(other)
+    interleaved = ctx.get_resource("interleaved", ResourceType.AGENT)
+    assert interleaved._current_namespace == replace(
+        Namespace.from_task(other), subagent_name="interleaved"
+    )
+    _run(interleaved.submit(None, "other"))
+    ctx.notify_action_finishing(other)
+    ctx.notify_action_finished(other)
+    assert ctx._FlinkRunnerContext__prepared_namespace is None
+
+    ctx.notify_action_prepared(continuation)
+    assert before._current_namespace == replace(
+        Namespace.from_task(continuation), subagent_name="before"
+    )
+    assert before._current_allocator() is allocator
+    assert before.pending_call_registry() is registry
+    second = _run(before.submit(None, "resumed"))
+    next_call = _run(before.submit(None, "resumed", first.session_id))
+    assert second.session_id == first.session_id.rsplit("-", 1)[0] + "-1"
+    assert next_call.call_id == f"{first.session_id}-2"
+    with pytest.raises(RuntimeError, match=first.identity):
+        registry.check_empty()
+
+    resumed = ctx.get_resource("resumed", ResourceType.AGENT)
+    assert resumed._current_namespace == replace(
+        Namespace.from_task(continuation), subagent_name="resumed"
+    )
+    assert gap._current_namespace == replace(
+        Namespace.from_task(continuation), subagent_name="gap"
+    )
+    expected_session = resumed._current_namespace.namespace_digest() + "-0"
+    assert _run(resumed.submit(None, "p")).session_id == expected_session
+    assert ctx.get_resource("resumed", ResourceType.AGENT) is resumed
+    assert (
+        sum(
+            listener is resumed
+            for listener in ctx._FlinkRunnerContext__task_lifecycle_listeners
+        )
+        == 1
+    )
+
+    registry.untrack_pending_subagent_call(first.identity)
+    ctx.notify_action_finishing(continuation)
+    ctx.notify_action_finished(continuation)
+    assert ctx._FlinkRunnerContext__prepared_namespace is None
+    for setup in (before, gap, interleaved, resumed):
+        assert setup.pending_call_registry() is None
+        assert not setup._per_task_allocators
+        assert not setup._per_task_registries
+
+
+@pytest.mark.parametrize("terminal", ["finishing", "reused", "failed"])
+def test_terminal_clears_namespace_before_later_materialization(terminal: str) -> None:
+    """No lazy handle can inherit a task after its terminal callback."""
+    ctx = _context("active", "late")
+    task = _FakeTask()
+    ctx.notify_action_prepared(task)
+    active = ctx.get_resource("active", ResourceType.AGENT)
+    _run(active.submit(None, "p"))
+
+    if terminal == "failed":
+        active.pending_call_registry().track_pending_subagent_call("sid#pending")
+        ctx.notify_action_failed(task, RuntimeError("invocation failed"))
+    else:
+        getattr(ctx, f"notify_action_{terminal}")(task)
+
+    assert ctx._FlinkRunnerContext__prepared_namespace is None
+    assert active.pending_call_registry() is None
+    late = ctx.get_resource("late", ResourceType.AGENT)
+    assert late._current_namespace is None
+    with pytest.raises(RuntimeError, match="No prepared action task"):
+        _run(late.submit(None, "outside execution"))
+
+
+def test_failure_listener_cannot_block_identity_scoped_unbinding() -> None:
+    """A failing observer cannot stop cleanup or unbind an unrelated task."""
+
+    class FailingListener(TaskLifecycleListener):
+        def on_action_failed(self, task: Any, error: Any) -> None:
+            message = "listener failed"
+            raise RuntimeError(message)
+
+    ctx = _context("active", "late", "after-failure")
+    ctx.add_task_lifecycle_listener(FailingListener())
+    failed = _FakeTask(action_name="failed")
+    other = _FakeTask(action_name="other")
+    ctx.notify_action_prepared(failed)
+    active = ctx.get_resource("active", ResourceType.AGENT)
+    failed_registry = active.pending_call_registry()
+    failed_registry.track_pending_subagent_call("failed#pending")
+    ctx.notify_action_transferred(failed, failed)
+    ctx.notify_action_prepared(other)
+    other_registry = active.pending_call_registry()
+    other_registry.track_pending_subagent_call("other#pending")
+    recording = _RecordingListener()
+    ctx.add_task_lifecycle_listener(recording)
+
+    error = RuntimeError("invocation failed")
+    ctx.notify_action_failed(failed, error)
+    assert recording.calls == [("action_failed", failed, error)]
+    assert ctx._FlinkRunnerContext__prepared_namespace == Namespace.from_task(other)
+    assert active.pending_call_registry() is other_registry
+    late = ctx.get_resource("late", ResourceType.AGENT)
+    assert late._current_namespace == replace(
+        Namespace.from_task(other), subagent_name="late"
+    )
+
+    # Pemja may supply a new proxy for the same task on the failure callback.
+    other_proxy = _FakeTask(action_name="other")
+    ctx.notify_action_failed(other_proxy, error)
+    assert recording.calls[-1] == ("action_failed", other_proxy, error)
+    assert ctx._FlinkRunnerContext__prepared_namespace is None
+    assert active.pending_call_registry() is None
+    assert late.pending_call_registry() is None
+    assert active._per_task_registries[Namespace.from_task(failed).task_identity] is (
+        failed_registry
+    )
+    assert active._per_task_registries[Namespace.from_task(other).task_identity] is (
+        other_registry
+    )
+    with pytest.raises(RuntimeError, match="failed#pending"):
+        failed_registry.check_empty()
+    with pytest.raises(RuntimeError, match="other#pending"):
+        other_registry.check_empty()
+    after_failure = ctx.get_resource("after-failure", ResourceType.AGENT)
+    assert after_failure._current_namespace is None
+
+
+def test_failure_listener_errors_are_contained_and_the_guard_is_not_over_broad(
+    caplog: pytest.LogCaptureFixture,
+) -> None:
+    """A listener failure is logged and contained; cancellation escapes."""
+
+    class FailingListener(TaskLifecycleListener):
+        def on_action_failed(self, task: Any, error: Any) -> None:
+            message = "listener failed"
+            raise RuntimeError(message)
+
+    ctx = _context()
+    recording = _RecordingListener()
+    ctx.add_task_lifecycle_listener(FailingListener())
+    ctx.add_task_lifecycle_listener(recording)
+
+    error = RuntimeError("invocation failed")
+    ctx.notify_action_failed(_FakeTask(action_name="failed"), error)
+
+    # The guard still holds: a later listener is not starved by an earlier one.
+    assert len(recording.calls) == 1
+    # The warning with its traceback is the whole report: `error` is a pemja
+    # proxy, so nothing hung off it reaches the throwable Java rethrows.
+    assert "Task failure listener failed" in caplog.text
+    assert "listener failed" in caplog.text
+
+    class InterruptingListener(TaskLifecycleListener):
+        def on_action_failed(self, task: Any, error: Any) -> None:
+            raise KeyboardInterrupt
+
+    # KeyboardInterrupt is an operator's stop request rather than a listener bug,
+    # so the guard must let it through instead of swallowing it into a warning.
+    interrupting = _context()
+    interrupting.add_task_lifecycle_listener(InterruptingListener())
+    with pytest.raises(KeyboardInterrupt):
+        interrupting.notify_action_failed(
+            _FakeTask(action_name="failed"), RuntimeError("invocation failed")
+        )
+
+    class CancellingListener(TaskLifecycleListener):
+        def on_action_failed(self, task: Any, error: Any) -> None:
+            message = "handle cancelled"
+            raise CancelledError(message)
+
+    # Cancellation is control flow rather than a listener bug too, but unlike
+    # KeyboardInterrupt it derives from Exception, so it needs its own arm.
+    cancelling = _context()
+    cancelling.add_task_lifecycle_listener(CancellingListener())
+    with pytest.raises(CancelledError):
+        cancelling.notify_action_failed(
+            _FakeTask(action_name="failed"), RuntimeError("invocation failed")
+        )
+
+
 def test_registration_entry_registers_an_observing_listener() -> None:
     """The Java side registers a Python listener through the module entry."""
     from flink_agents.runtime import flink_runner_context as frc
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/async/AsyncExecutorThreadFactory.java b/runtime/src/main/java/org/apache/flink/agents/runtime/async/AsyncExecutorThreadFactory.java
index 14edc1e23..a06401db0 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/async/AsyncExecutorThreadFactory.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/async/AsyncExecutorThreadFactory.java
@@ -18,8 +18,8 @@
 package org.apache.flink.agents.runtime.async;
 
 import java.util.Objects;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
 
@@ -42,7 +42,13 @@ public final class AsyncExecutorThreadFactory implements ThreadFactory {
 
     private final ThreadFactory delegate = Executors.defaultThreadFactory();
     private final Runnable threadCleanup;
-    private final Queue<Thread> createdThreads = new ConcurrentLinkedQueue<>();
+
+    /**
+     * Workers that have not finished their exit cleanup yet. Each removes itself as it exits: a
+     * pool whose workers retire on an idle timeout and are then recreated would otherwise
+     * accumulate the whole run's threads here.
+     */
+    private final Set<Thread> liveThreads = ConcurrentHashMap.newKeySet();
 
     public AsyncExecutorThreadFactory() {
         this(() -> {});
@@ -70,11 +76,12 @@ public final class AsyncExecutorThreadFactory implements ThreadFactory {
                                     threadCleanup.run();
                                 } finally {
                                     ASYNC_EXECUTOR_THREAD.remove();
+                                    liveThreads.remove(Thread.currentThread());
                                 }
                             }
                         });
         thread.setName(NAME_PREFIX + thread.getName());
-        createdThreads.add(thread);
+        liveThreads.add(thread);
         return thread;
     }
 
@@ -82,7 +89,7 @@ public final class AsyncExecutorThreadFactory implements ThreadFactory {
     public void awaitThreadExit() {
         boolean interrupted = false;
         try {
-            for (Thread thread : createdThreads) {
+            for (Thread thread : liveThreads) {
                 while (thread.isAlive()) {
                     try {
                         thread.join();
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java b/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java
index d61fe390d..32d123444 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java
@@ -17,8 +17,10 @@
  */
 package org.apache.flink.agents.runtime.async;
 
-import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextRestorer;
+import org.apache.flink.agents.runtime.operator.parallel.ActionTaskLifecycleException;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextLifecycle;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionLock;
+import org.apache.flink.agents.runtime.operator.parallel.UncapturableException;
 
 import javax.annotation.Nullable;
 
@@ -33,16 +35,16 @@ import java.util.function.Supplier;
  * multi-release variant backed by the Continuation API).
  *
  * <p>On the parallel path a {@link ParallelExecutionLock} and {@link
- * ParallelExecutionContextRestorer} are wired in: {@link #executeAsync} releases the lock while the
- * blocking work runs inline, then re-acquires worker ownership and restores the runner context.
- * Without a lock it runs synchronously.
+ * ParallelExecutionContextLifecycle} are wired in: async calls suspend the task context before
+ * releasing the lock, then resume it after re-acquiring worker ownership. Blocking single calls run
+ * inline; batches run on managed workers. Without a lock no lifecycle callbacks run.
  */
 public class ContinuationActionExecutor {
 
     private final AsyncBatchExecutor batchExecutor;
 
     @Nullable private final ParallelExecutionLock parallelExecutionLock;
-    @Nullable private final ParallelExecutionContextRestorer contextRestorer;
+    @Nullable private final ParallelExecutionContextLifecycle contextLifecycle;
 
     /** Creates a new ContinuationActionExecutor. */
     public ContinuationActionExecutor(int numAsyncThreads) {
@@ -51,7 +53,7 @@ public class ContinuationActionExecutor {
 
     /**
      * Creates a new ContinuationActionExecutor. On the JDK&lt;21 parallel MVP path both {@code
-     * parallelExecutionLock} and {@code contextRestorer} are supplied; otherwise they are {@code
+     * parallelExecutionLock} and {@code contextLifecycle} are supplied; otherwise they are {@code
      * null} and {@link #executeAsync} runs synchronously.
      *
      * <p>Batches use a separate managed pool so action workers waiting for their children cannot
@@ -61,10 +63,10 @@ public class ContinuationActionExecutor {
             int numAsyncThreads,
             Runnable threadCleanup,
             @Nullable ParallelExecutionLock parallelExecutionLock,
-            @Nullable ParallelExecutionContextRestorer contextRestorer) {
+            @Nullable ParallelExecutionContextLifecycle contextLifecycle) {
         this.batchExecutor = new AsyncBatchExecutor(numAsyncThreads, threadCleanup);
         this.parallelExecutionLock = parallelExecutionLock;
-        this.contextRestorer = contextRestorer;
+        this.contextLifecycle = contextLifecycle;
     }
 
     /**
@@ -96,13 +98,7 @@ public class ContinuationActionExecutor {
             return supplier.get();
         }
 
-        parallelExecutionLock.checkReentrant();
-        parallelExecutionLock.release();
-        try {
-            return supplier.get();
-        } finally {
-            reacquireAndRestore(context);
-        }
+        return executeWithLockHandoff(context, supplier::get);
     }
 
     /**
@@ -126,23 +122,53 @@ public class ContinuationActionExecutor {
             return batchExecutor.execute(suppliers, timeout, maxParallelism);
         }
 
+        return executeWithLockHandoff(
+                context, () -> batchExecutor.execute(suppliers, timeout, maxParallelism));
+    }
+
+    /**
+     * Runs {@code supplier} with the execution lock handed off: the task context is suspended and
+     * the lock released so the mailbox and other workers can progress, then worker ownership is
+     * re-acquired at this task's priority and its context resumed before control returns to the
+     * caller.
+     *
+     * <p>A suspend or resume failure is a framework fault, not a business result, so it surfaces as
+     * an {@link ActionTaskLifecycleException} inside its {@link UncapturableException} shell and
+     * never as the supplier's own outcome. A resume failure after a supplier failure keeps the
+     * supplier failure as the suppressed cause.
+     */
+    private <T> T executeWithLockHandoff(ContinuationContext context, Callable<T> supplier)
+            throws Exception {
         parallelExecutionLock.checkReentrant();
+        try {
+            contextLifecycle.suspend(context.getKey(), context.getActionTask());
+        } catch (Throwable failure) {
+            throw ActionTaskLifecycleException.suspendFailed(failure);
+        }
         parallelExecutionLock.release();
+        Throwable supplierFailure = null;
         try {
-            return batchExecutor.execute(suppliers, timeout, maxParallelism);
+            return supplier.call();
+        } catch (Throwable failure) {
+            supplierFailure = failure;
+            throw failure;
         } finally {
-            reacquireAndRestore(context);
+            reacquireWorkerOwnership(context);
+            try {
+                contextLifecycle.resume(context.getKey(), context.getActionTask());
+            } catch (Throwable failure) {
+                throw ActionTaskLifecycleException.resumeFailed(failure, supplierFailure);
+            }
         }
     }
 
     /**
-     * Re-acquires worker ownership and restores the runner context. An interrupt flag left set by
-     * the call (for example by code that re-interrupts after catching {@link InterruptedException})
-     * must not discard its outcome, so the flag is cleared for the wait and restored afterward. A
-     * new interrupt during the wait, such as the coordinator's shutdown interrupts, still aborts
-     * it.
+     * Re-acquires worker ownership at this task's priority. An interrupt flag left set by the call
+     * (for example by code that re-interrupts after catching {@link InterruptedException}) must not
+     * discard its outcome, so the flag is cleared for the wait and restored afterward. A new
+     * interrupt during the wait, such as the coordinator's shutdown interrupts, still aborts it.
      */
-    private void reacquireAndRestore(ContinuationContext context) throws InterruptedException {
+    private void reacquireWorkerOwnership(ContinuationContext context) throws InterruptedException {
         boolean interrupted = Thread.interrupted();
         try {
             parallelExecutionLock.acquireByWorker(context.getRecordIndex(), context.getTaskIndex());
@@ -151,7 +177,6 @@ public class ContinuationActionExecutor {
                 Thread.currentThread().interrupt();
             }
         }
-        contextRestorer.restore(context.getKey(), context.getActionTask());
     }
 
     /**
@@ -181,4 +206,14 @@ public class ContinuationActionExecutor {
     public static boolean isContinuationSupported() {
         return false;
     }
+
+    /**
+     * Whether an async wait can hand the shared execution lock off, so the operator can dispatch
+     * other work while this worker blocks. This is the JDK&lt;21 parallel engine's substitute for
+     * yielding a continuation: a caller waiting on a child graph keeps its worker but stops holding
+     * the operator, which is what lets the child run and complete.
+     */
+    public boolean canHandOffExecutionLock() {
+        return parallelExecutionLock != null;
+    }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationNativeCallable.java b/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationNativeCallable.java
index d9bd89e36..20e4d1947 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationNativeCallable.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/async/ContinuationNativeCallable.java
@@ -29,6 +29,6 @@ import org.apache.flink.agents.api.context.DurableCallable;
  * callable marked here awaits by yielding, so the worker pool stays free for the callee.
  *
  * <p>Only meaningful on JDK 21+, where the continuation the callable yields is the caller's; the
- * callers that produce such callables gate on {@code requireMailboxSuspension} beforehand.
+ * callers that produce such callables gate on {@code requireReleasableOperator} beforehand.
  */
 public interface ContinuationNativeCallable<T> extends DurableCallable<T> {}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatCallManager.java b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatCallManager.java
deleted file mode 100644
index c1db8158c..000000000
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatCallManager.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.agents.runtime.chat;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import org.apache.flink.agents.api.Event;
-import org.apache.flink.agents.api.context.Outcome;
-import org.apache.flink.agents.api.event.ChatRequestEvent;
-import org.apache.flink.agents.api.event.ChatResponseEvent;
-import org.apache.flink.agents.runtime.context.RunnerContextImpl;
-import org.apache.flink.agents.runtime.memory.EventAttachmentUtils;
-import org.apache.flink.agents.runtime.subgraph.SubgraphCallManager;
-import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
-import org.apache.flink.util.Preconditions;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Optional;
-import java.util.UUID;
-
-/**
- * Mailbox-confined chat adapter over the operator's common subgraph registry.
- *
- * <p>Supplies request identity, caller memory/resource scope and the durable terminal-response
- * slot. Routing, completion accounting and active invocation lookup belong to the subgraph runtime.
- */
-public final class ChatCallManager {
-    private static final ObjectMapper OBJECT_MAPPER =
-            new ObjectMapper().registerModule(new JavaTimeModule());
-
-    private final SubgraphCallManager calls;
-
-    public ChatCallManager() {
-        this(new SubgraphCallManager());
-    }
-
-    public ChatCallManager(SubgraphCallManager calls) {
-        this.calls = calls;
-    }
-
-    /** Starts/replays a call on the action thread. Python uses the same persisted event format. */
-    public String prepareCall(RunnerContextImpl context, String requestJson) throws Exception {
-        context.checkMailboxThread();
-        ChatCallOwner owner = context.getChatContext().getOwner();
-        Preconditions.checkState(owner != null, "Chat calls must be awaited inside an action");
-        ChatRequestEvent supplied = (ChatRequestEvent) Event.fromJson(requestJson);
-        String id = owner.nextCallId();
-        Optional<Outcome<ChatResponseEvent>> cached =
-                context.tryGetCachedResult("builtin-chat:" + id, ChatResponseEvent.class);
-        // Replayed responses keep their original request id; use the same id to validate them.
-        // This is chat request/response correlation, not the subgraph's ActionState identity.
-        UUID requestId = UUID.nameUUIDFromBytes(id.getBytes(StandardCharsets.UTF_8));
-        RunnerContextImpl.MemoryContext memory = context.getMemoryContext();
-        ChatInvocation call =
-                new ChatInvocation(
-                        id,
-                        owner,
-                        requestId,
-                        context.currentPlan(),
-                        new RunnerContextImpl.MemoryContext(
-                                memory.getSensoryMemStore(), memory.getShortTermMemStore()),
-                        context.getResourceScope(),
-                        cached.isPresent());
-        calls.register(call);
-        if (cached.isPresent()) {
-            call.complete(cached.get().getValue());
-        } else {
-            ChatRequestEvent request = new ChatRequestEvent(requestId, supplied.getAttributes());
-            request.getAttachments().putAll(supplied.getAttachments());
-            EventAttachmentUtils.storeEventAttachments(request, context);
-            // Start a nested graph; the caller remains in flight while awaiting its result.
-            context.addPendingEvent(new SubgraphEvent(id, request, true));
-        }
-        return id;
-    }
-
-    /**
-     * Returns null while pending; persists only terminal ChatResponseEvents, never runtime errors.
-     * The serialized response is also the Python bridge's wire format.
-     */
-    public String tryCompleteCall(RunnerContextImpl context, String id) throws Exception {
-        context.checkMailboxThread();
-        ChatInvocation call = get(id);
-        if (!call.isDone()) {
-            return null;
-        }
-        ChatResponseEvent response = call.awaitResponse();
-        if (!call.isReplayed()) {
-            context.recordDurableCompletion("builtin-chat:" + id, response, null);
-        }
-        String json = OBJECT_MAPPER.writeValueAsString(response);
-        calls.remove(id);
-        return json;
-    }
-
-    public ChatInvocation get(String id) {
-        return (ChatInvocation) calls.get(id);
-    }
-
-    public void clear() {
-        calls.clear();
-    }
-
-    /** Also releases handles abandoned by user code before it finishes processing a record. */
-    public void finishRecord(Object key) {
-        calls.finishRecord(key);
-    }
-}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatCallOwner.java b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatCallOwner.java
deleted file mode 100644
index 36759ec5a..000000000
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatCallOwner.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.agents.runtime.chat;
-
-import org.apache.flink.agents.api.Event;
-import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
-
-/**
- * Caller key and chat-call counter for one action execution: one action processing one event. This
- * is not an action definition, an executor, or the state of an individual chat invocation. Multiple
- * chat calls issued during that execution share this owner, but each has its own {@link
- * ChatInvocation}.
- *
- * <p>The action task's context creates and retains this object. Suspending and resuming the action,
- * including transferring its context to a generated successor task, preserves the same owner.
- * Switching the shared runner context to another action installs that action's owner instead.
- *
- * <p>{@link #nextCallId()} assigns deterministic IDs from the caller's key, sequence number, action
- * name, event, and call ordinal. On failure recovery this owner is recreated; replaying the same
- * caller facts and call order reproduces the same call IDs for durable-result lookup. The owner
- * itself is not checkpointed. The caller key also lets the manager clean up abandoned calls when
- * record processing finishes.
- *
- * <p>Call ID allocation is confined to the action/mailbox thread.
- */
-public final class ChatCallOwner {
-    private final DeterministicIdAllocator ids;
-    private final Object key;
-
-    /**
-     * Creates a fresh runtime owner with a deterministic namespace for its chat calls.
-     *
-     * @param key the caller's keyed record, also used to clean up abandoned calls
-     * @param sequenceNumber the caller action task's sequence number
-     * @param actionName the caller action's name
-     * @param event the event being processed by the caller action
-     */
-    public ChatCallOwner(Object key, long sequenceNumber, String actionName, Event event) {
-        this.key = key;
-        ids = new DeterministicIdAllocator(key, sequenceNumber, actionName, event, "builtin-chat");
-    }
-
-    /** Returns the next replay-stable chat invocation ID; advances this owner's call ordinal. */
-    String nextCallId() {
-        return ids.nextSessionId();
-    }
-
-    /** Returns the caller's key for record-scoped cleanup by {@link ChatCallManager}. */
-    Object getKey() {
-        return key;
-    }
-}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatContext.java b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatContext.java
deleted file mode 100644
index b34a77e6b..000000000
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatContext.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.agents.runtime.chat;
-
-/**
- * Chat-related context bound to one action execution. The task retains this object across
- * suspension and passes it to generated continuation tasks. When switching or restoring tasks, the
- * shared runner context replaces its reference as a unit.
- *
- * <p>The manager is shared by all tasks in the operator, including Java and Python tasks. The owner
- * keeps the current action's call counter and key. The enclosing graph invocation is maintained
- * separately by the common subgraph runtime, including for built-in Chat/Tool actions.
- *
- * <p>This class only groups references; it neither manages calls nor checkpoints their state. The
- * references are fixed, while their targets retain their own runtime state and lifecycle.
- */
-public final class ChatContext {
-    private final ChatCallManager manager;
-    private final ChatCallOwner owner;
-
-    public ChatContext(ChatCallManager manager, ChatCallOwner owner) {
-        this.manager = manager;
-        this.owner = owner;
-    }
-
-    /** Returns the operator-wide manager, not a manager created for this action. */
-    public ChatCallManager getManager() {
-        return manager;
-    }
-
-    /** Returns the call counter and key belonging to this action execution. */
-    public ChatCallOwner getOwner() {
-        return owner;
-    }
-}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatDurableFuture.java b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatDurableFuture.java
new file mode 100644
index 000000000..04910b29d
--- /dev/null
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatDurableFuture.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.chat;
+
+import org.apache.flink.agents.api.chat.messages.ChatResult;
+import org.apache.flink.agents.api.context.DurableFuture;
+import org.apache.flink.agents.api.event.ChatRequestEvent;
+import org.apache.flink.agents.api.event.ChatResponseEvent;
+import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
+import org.apache.flink.agents.runtime.subgraph.SubgraphExecution;
+
+/** Durable chat future for use within its creating action execution. */
+public final class ChatDurableFuture implements DurableFuture<ChatResult> {
+    private final JavaRunnerContextImpl context;
+    private final ChatRequestEvent request;
+    private ChatResponseEvent response;
+
+    public ChatDurableFuture(JavaRunnerContextImpl context, ChatRequestEvent request) {
+        context.checkMailboxThread();
+        this.context = context;
+        this.request = request;
+    }
+
+    @Override
+    public ChatResult await() throws Exception {
+        context.checkMailboxThread();
+        if (response == null) {
+            // Its own statement ahead of building the invocation: folded into one expression,
+            // invocationFor(context) would evaluate first and fail on an uninitialized context.
+            SubgraphExecution.requireReleasableOperator(context);
+            String id =
+                    SubgraphExecution.prepare(
+                            context, ChatSubgraphDefinition.invocationFor(context), request);
+            SubgraphExecution.await(context, id);
+            response = SubgraphExecution.finish(context, id);
+        }
+        return response.getResponse();
+    }
+}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatInvocation.java b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatInvocation.java
deleted file mode 100644
index 0b1702f3d..000000000
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatInvocation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.agents.runtime.chat;
-
-import org.apache.flink.agents.api.event.ChatResponseEvent;
-import org.apache.flink.agents.plan.AgentPlan;
-import org.apache.flink.agents.runtime.context.RunnerContextImpl;
-import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
-
-import java.util.UUID;
-import java.util.concurrent.ExecutionException;
-
-/**
- * Typed chat result adapter on the common subgraph lifecycle. The coordinator, not this adapter,
- * owns routing, action accounting and completion. The replay flag prevents recording an already
- * durable response a second time.
- */
-public final class ChatInvocation extends SubgraphInvocation<ChatResponseEvent> {
-    private final UUID requestId;
-    private final boolean replayed;
-
-    ChatInvocation(
-            String id,
-            ChatCallOwner owner,
-            UUID requestId,
-            AgentPlan plan,
-            RunnerContextImpl.MemoryContext memory,
-            RunnerContextImpl.ResourceScope resourceScope,
-            boolean replayed) {
-        super(
-                id,
-                owner.getKey(),
-                new ChatSubgraphDefinition(plan, requestId),
-                memory,
-                resourceScope);
-        this.requestId = requestId;
-        this.replayed = replayed;
-    }
-
-    public UUID getRequestId() {
-        return requestId;
-    }
-
-    boolean isReplayed() {
-        return replayed;
-    }
-
-    public ChatResponseEvent awaitResponse() throws InterruptedException, ExecutionException {
-        return awaitResult();
-    }
-
-    /** Installs an already recorded response without dispatching the graph. */
-    public void complete(ChatResponseEvent event) {
-        if (!requestId.equals(event.getRequestId())) {
-            throw new IllegalStateException("Chat response does not match its request");
-        }
-        replay(event);
-    }
-}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinition.java b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinition.java
index 5b210b309..79a45fe73 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinition.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinition.java
@@ -24,22 +24,86 @@ import org.apache.flink.agents.api.event.ToolRequestEvent;
 import org.apache.flink.agents.api.event.ToolResponseEvent;
 import org.apache.flink.agents.plan.AgentPlan;
 import org.apache.flink.agents.plan.actions.Action;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
+import org.apache.flink.agents.runtime.memory.MemoryScope;
 import org.apache.flink.agents.runtime.subgraph.SubgraphDefinition;
+import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
+
+import javax.annotation.Nullable;
 
 import java.util.List;
 import java.util.Objects;
-import java.util.UUID;
 
 /**
- * Chat's private routing table and exactly-one-response contract, independent of resource scope.
+ * The built-in chat graph: one request in, exactly one response out. Its routing table, its result
+ * contract, the caller's environment it runs in, and the entry point that mints one call's
+ * identity.
+ *
+ * <p>The response is not matched against a request id: the delegate's id is not replay-stable, so
+ * identity comes from the invocation the response was routed through.
  */
-final class ChatSubgraphDefinition implements SubgraphDefinition<ChatResponseEvent> {
+public final class ChatSubgraphDefinition implements SubgraphDefinition<ChatResponseEvent> {
+
     private final AgentPlan plan;
-    private final UUID requestId;
 
-    ChatSubgraphDefinition(AgentPlan plan, UUID requestId) {
+    ChatSubgraphDefinition(AgentPlan plan) {
         this.plan = plan;
-        this.requestId = requestId;
+    }
+
+    /**
+     * Discriminates chat calls among the targets of the caller's id allocation, and names the
+     * durable slot holding their terminal response. One word for both, so an id can never be
+     * assigned under a target other than the one its result is recorded in.
+     */
+    @Override
+    public String kind() {
+        return "builtin-chat";
+    }
+
+    /**
+     * Builds the call answering one chat request for the action executing on {@code context}. The
+     * request itself is the call's payload, handed to {@link
+     * org.apache.flink.agents.runtime.subgraph.SubgraphExecution} separately so that a replay —
+     * which never emits — never has to be given one. The id comes from the executing action's id
+     * allocation, so a replay mints the same id and looks up the same durable slot.
+     */
+    public static SubgraphInvocation<ChatResponseEvent> invocationFor(RunnerContextImpl context) {
+        ChatSubgraphDefinition definition = new ChatSubgraphDefinition(context.currentPlan());
+        DeterministicIdAllocator ids = context.idAllocator(definition.kind());
+        String id = ids.nextSessionId();
+        return definition.newInvocation(context, id, context.getRecordKey());
+    }
+
+    @Override
+    public Class<ChatResponseEvent> resultClass() {
+        return ChatResponseEvent.class;
+    }
+
+    /**
+     * The caller's request, kept under its own id so the response names the request the caller
+     * holds. A copy rather than the caller's object because the emit path offloads the delegate's
+     * attachments in place.
+     */
+    @Override
+    public Event inputEvent(Object input) {
+        ChatRequestEvent request = (ChatRequestEvent) input;
+        ChatRequestEvent delegate = new ChatRequestEvent(request.getId(), request.getAttributes());
+        delegate.getAttachments().putAll(request.getAttachments());
+        return delegate;
+    }
+
+    /** A chat graph runs in its caller's environment and reads its caller's memory. */
+    @Override
+    public SubgraphInvocation<ChatResponseEvent> newInvocation(
+            RunnerContextImpl context, String id, @Nullable Object key) {
+        RunnerContextImpl.MemoryContext memory = context.getMemoryContext();
+        return new SubgraphInvocation<>(
+                id,
+                key,
+                this,
+                new MemoryScope(memory.getSensoryMemStore(), memory.getShortTermMemStore()),
+                context.getResourceScope());
     }
 
     @Override
@@ -69,10 +133,6 @@ final class ChatSubgraphDefinition implements SubgraphDefinition<ChatResponseEve
             throw new IllegalStateException(
                     "Chat subgraph requires exactly one response, got " + outputs.size());
         }
-        ChatResponseEvent response = ChatResponseEvent.fromEvent(outputs.get(0));
-        if (!requestId.equals(response.getRequestId())) {
-            throw new IllegalStateException("Chat response does not match its request");
-        }
-        return response;
+        return ChatResponseEvent.fromEvent(outputs.get(0));
     }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/context/ChatDurableFuture.java b/runtime/src/main/java/org/apache/flink/agents/runtime/context/ChatDurableFuture.java
deleted file mode 100644
index 30586f2f2..000000000
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/context/ChatDurableFuture.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.agents.runtime.context;
-
-import org.apache.flink.agents.api.Event;
-import org.apache.flink.agents.api.chat.messages.ChatResult;
-import org.apache.flink.agents.api.context.DurableFuture;
-import org.apache.flink.agents.api.event.ChatRequestEvent;
-import org.apache.flink.agents.api.event.ChatResponseEvent;
-import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
-import org.apache.flink.agents.runtime.chat.ChatCallManager;
-import org.apache.flink.agents.runtime.chat.ChatInvocation;
-
-/** Durable chat future for use within its creating action execution. */
-final class ChatDurableFuture implements DurableFuture<ChatResult> {
-    private final JavaRunnerContextImpl context;
-    private final ChatCallManager calls;
-    private final String requestJson;
-    private ChatResponseEvent response;
-
-    ChatDurableFuture(JavaRunnerContextImpl context, ChatRequestEvent request) {
-        context.mailboxThreadChecker.run();
-        this.context = context;
-        this.calls = context.getChatContext().getManager();
-        try {
-            this.requestJson = RunnerContextImpl.OBJECT_MAPPER.writeValueAsString(request);
-        } catch (Exception e) {
-            throw new IllegalArgumentException("Chat request is not serializable", e);
-        }
-    }
-
-    @Override
-    public ChatResult await() throws Exception {
-        context.mailboxThreadChecker.run();
-        if (response == null) {
-            if (!ContinuationActionExecutor.isContinuationSupported()
-                    || context.getContinuationContext() == null
-                    || context.getContinuationExecutor() == null) {
-                throw new UnsupportedOperationException(
-                        "Java chat calls require the JDK 21 continuation runtime");
-            }
-            String id = calls.prepareCall(context, requestJson);
-            // Capture the invocation on the action thread: the async worker must not read the
-            // shared runner context or invocation table while another action is using them.
-            ChatInvocation pending = calls.get(id);
-            if (!pending.isDone()) {
-                // Like internal sub-agents, wait on an async worker while the action yields.
-                // ChatCallManager owns replay and persistence; do not add a second durable slot.
-                context.resolveAsync(pending::awaitResponse);
-            }
-            response = (ChatResponseEvent) Event.fromJson(calls.tryCompleteCall(context, id));
-        }
-        return response.getResponse();
-    }
-}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImpl.java b/runtime/src/main/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImpl.java
index 45618bbc4..c7893f6c2 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImpl.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImpl.java
@@ -31,6 +31,7 @@ import org.apache.flink.agents.runtime.async.BatchExecutionResult;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
 import org.apache.flink.agents.runtime.async.ContinuationContext;
 import org.apache.flink.agents.runtime.async.ContinuationNativeCallable;
+import org.apache.flink.agents.runtime.chat.ChatDurableFuture;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
 
 import java.time.Duration;
@@ -354,7 +355,7 @@ public class JavaRunnerContextImpl extends RunnerContextImpl {
     }
 
     @Override
-    protected <T> T resolveAsync(Callable<T> callable) throws Exception {
+    public <T> T resolveAsync(Callable<T> callable) throws Exception {
 
         Supplier<T> wrappedSupplier =
                 () -> {
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java b/runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java
index 20bff3cf5..971fbb9a5 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java
@@ -30,9 +30,12 @@ import org.apache.flink.agents.api.context.MemoryObject;
 import org.apache.flink.agents.api.context.MemoryUpdate;
 import org.apache.flink.agents.api.context.Outcome;
 import org.apache.flink.agents.api.context.RunnerContext;
+import org.apache.flink.agents.api.event.ChatRequestEvent;
+import org.apache.flink.agents.api.event.ChatResponseEvent;
 import org.apache.flink.agents.api.memory.BaseLongTermMemory;
 import org.apache.flink.agents.api.resource.Resource;
 import org.apache.flink.agents.api.resource.ResourceType;
+import org.apache.flink.agents.api.subagent.SubagentResult;
 import org.apache.flink.agents.api.trace.ExecutionReporter;
 import org.apache.flink.agents.api.trace.TraceContext;
 import org.apache.flink.agents.api.trace.TraceRecord;
@@ -44,24 +47,29 @@ import org.apache.flink.agents.plan.utils.JsonUtils;
 import org.apache.flink.agents.runtime.ResourceCache;
 import org.apache.flink.agents.runtime.actionstate.ActionState;
 import org.apache.flink.agents.runtime.actionstate.CallResult;
-import org.apache.flink.agents.runtime.chat.ChatContext;
+import org.apache.flink.agents.runtime.chat.ChatSubgraphDefinition;
 import org.apache.flink.agents.runtime.lifecycle.ComponentExecutionListener;
 import org.apache.flink.agents.runtime.memory.CachedMemoryStore;
 import org.apache.flink.agents.runtime.memory.EventAttachmentUtils;
 import org.apache.flink.agents.runtime.memory.InteranlBaseLongTermMemory;
-import org.apache.flink.agents.runtime.memory.IsolatedCachedMemoryStore;
 import org.apache.flink.agents.runtime.memory.MemoryEventBuilder;
 import org.apache.flink.agents.runtime.memory.MemoryEventSettings;
 import org.apache.flink.agents.runtime.memory.MemoryObjectImpl;
 import org.apache.flink.agents.runtime.memory.MemoryValueObservation;
 import org.apache.flink.agents.runtime.metrics.BuiltInMetrics;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.operator.parallel.UncapturableException;
+import org.apache.flink.agents.runtime.subagent.InternalSubagentInvocation;
 import org.apache.flink.agents.runtime.subagent.InternalSubagentSetup;
 import org.apache.flink.agents.runtime.subgraph.SubgraphCallManager;
 import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
+import org.apache.flink.agents.runtime.subgraph.SubgraphExecution;
 import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
+import org.apache.flink.agents.runtime.utils.IdAllocatorSource;
 import org.apache.flink.annotation.Internal;
 import org.apache.flink.util.Preconditions;
+import org.apache.flink.util.function.ThrowingRunnable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -70,7 +78,6 @@ import javax.annotation.Nullable;
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
@@ -133,16 +140,6 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
         public CachedMemoryStore getSensoryMemStore() {
             return sensoryMemStore;
         }
-
-        /**
-         * Builds the isolated memory context for one internal sub-agent call. The child does not
-         * share memory with its caller, so the stores start empty and are not seeded from any
-         * parent view.
-         */
-        public static MemoryContext createChildContext() {
-            return new MemoryContext(
-                    new IsolatedCachedMemoryStore(), new IsolatedCachedMemoryStore());
-        }
     }
 
     /**
@@ -199,19 +196,27 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
      */
     @Nullable private ResourceScope resourceScope;
 
-    /** Current action's chat context, replaced as a unit on each task switch or restore. */
-    @Nullable private ChatContext chatContext;
+    /**
+     * The raw key of the record the current task belongs to; see {@link #switchActionContext} for
+     * why it is kept beside {@link #contextKey} rather than derived from it.
+     */
+    @Nullable private Object recordKey;
+
+    /**
+     * The current action's id counters, replaced on each task switch or restore. Owned by {@code
+     * ActionTaskContextManager}; this is only the reference the executing action reads through,
+     * exactly as for the memory context.
+     */
+    @Nullable private IdAllocatorSource idAllocatorSource;
 
     @Nullable private SubgraphInvocation<?> subgraphInvocation;
     private SubgraphCallManager subgraphCalls = new SubgraphCallManager();
 
     /**
-     * Index of the internal sub-agent setups owning a bootstrapped call session, keyed by session
-     * id. Populated by {@link InternalSubagentSetup#bootstrap} so {@link #awaitSubagentCall} can
-     * resolve the owning setup off the mailbox thread without depending on the scope currently
-     * wired onto this shared context.
+     * Starts a call's graph as soon as it is issued, installed only by an engine whose actions
+     * never yield. See {@link #dispatchSubgraphBootstrap()}.
      */
-    private final Map<String, InternalSubagentSetup> internalCallOwners = new HashMap<>();
+    @Nullable private ThrowingRunnable<Exception> subgraphBootstrapDispatcher;
 
     /** Textual key shared by long-term-memory isolation and framework observation events. */
     protected String contextKey;
@@ -272,16 +277,17 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
     }
 
     /**
-     * Bootstraps an internal sub-agent call by scope name, without blocking.
+     * Issues an internal sub-agent call by scope name, without waiting for it.
      *
      * <p>Cross-language (Python) entry point invoked over pemja: the Python side cannot hold a Java
      * setup instance, so it passes the resource scope and this method resolves the materialized
      * {@link InternalSubagentSetup} from the cache in effect (a nested call resolves against the
-     * caller's child plan). Must run on the mailbox thread (it sends the bootstrap event); the
-     * caller subsequently offloads {@link #awaitSubagentCall} onto a Python async worker so the
-     * mailbox stays free to dispatch the child agent's actions.
+     * caller's child plan). Must run on the mailbox thread. Issuing reads the caller's durable
+     * slot, so a replay returns without starting the child graph; the caller then polls {@link
+     * #tryCompleteInternalSubagentCall}, yielding the mailbox between polls so the operator can
+     * dispatch the child agent's actions.
      */
-    public void bootstrapSubagentCallForScope(
+    public void bootstrapInternalSubagentCallForScope(
             String scope, String sessionId, String callId, Object prompt) throws Exception {
         Resource resource = getResource(scope, ResourceType.AGENT);
         Preconditions.checkState(
@@ -294,33 +300,19 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
     }
 
     /**
-     * Blocks until the internal sub-agent call identified by {@code (sessionId, callId)} completes
-     * and returns its accumulated output.
+     * Takes the result of the internal sub-agent call issued under {@code (sessionId, callId)} as
+     * JSON, or returns {@code null} while its child graph still runs so the caller can yield the
+     * mailbox and poll again.
      *
-     * <p>Cross-language (Python) entry point invoked over pemja off the mailbox thread; resolves
-     * the owning setup through the session index rather than the currently wired scope.
+     * <p>Cross-language (Python) entry point invoked over pemja on the mailbox thread. A child
+     * failure comes back inside that JSON rather than being thrown, so the bridge needs no catch
+     * that would also fold this call's own persistence failure into the child's answer.
      */
-    public List<Object> awaitSubagentCall(String sessionId, String callId) throws Exception {
-        InternalSubagentSetup owner = internalCallOwners.get(sessionId);
-        Preconditions.checkNotNull(
-                owner,
-                "No internal sub-agent call registered for sessionId=%s, callId=%s",
-                sessionId,
-                callId);
-        return owner.awaitSubagentCall(sessionId, callId);
-    }
-
-    /**
-     * Registers the setup owning a call session; invoked by {@link
-     * InternalSubagentSetup#bootstrap}.
-     */
-    public void registerInternalCallOwner(String sessionId, InternalSubagentSetup setup) {
-        internalCallOwners.put(sessionId, setup);
-    }
-
-    /** Drops the session index entry; invoked by the owning setup when its record finishes. */
-    public void unregisterInternalCallOwner(String sessionId) {
-        internalCallOwners.remove(sessionId);
+    @Nullable
+    public String tryCompleteInternalSubagentCall(String sessionId, String callId)
+            throws Exception {
+        SubagentResult result = InternalSubagentInvocation.tryComplete(this, sessionId, callId);
+        return result == null ? null : OBJECT_MAPPER.writeValueAsString(result);
     }
 
     /**
@@ -356,9 +348,58 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
         return subgraphInvocation;
     }
 
-    /** Installs the current task's chat context, or clears it when none is attached. */
-    public void setChatContext(@Nullable ChatContext chatContext) {
-        this.chatContext = chatContext;
+    /**
+     * The raw key of the caller's record, for a subgraph invocation to carry into record-scoped
+     * cleanup. Null outside an executing action.
+     */
+    @Nullable
+    public Object getRecordKey() {
+        return recordKey;
+    }
+
+    /** Installs the current task's id counters, or clears them when it carries none. */
+    public void setIdAllocatorSource(@Nullable IdAllocatorSource idAllocatorSource) {
+        this.idAllocatorSource = idAllocatorSource;
+    }
+
+    /** The current action's id counters, read back by a transfer to hand them to its successor. */
+    @Nullable
+    public IdAllocatorSource getIdAllocatorSource() {
+        return idAllocatorSource;
+    }
+
+    /**
+     * The id counter of the executing action for one call target — a named sub-agent, or the
+     * built-in chat graph's own namespace.
+     */
+    public DeterministicIdAllocator idAllocator(String targetName) {
+        return Preconditions.checkNotNull(
+                        idAllocatorSource, "Id allocation requires an executing action")
+                .allocator(targetName);
+    }
+
+    /**
+     * Issues a chat call from its serialized request and returns the id its response is polled
+     * under.
+     *
+     * <p>Cross-language (Python) entry point invoked over pemja on the mailbox thread, and the chat
+     * adapter for {@link SubgraphExecution#prepare}. Issuing reads the caller's durable slot, so a
+     * replay returns without starting the chat graph; what remains chat's here is the wire format.
+     */
+    public String prepareChatCall(String requestJson) throws Exception {
+        ChatRequestEvent request = (ChatRequestEvent) Event.fromJson(requestJson);
+        return SubgraphExecution.prepare(this, ChatSubgraphDefinition.invocationFor(this), request);
+    }
+
+    /**
+     * Returns the serialized response of the chat call {@code id}, or {@code null} while its graph
+     * still runs so the caller can yield the mailbox and poll again. Only terminal responses are
+     * persisted, never runtime errors; the serialized response is also the bridge's wire format.
+     */
+    @Nullable
+    public String tryCompleteChatCall(String id) throws Exception {
+        ChatResponseEvent response = SubgraphExecution.tryFinish(this, id);
+        return response == null ? null : OBJECT_MAPPER.writeValueAsString(response);
     }
 
     /** Checks thread confinement for runtime components accessing this shared context. */
@@ -366,15 +407,20 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
         mailboxThreadChecker.run();
     }
 
-    /** Returns the current action's chat context, also used by the Python bridge. */
-    public ChatContext getChatContext() {
-        return Preconditions.checkNotNull(chatContext, "Chat calls require an executing action");
-    }
-
+    /**
+     * Points this shared context at one action execution.
+     *
+     * <p>The record's key arrives in both forms because they are not interconvertible here: {@code
+     * recordKey} is the operator's raw Flink key, which a subgraph invocation carries so that
+     * record-scoped cleanup can match it with {@code Objects.equals}, while {@code contextKey} is
+     * the resolved string form whose derivation depends on the input language and on whether a
+     * Python key arrived pickled.
+     */
     public void switchActionContext(
             String actionName,
             MemoryContext memoryContext,
             List<Event> pendingEvents,
+            @Nullable Object recordKey,
             String contextKey,
             @Nullable String observationId,
             boolean observationSuppressed,
@@ -382,11 +428,13 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
         this.actionName = actionName;
         this.memoryContext = memoryContext;
         this.pendingEvents = pendingEvents;
+        this.recordKey = recordKey;
         this.contextKey = contextKey;
         this.observationId = observationId;
         this.observationSuppressed = observationSuppressed;
         this.ltmObservationEnabled = !observationSuppressed && ltmObservationConfigured;
         this.executionReportingContext = executionReportingContext;
+        this.subgraphBootstrapDispatcher = null;
         if (ltm != null) {
             ltm.switchContext(contextKey, observationId, observationSuppressed);
         }
@@ -437,6 +485,27 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
         pendingEvents.add(event);
     }
 
+    /**
+     * Starts the graph of a call issued from this action, if the running engine needs that done
+     * before the action finishes. An engine that suspends actions leaves this a no-op, because the
+     * operator drains the bootstrap when it drains the caller's yield; an engine that runs an
+     * action to completion in one turn installs a dispatcher instead.
+     */
+    public void dispatchSubgraphBootstrap() throws Exception {
+        if (subgraphBootstrapDispatcher != null) {
+            subgraphBootstrapDispatcher.run();
+        }
+    }
+
+    /**
+     * Installs the dispatcher {@link #dispatchSubgraphBootstrap()} runs. Cleared on every action
+     * context switch, so a binding never leaks from one task to the next on this shared context.
+     */
+    public void setSubgraphBootstrapDispatcher(
+            @Nullable ThrowingRunnable<Exception> subgraphBootstrapDispatcher) {
+        this.subgraphBootstrapDispatcher = subgraphBootstrapDispatcher;
+    }
+
     public List<Event> drainEventsAtActionYield(Long timestamp) {
         mailboxThreadChecker.run();
         List<Event> events = new ArrayList<>();
@@ -856,7 +925,12 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
         return new SingleAsyncFuture<>(this, Preconditions.checkNotNull(callable));
     }
 
-    protected <T> T resolveAsync(Callable<T> callable) throws Exception {
+    /**
+     * Runs one blocking call through this engine's async mechanism and returns its result. Public
+     * because {@code SubgraphExecution} offloads a graph-call wait through it on an engine that has
+     * no continuation to yield.
+     */
+    public <T> T resolveAsync(Callable<T> callable) throws Exception {
         return callable.call();
     }
 
@@ -934,6 +1008,10 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
                 }
                 throw e;
             }
+            // A framework fault is not this call's outcome, so it is not recorded as one.
+            if (UncapturableException.isUncapturable(e)) {
+                throw e;
+            }
             exception = e;
         }
 
@@ -1300,6 +1378,10 @@ public class RunnerContextImpl implements RunnerContext, ExecutionReporter {
                 }
                 throw e;
             }
+            // A framework fault is not this call's outcome, so it is not recorded as one.
+            if (UncapturableException.isUncapturable(e)) {
+                throw e;
+            }
             exception = e;
         }
 
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/ComponentExecutionListener.java b/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/ComponentExecutionListener.java
index 5136fbb2b..7fecdb507 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/ComponentExecutionListener.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/ComponentExecutionListener.java
@@ -30,8 +30,9 @@ import org.apache.flink.agents.api.trace.TraceRecord;
  * <p>Invariants a listener may rely on, and must not break:
  *
  * <ul>
- *   <li>Callbacks for an operator are serialized by the runtime's execution context. They may run
- *       on the mailbox thread or on a worker holding the execution lock.
+ *   <li>Callbacks are serialized within one operator: on the mailbox thread for cooperative
+ *       execution, or under the execution lock for parallel execution. No fixed thread affinity is
+ *       guaranteed.
  *   <li>An exception thrown by a listener is logged and swallowed, so reporting never fails the
  *       reporting component and never starves the remaining listeners.
  *   <li>The call's identity and relationship to its containing Action are populated before the
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListener.java b/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListener.java
index 9a3e339fa..157eaa2b8 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListener.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListener.java
@@ -23,19 +23,24 @@ import org.apache.flink.agents.runtime.operator.ActionTask;
 /**
  * Observes the per-record and per-action lifecycle of {@code ActionExecutionOperator}.
  *
- * <p>All callbacks run on the mailbox thread.
+ * <p>Callbacks are serialized within one operator: on the mailbox thread for cooperative execution,
+ * or under the execution lock for parallel execution. No fixed thread affinity is guaranteed.
  *
  * <p>Event pairing semantics:
  *
  * <ul>
  *   <li>{@code onRecordStart}/{@code onRecordFinished} bracket the processing of one input record
- *       for a key; a record that triggers no actions emits neither callback.
- *   <li>{@code onActionPrepared} fires on every preparation of an action task, including
- *       re-preparation of a suspended or resumed task, and pairs with exactly one of the terminal
- *       callbacks: {@code onActionFinishing} followed by {@code onActionFinished} on normal
- *       completion, {@code onActionReused} when a replay skips an already-completed action, {@code
- *       onActionFailed} when the invocation fails, or {@code onActionTransferred} when a
- *       non-finished task hands its contexts over to the task it generated.
+ *       for a key. The bracket is unconditional: it depends on the record being admitted and
+ *       retired, not on whether any action ran, so a record that triggers no actions still emits
+ *       both.
+ *   <li>{@code onActionPrepared} marks entry into each execution phase after the task's contexts
+ *       are bound, not necessarily another invocation of its body. The phase ends with {@code
+ *       onActionFinishing} followed by {@code onActionFinished} on normal completion, {@code
+ *       onActionReused} when a replay skips an already-completed action, or {@code
+ *       onActionTransferred} when the task yields execution. A transfer may retain the same task,
+ *       including a worker-to-mailbox handoff.
+ *   <li>{@code onActionFailed} reports that processing a task failed. It is not a phase exit and
+ *       does not imply an open phase.
  *   <li>{@code onActionStarted} fires at most once per action execution, before the first real
  *       invocation and never on a re-preparation; the gate is checkpointed with the task, so a
  *       failover replay re-emits {@code onRecordStart} for the resumed round but not {@code
@@ -48,18 +53,18 @@ import org.apache.flink.agents.runtime.operator.ActionTask;
 public interface TaskLifecycleListener {
 
     /**
-     * The first action task of the input record of {@code key} has just been created and is about
-     * to be prepared. Also re-emitted when the task chain of a record that was in flight at
-     * snapshot time resumes after a failover, so listeners observe a paired bracket for the
-     * replayed round.
+     * The input record of {@code key} has been admitted for processing and is about to trigger its
+     * actions, if it triggers any. Also re-emitted when the task chain of a record that was in
+     * flight at snapshot time resumes after a failover, so listeners observe a paired bracket for
+     * the replayed round.
      *
      * @param key the Flink key of the input record starting processing.
      */
     default void onRecordStart(Object key) {}
 
     /**
-     * An action task's runner context has been wired up and the task is ready to run. Fires on
-     * every preparation, including re-preparation of a suspended or resumed task.
+     * An action task's contexts are fully bound for the execution phase it is entering. Fires again
+     * after a handoff or suspension; the phase need not invoke the action body again.
      *
      * @param task the prepared action task.
      */
@@ -74,12 +79,12 @@ public interface TaskLifecycleListener {
     default void onActionStarted(ActionTask task) {}
 
     /**
-     * A non-finished task handed its per-task contexts to the task it generated. Listeners that
-     * keep per-task bookkeeping must move their entries from {@code from} to {@code to} so the
-     * continuation keeps its state.
+     * A task is yielding execution. Listeners unbind it and move per-task bookkeeping from {@code
+     * from} to {@code to}, preserving it unchanged when both are the same task. What comes next is
+     * {@code onActionPrepared} for a further phase, or {@code onActionFailed}.
      *
-     * @param from the finishing task whose contexts were transferred.
-     * @param to the generated task that inherited the contexts.
+     * @param from the task yielding execution.
+     * @param to the task retaining the contexts for its next execution phase.
      */
     default void onActionTransferred(ActionTask from, ActionTask to) {}
 
@@ -110,19 +115,23 @@ public interface TaskLifecycleListener {
     default void onActionReused(ActionTask task) {}
 
     /**
-     * An action invocation failed. Purely observational: listeners perceive the failure for
+     * Processing an action task failed. Purely observational: listeners perceive the failure for
      * logging, metrics, or bookkeeping cleanup, but must not compensate or decide on rethrowing.
      *
+     * <p>Not a phase exit, and it does not imply an open phase: a task that failed after a transfer
+     * arrives here with no {@code onActionPrepared} in between, so cleanup must tolerate a task it
+     * already unbound.
+     *
      * @param task the failed action task.
-     * @param error the failure thrown by the invocation.
+     * @param error the task processing failure.
      */
     default void onActionFailed(ActionTask task, Throwable error) {}
 
     /**
      * Every task spawned by the input record of {@code key} has completed and the record is fully
-     * processed. Implementations must make their per-record cleanup idempotent: after a failover
-     * replay the notification may not be delivered again for records that completed before the
-     * snapshot.
+     * processed; a record that spawned none is retired here as well. Implementations must make
+     * their per-record cleanup idempotent: after a failover replay the notification may not be
+     * delivered again for records that completed before the snapshot.
      *
      * @param key the Flink key of the finished input record.
      */
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/memory/MemoryScope.java b/runtime/src/main/java/org/apache/flink/agents/runtime/memory/MemoryScope.java
new file mode 100644
index 000000000..37c424f68
--- /dev/null
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/memory/MemoryScope.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.memory;
+
+/**
+ * The sensory/short-term store pair one scoped run reads and writes through.
+ *
+ * <p>Carrying the stores rather than a whole memory context keeps the per-action update and
+ * observation journal out of the scope: the journal belongs to whichever action is executing, while
+ * the stores are what a scope shares across its actions.
+ */
+public final class MemoryScope {
+    private final CachedMemoryStore sensoryMemStore;
+    private final CachedMemoryStore shortTermMemStore;
+
+    public MemoryScope(CachedMemoryStore sensoryMemStore, CachedMemoryStore shortTermMemStore) {
+        this.sensoryMemStore = sensoryMemStore;
+        this.shortTermMemStore = shortTermMemStore;
+    }
+
+    /**
+     * Self-contained stores: nothing is seeded from a parent view and writes never reach durable
+     * state. This is the internal sub-agent's policy.
+     */
+    public static MemoryScope isolated() {
+        return new MemoryScope(new IsolatedCachedMemoryStore(), new IsolatedCachedMemoryStore());
+    }
+
+    public CachedMemoryStore getSensoryMemStore() {
+        return sensoryMemStore;
+    }
+
+    public CachedMemoryStore getShortTermMemStore() {
+        return shortTermMemStore;
+    }
+}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java
index b05f30231..471da6ebc 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java
@@ -31,7 +31,8 @@ import org.apache.flink.agents.plan.AgentPlan;
 import org.apache.flink.agents.plan.JavaFunction;
 import org.apache.flink.agents.plan.PythonFunction;
 import org.apache.flink.agents.plan.actions.Action;
-import org.apache.flink.agents.plan.resourceprovider.PythonResourceProvider;
+import org.apache.flink.agents.plan.resourceprovider.ResourceProvider;
+import org.apache.flink.agents.plan.subagent.InternalSubagentPlans;
 import org.apache.flink.agents.plan.utils.CancellationUtils;
 import org.apache.flink.agents.runtime.ResourceCache;
 import org.apache.flink.agents.runtime.actionstate.ActionState;
@@ -101,8 +102,10 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import java.util.function.IntPredicate;
+import java.util.stream.Collectors;
 
 import static org.apache.flink.agents.api.configuration.AgentConfigOptions.JOB_IDENTIFIER;
+import static org.apache.flink.agents.plan.actions.Utils.requiredVersions;
 import static org.apache.flink.agents.plan.actions.Utils.supportAsync;
 import static org.apache.flink.util.Preconditions.checkArgument;
 import static org.apache.flink.util.Preconditions.checkNotNull;
@@ -129,6 +132,9 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
     /** Idle time after which a surplus parallel-execution worker thread retires (min pool is 1). */
     private static final long WORKER_IDLE_TIMEOUT_MS = 60_000L;
 
+    /** How often a pre-barrier quiesce that has not finished repeats its warning. */
+    private static final long QUIESCE_WARN_INTERVAL_MS = 30_000L;
+
     private static final String INTERNAL_NOOP_INPUT_ACTION_NAME =
             "__flink_agents_internal_noop_input_action";
 
@@ -164,14 +170,55 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 && agentPlan.getConfig().get(AgentExecutionOptions.PARALLEL_EXECUTION_ENABLED)
                 && agentPlan.getActions().values().stream()
                         .allMatch(action -> action.getExec() instanceof JavaFunction)
-                && (!usesPythonResource(agentPlan) || supportAsync());
+                && (pythonOwnedResourceNames(agentPlan).isEmpty() || supportAsync());
+    }
+
+    /**
+     * Rejects a child plan this engine cannot run: a worker cannot execute a Python action at all,
+     * and a Python-owned resource needs the cross-language async support {@link
+     * #shouldEnableParallelExecutionWithoutCoroutine} screens only the root plan for.
+     */
+    static void checkChildPlansRunOnParallelEngine(AgentPlan agentPlan) {
+        for (Map<String, ResourceProvider> providersByName :
+                agentPlan.getResourceProviders().values()) {
+            for (ResourceProvider provider : providersByName.values()) {
+                Optional<AgentPlan> child = InternalSubagentPlans.plan(provider);
+                if (!child.isPresent()) {
+                    continue;
+                }
+                for (Action action : child.get().getActions().values()) {
+                    checkState(
+                            action.getExec() instanceof JavaFunction,
+                            "The parallel execution engine runs an internal sub-agent's child"
+                                    + " actions on workers that cannot execute Python, but action"
+                                    + " %s of scope %s is not a Java action. Run this agent on JDK"
+                                    + " 21, or remove that action from the scope.",
+                            action.getName(),
+                            provider.getName());
+                }
+                List<String> pythonResources = pythonOwnedResourceNames(child.get());
+                checkState(
+                        pythonResources.isEmpty() || supportAsync(),
+                        "The parallel execution engine calls an internal sub-agent's Python-owned"
+                                + " resource across languages, but scope %s declares %s and this"
+                                + " Flink version cannot execute such a call asynchronously."
+                                + " Upgrade Flink past %s, or remove that resource from the scope.",
+                        provider.getName(),
+                        pythonResources,
+                        requiredVersions);
+                // The plan tree is a DAG because cycles are rejected at compile time.
+                checkChildPlansRunOnParallelEngine(child.get());
+            }
+        }
     }
 
-    /** Whether the plan declares any Python resource. */
-    private static boolean usesPythonResource(AgentPlan agentPlan) {
+    /** Names of the resources this plan declares that the Python runtime constructs. */
+    private static List<String> pythonOwnedResourceNames(AgentPlan agentPlan) {
         return agentPlan.getResourceProviders().values().stream()
                 .flatMap(providersByName -> providersByName.values().stream())
-                .anyMatch(provider -> provider instanceof PythonResourceProvider);
+                .filter(ResourceProvider::isPythonOwned)
+                .map(ResourceProvider::getName)
+                .collect(Collectors.toList());
     }
 
     private final AgentPlan agentPlan;
@@ -194,6 +241,17 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
 
     @Nullable private transient ParallelExecutionCoordinator executionCoordinator;
 
+    /**
+     * Checkpoint whose pre-barrier quiesce is in progress, or {@code null}. Lets an abort recognize
+     * the drain it belongs to, so one for an older checkpoint cannot end a later drain. This and
+     * {@link #drainAborted} are mailbox-thread state: Flink delivers checkpoint notifications as
+     * mails.
+     */
+    @Nullable private transient Long drainingCheckpointId;
+
+    /** Set by an abort for {@link #drainingCheckpointId}; ends that drain's quiesce wait. */
+    private transient boolean drainAborted;
+
     /**
      * Number of input records currently being processed (one per active key), compared against
      * {@link #maxInFlightInputRecords} to apply input backpressure. Maintained on the mailbox
@@ -332,6 +390,7 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 shouldEnableParallelExecutionWithoutCoroutine(
                         agentPlan, ContinuationActionExecutor.isContinuationSupported());
         if (parallelExecutionWithoutCoroutineEnabled) {
+            checkChildPlansRunOnParallelEngine(agentPlan);
             parallelExecutionLock = new ParallelExecutionLock();
         } else {
             // JDK21 cooperative-continuation path: there is no worker pool and no lock. All
@@ -363,7 +422,7 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                             mailboxExecutor::execute,
                             Work::new,
                             pythonBridge::releaseCurrentThreadInterpreter,
-                            numAsyncThreads,
+                            ParallelExecutionCoordinator.workerCeiling(numAsyncThreads),
                             WORKER_IDLE_TIMEOUT_MS);
         }
 
@@ -538,15 +597,21 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
     private void processActionOutputEvent(
             Object key, String contextKey, Event outputEvent, ActionTask actionTask)
             throws Exception {
-        TraceContext actionTraceContext = actionTask.getTraceContext();
-        TraceContext eventTraceContext =
-                TraceContext.forEvent(
-                        actionTraceContext,
-                        outputEvent.getType(),
-                        outputEvent.getId().toString(),
-                        (String) actionTraceContext.getEntityMetadata().get("triggerEventId"),
-                        actionTraceContext.getEntityName());
-        processEvent(key, contextKey, outputEvent, eventTraceContext);
+        processEvent(
+                key,
+                contextKey,
+                outputEvent,
+                actionOutputEventTraceContext(actionTask.getTraceContext(), outputEvent));
+    }
+
+    private static TraceContext actionOutputEventTraceContext(
+            TraceContext actionTraceContext, Event event) {
+        return TraceContext.forEvent(
+                actionTraceContext,
+                event.getType(),
+                event.getId().toString(),
+                (String) actionTraceContext.getEntityMetadata().get("triggerEventId"),
+                actionTraceContext.getEntityName());
     }
 
     /** Processes an Event whose identity and source references are already populated. */
@@ -597,6 +662,12 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 }
                 stateManager.addProcessingKey(key);
                 stateManager.initOrIncSequenceNumber();
+                if (freshRecordRound) {
+                    // Announced once the record's own bookkeeping is in place and before anything
+                    // it triggers, so a listener never sees this record's action callbacks outside
+                    // the bracket: emitting the begin event can already hand a task to a worker.
+                    notifyRecordStart(key);
+                }
                 tryEmitAgentRunBeginEvent(key, contextKey, event, eventTraceContext);
             }
             // We then obtain the triggered action and add ActionTasks to the waiting processing
@@ -611,10 +682,6 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                                     event,
                                     stateManager.getSequenceNumber(),
                                     eventTraceContext));
-                    if (freshRecordRound) {
-                        notifyRecordStart(key);
-                        freshRecordRound = false;
-                    }
                     if (parallelExecutionWithoutCoroutineEnabled) {
                         // Add one task node per queued task; a worker pulls+prepares it later.
                         executionCoordinator.addTask(key);
@@ -725,10 +792,9 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
 
         lastCommitted.actionTask.getRunnerContext().clearSensoryMemory();
         durableExecManager.updateLastCompletedSequenceNumber(lastCommitted.sequenceNumber);
-        // Mirror the serial path: notify record finished. Noop rounds stay silent.
-        if (!isInternalNoopInputAction(lastCommitted.actionTask.action)) {
-            notifyRecordFinished(key);
-        }
+        // The bracket belongs to the record, so a round retired by the internal noop reports its
+        // finish too.
+        notifyRecordFinished(key);
         int removedCount = stateManager.removeProcessingKey(key);
         inFlightInputRecords--;
         checkState(
@@ -758,7 +824,13 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
 
             ActionTask actionTask = pollNextActionTask();
             if (actionTask == null) {
+                // This record triggered no action but was still admitted, so it retires the way a
+                // round that ran retires: close the bracket, give back the in-flight budget, mark
+                // the input run completed. A round whose only task was the internal noop, which the
+                // parallel engine synthesizes, never reaches here.
+                notifyRecordFinished(key);
                 int removedCount = stateManager.removeProcessingKey(key);
+                inFlightInputRecords--;
                 checkState(
                         removedCount == 1,
                         "Current processing key count for key "
@@ -790,18 +862,6 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
             throws Exception {
         // 2. Invoke the action task.
         long sequenceNumber = stateManager.getSequenceNumber();
-        // A resumed child action already carries its scope (transferred across the suspend);
-        // create it only on first dispatch. Computed before the context is wired so the shared
-        // context is scope-aware for the whole invocation.
-        RunnerContextImpl.ResourceScope resourceScope = null;
-        if (actionTask.isSubgraphEvent()) {
-            SubgraphEvent envelope = (SubgraphEvent) actionTask.event;
-            resourceScope =
-                    contextManager
-                            .getSubgraphCalls()
-                            .get(envelope.getInvocationId())
-                            .getResourceScope();
-        }
         contextManager.createAndSetRunnerContext(
                 actionTask,
                 contextKey,
@@ -814,7 +874,6 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 stateManager.getShortTermMemState(),
                 pythonBridge.getPythonRunnerContext(),
                 ltm,
-                resourceScope,
                 this::createExecutionReportingContext);
         notifyActionPrepared(actionTask);
 
@@ -891,13 +950,11 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                                 actionTask
                                 .new ActionTaskResult(
                                         true,
-                                        actionTask.validateOutputEvents(
-                                                List.of(
-                                                        new SubgraphEvent(
-                                                                envelope.getInvocationId(),
-                                                                new SubgraphFailureEvent(
-                                                                        actionFailure),
-                                                                false))),
+                                        List.of(
+                                                new SubgraphEvent(
+                                                        envelope.getInvocationId(),
+                                                        new SubgraphFailureEvent(actionFailure),
+                                                        false)),
                                         null);
                     } else {
                         try {
@@ -1167,10 +1224,10 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
         // memory and would be lost on restore): pause dispatch, then yield without the lock
         // until everything in flight has committed.
         try {
+            drainingCheckpointId = checkpointId;
+            drainAborted = false;
             executionCoordinator.startDraining();
-            while (!executionCoordinator.isQuiesced()) {
-                mailboxExecutor.yield();
-            }
+            awaitQuiesce(checkpointId);
             super.prepareSnapshotPreBarrier(checkpointId);
         } catch (Exception e) {
             // A failed pre-barrier never reaches snapshotState's stopDraining; resume dispatch.
@@ -1180,6 +1237,43 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 e.addSuppressed(resumeFailure);
             }
             throw e;
+        } finally {
+            // No quiesce is in progress after this point, so an abort for this checkpoint arriving
+            // during the capture finds nothing to end.
+            drainingCheckpointId = null;
+        }
+    }
+
+    /**
+     * Waits, without the execution lock, until every pulled task has committed. Dispatch stays
+     * paused for the whole wait, so one action blocked in an async call that never returns holds it
+     * open until the checkpoint itself dies. That death reaches the operator as an abort mail,
+     * which this loop yields, so an aborted drain fails here naming the pool state instead of
+     * leaving the mailbox spinning silently.
+     */
+    private void awaitQuiesce(long checkpointId) throws Exception {
+        long lastWarnMillis = System.currentTimeMillis();
+        while (!executionCoordinator.isQuiesced()) {
+            if (drainAborted) {
+                throw new IllegalStateException(
+                        String.format(
+                                "Checkpoint %d was aborted while the parallel execution engine was"
+                                        + " still waiting for in-flight actions to commit before the"
+                                        + " barrier. Dispatch stays paused during that wait, so an"
+                                        + " action blocked in an async call that never returns holds"
+                                        + " it open until the checkpoint dies. Pool state: %s",
+                                checkpointId, executionCoordinator.diagnostics()));
+            }
+            long nowMillis = System.currentTimeMillis();
+            if (nowMillis - lastWarnMillis >= QUIESCE_WARN_INTERVAL_MS) {
+                lastWarnMillis = nowMillis;
+                LOG.warn(
+                        "Checkpoint {} is still waiting for in-flight actions to commit before the"
+                                + " barrier. Pool state: {}",
+                        checkpointId,
+                        executionCoordinator.diagnostics());
+            }
+            mailboxExecutor.yield();
         }
     }
 
@@ -1234,6 +1328,13 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
     @Override
     public void notifyCheckpointAborted(long checkpointId) throws Exception {
         if (parallelExecutionWithoutCoroutineEnabled) {
+            Long draining = drainingCheckpointId;
+            if (draining != null && draining.longValue() == checkpointId) {
+                // This notification is one of the mails the quiesce loop yields, so flagging it
+                // here is what lets that loop stop waiting for a checkpoint that will never be
+                // taken. The loop's failure path resumes dispatch.
+                drainAborted = true;
+            }
             runWithParallelExecutionLock(() -> notifyCheckpointAbortedInternal(checkpointId));
         } else {
             notifyCheckpointAbortedInternal(checkpointId);
@@ -1537,12 +1638,13 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                     continue;
                 }
                 eventRouter.getKeySegmentQueue().addKeyToLastSegment(key);
+                // Align with the task-level replay: re-emit the record start for the resumed round
+                // so listeners observe a paired start/finished bracket as well. Emitted before
+                // either engine dispatches, so no callback for this record can precede it.
+                notifyRecordStart(key);
                 if (parallelExecutionWithoutCoroutineEnabled) {
                     // Restored tasks were never enqueued through processEvent: add one node per
                     // queued task; the worker-completion path finishes the input (no kick mail).
-                    // No sub-agent child reaches this engine: the parallel path requires
-                    // continuations to be unsupported (JDK < 21), where InternalSubagentSetup
-                    // fails fast, so the root-only filter above never drops anything here.
                     setCurrentKey(key);
                     int queued = stateManager.countActionTasks();
                     for (int i = 0; i < queued; i++) {
@@ -1552,9 +1654,6 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                     // The normal engine has no workers; the kick mail drives
                     // processActionTaskForKey.
                     String contextKey = resolveContextKey(key);
-                    // Align with the task-level replay: re-emit the record start for the resumed
-                    // round so listeners observe a paired start/finished bracket as well.
-                    notifyRecordStart(key);
                     mailboxExecutor.submit(
                             () -> tryProcessActionTaskForKey(key, contextKey, null),
                             "process action task");
@@ -1600,12 +1699,112 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
         }
     }
 
+    /**
+     * Closes the task's execution phase before its worker releases the lock, so the phase's
+     * lifecycle pairing survives a handoff to another worker or to the mailbox. The task keeps its
+     * contexts; only its claim on the shared runner context is given up.
+     */
+    void suspendParallelAction(ActionTask task) {
+        parallelExecutionLock.checkReentrant();
+        checkState(contextManager.isLifecycleActive(task), "Action is not active.");
+        contextManager.setLifecycleActive(task, false);
+        notifyActionTransferred(task, task);
+    }
+
+    /**
+     * Reopens the task's execution phase after ownership is re-acquired: rebinds the shared context
+     * to the task, then re-emits preparation for the phase about to run.
+     */
+    void resumeParallelAction(Object key, ActionTask task) {
+        parallelExecutionLock.checkReentrant();
+        checkState(!contextManager.isLifecycleActive(task), "Action is already active.");
+        contextManager.restore(key, task);
+        prepareParallelAction(task);
+    }
+
+    private void prepareParallelAction(ActionTask task) {
+        // The synthetic noop input action stays lifecycle-silent.
+        if (!isInternalNoopInputAction(task.action)) {
+            // Framework state first, then the announcement: onActionPrepared says this task's
+            // execution phase is open, so the flag suspend/resume check must already say so.
+            contextManager.setLifecycleActive(task, true);
+            notifyActionPrepared(task);
+        }
+    }
+
+    /**
+     * Installs the parallel engine's subgraph bootstrap dispatcher on a freshly bound task context.
+     *
+     * <p>Under continuations a caller that issues a graph call yields next and the operator
+     * dispatches the bootstrap when it drains that yield. This engine runs an action to completion
+     * in one turn, so there is no yield to drain and the graph has to start at issue time or the
+     * caller waits for one the operator was never told to start. Only bootstrap events go early;
+     * ordinary graph events stay buffered until the action completes.
+     */
+    void installParallelSubgraphBootstrap(ActionTask task) {
+        if (!parallelExecutionWithoutCoroutineEnabled) {
+            return;
+        }
+        RunnerContextImpl context = task.getRunnerContext();
+        ContinuationContext continuation = contextManager.getContinuationContext(task);
+        context.setSubgraphBootstrapDispatcher(
+                () -> {
+                    parallelExecutionLock.checkReentrant();
+                    for (Event event :
+                            task.validateOutputEvents(
+                                    context.drainEventsAtActionYield(
+                                            task.getEvent().getSourceTimestamp()))) {
+                        dispatchParallelSubgraphEvent(
+                                task,
+                                (SubgraphEvent) event,
+                                continuation.getRecordIndex(),
+                                continuation.getTaskIndex());
+                    }
+                });
+    }
+
+    /**
+     * Routes one call event on the parallel engine: registers every action the invocation matches,
+     * then submits each as a dependent action. Dependents commit independently of the root FIFO, so
+     * a caller blocked waiting for its graph cannot hold up the very commits that complete it.
+     */
+    private void dispatchParallelSubgraphEvent(
+            ActionTask caller, SubgraphEvent envelope, long recordIndex, long taskIndex)
+            throws Exception {
+        SubgraphInvocation<?> call =
+                contextManager.getSubgraphCalls().get(envelope.getInvocationId());
+        TraceContext eventTraceContext =
+                actionOutputEventTraceContext(caller.getTraceContext(), envelope);
+        eventRouter.notifyEventProcessed(envelope, eventTraceContext);
+        List<Action> actions = call.dispatch(envelope.getDelegate());
+        for (Action action : actions) {
+            checkState(
+                    action.getExec() instanceof JavaFunction,
+                    "Parallel graph calls require Java actions, but %s is not.",
+                    action.getName());
+        }
+        for (Action action : actions) {
+            ActionTask child =
+                    createActionTask(
+                            caller.getKey(),
+                            action,
+                            envelope,
+                            caller.getSequenceNumber(),
+                            eventTraceContext);
+            executionCoordinator.addDependentTask(
+                    new Work(child), caller.getKey(), recordIndex, taskIndex);
+        }
+    }
+
     /**
      * A single action task's full worker lifecycle on the parallel engine: a pool thread {@code
      * setup}s and {@code execute}s it under the lock; the mailbox thread later restores and commits
      * it. All task-specific processing lives here; the operator keeps only mailbox flow.
      */
     private final class Work implements ParallelExecutionTask {
+        /** A dependent action's task, or {@code null} for a root work that pulls its own. */
+        @Nullable private final ActionTask submittedTask;
+
         private Object key;
         private long recordIndex;
         private long taskIndex;
@@ -1615,9 +1814,22 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
         private long sequenceNumber;
         private boolean replayCompletedAction;
 
+        /**
+         * Whether this work's action reports lifecycle callbacks (the noop input action does not).
+         */
+        private boolean lifecyclePrepared;
+
         @Nullable private ActionTask.ActionTaskResult result;
         @Nullable private Throwable failure;
 
+        private Work() {
+            this(null);
+        }
+
+        private Work(@Nullable ActionTask submittedTask) {
+            this.submittedTask = submittedTask;
+        }
+
         @Override
         public void setup(Object key, long recordIndex, long taskIndex) {
             this.key = key;
@@ -1633,8 +1845,9 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 // taskIndex keeps the (taskIndex, task) binding correct across concurrent workers.
                 // createAndSetRunnerContext already binds the context on this thread.
                 setCurrentKey(key);
-                ActionTask task = pollNextActionTask();
+                ActionTask task = submittedTask == null ? pollNextActionTask() : submittedTask;
                 checkState(task != null, "Action task queue was empty.");
+                this.actionTask = task;
 
                 contextManager.createAndSetRunnerContext(
                         task,
@@ -1648,17 +1861,10 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                         stateManager.getShortTermMemState(),
                         pythonBridge.getPythonRunnerContext(),
                         ltm,
-                        // The parallel engine runs only without continuation support, which
-                        // internal sub-agents require, so a sub-agent event never reaches this
-                        // path and there is no scope to bind here.
-                        null,
                         ActionExecutionOperator.this::createExecutionReportingContext);
 
-                // The synthetic noop input action stays lifecycle-silent.
-                boolean lifecycleVisible = !isInternalNoopInputAction(task.action);
-                if (lifecycleVisible) {
-                    notifyActionPrepared(task);
-                }
+                lifecyclePrepared = !isInternalNoopInputAction(task.action);
+                prepareParallelAction(task);
 
                 long seq = stateManager.getSequenceNumber();
                 ActionState state =
@@ -1685,12 +1891,16 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 context.setKey(key);
                 context.setActionTask(task);
                 context.setPriority(recordIndex, taskIndex);
+                // Bound after the priority, so a call this action issues dispatches its graph at
+                // this work's priority.
+                installParallelSubgraphBootstrap(task);
 
-                this.actionTask = task;
                 this.sequenceNumber = seq;
                 this.replayCompletedAction = replay;
 
                 // Run: replay a durably-completed action from its persisted state, or invoke it.
+                // A failure is reported by commit(), not here: the suspend below closes this
+                // worker's phase, and the failure belongs to the mailbox phase that surfaces it.
                 if (replay) {
                     MemoryUpdateReplayer.replay(
                             task.getRunnerContext().getShortTermMemory(),
@@ -1698,12 +1908,12 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                     MemoryUpdateReplayer.replay(
                             task.getRunnerContext().getSensoryMemory(),
                             state.getSensoryMemoryUpdates());
-                    if (lifecycleVisible) {
-                        notifyActionReused(task);
-                    }
-                    result = task.new ActionTaskResult(true, state.getOutputEvents(), null);
+                    result =
+                            task
+                            .new ActionTaskResult(
+                                    true, completedActionOutputEvents(task, state), null);
                 } else {
-                    if (lifecycleVisible) {
+                    if (lifecyclePrepared) {
                         notifyActionStarted(task);
                     }
                     try {
@@ -1715,23 +1925,47 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                                         getRuntimeContext().getUserCodeClassLoader(),
                                         pythonBridge.getPythonActionExecutor());
                     } catch (Throwable actionFailure) {
-                        try {
-                            task.getRunnerContext().discardMemoryObservation();
-                        } catch (Throwable discardFailure) {
-                            if (discardFailure != actionFailure) {
-                                actionFailure.addSuppressed(discardFailure);
-                            }
+                        // Both writes below go through the shared context, so a worker that no
+                        // longer holds the execution lock must make neither: shutdown can interrupt
+                        // re-acquisition before the caller context is restored, and a handoff that
+                        // raises a framework fault may have left the context bound to another task.
+                        if (!parallelExecutionLock.isHeldByCurrentThread()) {
+                            throw actionFailure;
                         }
-                        if (lifecycleVisible) {
+                        if (task.isSubgraphEvent()
+                                && contextManager
+                                        .getSubgraphCalls()
+                                        .get(((SubgraphEvent) task.event).getInvocationId())
+                                        .capturesActionFailure(actionFailure)) {
+                            // Journal the terminal failure before completing the call. Root
+                            // replay must not reinterpret a completed failed child as a
+                            // successful empty graph.
+                            SubgraphEvent envelope = (SubgraphEvent) task.event;
+                            LOG.warn(
+                                    "Action {} failed in subgraph {}",
+                                    task.action.getName(),
+                                    envelope.getInvocationId(),
+                                    actionFailure);
+                            result =
+                                    task
+                                    .new ActionTaskResult(
+                                            true,
+                                            List.of(
+                                                    new SubgraphEvent(
+                                                            envelope.getInvocationId(),
+                                                            new SubgraphFailureEvent(actionFailure),
+                                                            false)),
+                                            null);
+                        } else {
                             try {
-                                notifyActionFailed(task, actionFailure);
-                            } catch (Throwable notifyFailure) {
-                                if (notifyFailure != actionFailure) {
-                                    actionFailure.addSuppressed(notifyFailure);
+                                task.getRunnerContext().discardMemoryObservation();
+                            } catch (Throwable discardFailure) {
+                                if (discardFailure != actionFailure) {
+                                    actionFailure.addSuppressed(discardFailure);
                                 }
                             }
+                            throw actionFailure;
                         }
-                        throw actionFailure;
                     }
                 }
             } catch (Throwable t) {
@@ -1739,19 +1973,28 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 if (CancellationUtils.isInterruption(t)) {
                     Thread.currentThread().interrupt();
                 }
+            } finally {
+                // Close this work's execution phase before the lock is handed back, so it pairs
+                // with the preparation commit() re-emits instead of leaking into it.
+                if (parallelExecutionLock.isHeldByCurrentThread()
+                        && lifecyclePrepared
+                        && contextManager.isLifecycleActive(actionTask)) {
+                    try {
+                        suspendParallelAction(actionTask);
+                    } catch (Throwable transferFailure) {
+                        // The body's failure came first and is why this task failed at all, so it
+                        // stays primary and the cleanup failure is suppressed -- the ordering
+                        // try-with-resources gives a close() failure.
+                        if (failure == null) {
+                            failure = transferFailure;
+                        } else if (failure != transferFailure) {
+                            failure.addSuppressed(transferFailure);
+                        }
+                    }
+                }
             }
         }
 
-        @Override
-        public void restoreContext() {
-            parallelExecutionLock.checkReentrant();
-            if (failure != null) {
-                // Preparation failed before a context existed; commit() will rethrow the failure.
-                return;
-            }
-            contextManager.restore(key, actionTask);
-        }
-
         @Override
         public boolean isDone() {
             return result != null || failure != null;
@@ -1759,26 +2002,33 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
 
         @Override
         public void commit() throws Exception {
-            if (failure != null) {
-                throw new ActionTaskExecutionException("Failed to execute action task", failure);
-            }
-            checkState(result != null, "Action task completion result must not be null.");
-            // On this engine an action always finishes in one invoke (the base executor runs
-            // durableExecuteAsync inline); an unfinished result would mean the Loom overlay or a
-            // non-Java task leaked in — fail fast rather than run an untested branch.
-            checkState(
-                    result.isFinished(),
-                    "Parallel-engine action did not finish in one invoke: %s",
-                    actionTask.action.getName());
-
-            // The synthetic noop input action stays lifecycle-silent.
-            boolean lifecycleVisible = !isInternalNoopInputAction(actionTask.action);
+            parallelExecutionLock.checkReentrant();
             try {
+                if (failure != null) {
+                    if (actionTask != null) {
+                        builtInMetrics.markInputRunFailed(
+                                actionTask.getTraceContext().getInputRunId());
+                    }
+                    throw failure;
+                }
+                // Reopen the phase execute() closed before handing the lock back. This also rebinds
+                // the shared context and Flink key per head, which the commit drain needs: it walks
+                // a whole key group, so a head must not inherit the previous head's binding.
+                resumeParallelAction(key, actionTask);
+                checkState(result != null, "Action task completion result must not be null.");
+                // On this engine an action always finishes in one invoke (the base executor runs
+                // durableExecuteAsync inline); an unfinished result would mean the Loom overlay or
+                // a non-Java task leaked in — fail fast rather than run an untested branch.
+                checkState(
+                        result.isFinished(),
+                        "Parallel-engine action did not finish in one invoke: %s",
+                        actionTask.action.getName());
+
                 contextManager.removeContexts(actionTask);
                 durableExecManager.removeDurableContext(actionTask);
 
                 if (!replayCompletedAction) {
-                    if (lifecycleVisible) {
+                    if (lifecyclePrepared) {
                         notifyActionFinishing(actionTask);
                     }
                     durableExecManager.maybePersistTaskResult(
@@ -1788,12 +2038,17 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                             actionTask.event,
                             actionTask.getRunnerContext(),
                             result);
-                    if (lifecycleVisible) {
+                    if (lifecyclePrepared) {
                         notifyActionFinished(actionTask);
                     }
+                } else if (lifecyclePrepared) {
+                    // Reported here rather than where execute() detects the replay: that phase was
+                    // closed by its suspend, and the resume above reopened the one this terminal
+                    // callback belongs to, which would otherwise get none.
+                    notifyActionReused(actionTask);
                 }
             } catch (Throwable t) {
-                if (lifecycleVisible) {
+                if (lifecyclePrepared && actionTask != null) {
                     notifyActionFailed(actionTask, t);
                 }
                 throw new ActionTaskExecutionException("Failed to execute action task", t);
@@ -1801,7 +2056,18 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
 
             for (Event actionOutputEvent : result.getOutputEvents()) {
                 try {
-                    processActionOutputEvent(key, contextKey, actionOutputEvent, actionTask);
+                    if (actionOutputEvent instanceof SubgraphEvent) {
+                        // A call event goes to its own graph over the independent dependent
+                        // channel: the root FIFO would let this task's waiting caller block the
+                        // very commits that complete the graph it is waiting for.
+                        dispatchParallelSubgraphEvent(
+                                actionTask,
+                                (SubgraphEvent) actionOutputEvent,
+                                recordIndex,
+                                taskIndex);
+                    } else {
+                        processActionOutputEvent(key, contextKey, actionOutputEvent, actionTask);
+                    }
                 } catch (Throwable t) {
                     // Mirror the serial kick-mail wrapper (tryProcessActionTaskForKey): surface
                     // output-event processing failures as ActionTaskExecutionException so callers
@@ -1811,8 +2077,18 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
                 }
             }
 
-            if (!isInternalNoopInputAction(actionTask.action)) {
-                builtInMetrics.markActionExecuted(actionTask.action.getName());
+            if (actionTask.isSubgraphEvent()) {
+                contextManager
+                        .getSubgraphCalls()
+                        .get(((SubgraphEvent) actionTask.event).getInvocationId())
+                        .completeAction();
+            }
+            if (lifecyclePrepared) {
+                // Scope-aware: an action inside a graph call reports to that call's metrics.
+                actionTask
+                        .getRunnerContext()
+                        .getBuiltInMetrics()
+                        .markActionExecuted(actionTask.action.getName());
             }
             actionTask.getRunnerContext().persistMemory();
         }
@@ -1838,6 +2114,11 @@ public class ActionExecutionOperator<IN, OUT> extends AbstractStreamOperator<OUT
         return stateManager;
     }
 
+    @VisibleForTesting
+    ParallelExecutionCoordinator getExecutionCoordinator() {
+        return executionCoordinator;
+    }
+
     /** Failed to execute Action task. */
     public static class ActionTaskExecutionException extends Exception {
         public ActionTaskExecutionException(String message, Throwable cause) {
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManager.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManager.java
index 339d77e7e..b817bda44 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManager.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManager.java
@@ -25,21 +25,22 @@ import org.apache.flink.agents.plan.PythonFunction;
 import org.apache.flink.agents.runtime.ResourceCache;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
 import org.apache.flink.agents.runtime.async.ContinuationContext;
-import org.apache.flink.agents.runtime.chat.ChatCallManager;
-import org.apache.flink.agents.runtime.chat.ChatCallOwner;
-import org.apache.flink.agents.runtime.chat.ChatContext;
 import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl.ExecutionReportingContext;
 import org.apache.flink.agents.runtime.memory.CachedMemoryStore;
 import org.apache.flink.agents.runtime.memory.InteranlBaseLongTermMemory;
 import org.apache.flink.agents.runtime.memory.MemoryObjectImpl;
+import org.apache.flink.agents.runtime.memory.MemoryScope;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextLifecycle;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionLock;
 import org.apache.flink.agents.runtime.python.context.PythonRunnerContextImpl;
 import org.apache.flink.agents.runtime.subgraph.SubgraphCallManager;
 import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
 import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
+import org.apache.flink.agents.runtime.utils.IdAllocatorSource;
 import org.apache.flink.api.common.state.MapState;
 import org.apache.flink.util.ExceptionUtils;
 import org.apache.flink.util.Preconditions;
@@ -85,7 +86,6 @@ class ActionTaskContextManager implements AutoCloseable {
 
     private RunnerContextImpl runnerContext;
     private final SubgraphCallManager subgraphCalls = new SubgraphCallManager();
-    private final ChatCallManager chatCallManager = new ChatCallManager(subgraphCalls);
 
     private final Map<ActionTask, ActionTaskContexts> actionTaskContexts;
 
@@ -109,17 +109,48 @@ class ActionTaskContextManager implements AutoCloseable {
         this.actionTaskContexts = new HashMap<>();
         this.continuationActionExecutor =
                 new ContinuationActionExecutor(
-                        numAsyncThreads, asyncThreadCleanup, parallelExecutionLock, this::restore);
-    }
-
-    ChatCallManager getChatCallManager() {
-        return chatCallManager;
+                        numAsyncThreads,
+                        asyncThreadCleanup,
+                        parallelExecutionLock,
+                        new ParallelExecutionContextLifecycle() {
+                            @Override
+                            public void suspend(Object key, ActionTask task) {
+                                operator.suspendParallelAction(task);
+                            }
+
+                            @Override
+                            public void resume(Object key, ActionTask task) {
+                                operator.resumeParallelAction(key, task);
+                            }
+                        });
     }
 
     SubgraphCallManager getSubgraphCalls() {
         return subgraphCalls;
     }
 
+    /**
+     * The id counters of one action execution: its caller-side facts captured once, plus one
+     * counter per call target created on first use. Living in the task's contexts record gives them
+     * the two lifetimes they need — a replay builds a fresh record and counts from zero again,
+     * reproducing the ids whose results the original run recorded, while {@link #transferContexts}
+     * carries this same source to a successor so a suspend/resume keeps counting instead of
+     * reissuing ids.
+     */
+    private static IdAllocatorSource newIdAllocators(ActionTask task) {
+        Object key = task.getKey();
+        long sequenceNumber = task.getSequenceNumber();
+        String actionName = task.getAction().getName();
+        Event event = task.getEvent();
+        Map<String, DeterministicIdAllocator> byTarget = new HashMap<>();
+        return targetName ->
+                byTarget.computeIfAbsent(
+                        targetName,
+                        name ->
+                                new DeterministicIdAllocator(
+                                        key, sequenceNumber, actionName, event, name));
+    }
+
     /**
      * Mutable holder for every per-task context except durable execution. The pending output events
      * live here rather than in the memory context because they are an output buffer, not memory.
@@ -129,11 +160,25 @@ class ActionTaskContextManager implements AutoCloseable {
         @Nullable private ContinuationContext continuationContext;
         @Nullable private String pythonAwaitableRef;
         @Nullable private RunnerContextImpl.ResourceScope resourceScope;
-        @Nullable private ChatContext chatContext;
+        @Nullable private IdAllocatorSource idAllocators;
         @Nullable private SubgraphInvocation<?> subgraphInvocation;
         private List<Event> pendingEvents = new ArrayList<>();
         @Nullable private ExecutionReportingContext executionReportingContext;
         @Nullable private String contextKey;
+
+        /**
+         * Whether the task currently owns an execution phase on the parallel engine, so a
+         * suspend/resume pair cannot re-emit {@code onActionPrepared} for a phase already open.
+         */
+        private boolean lifecycleActive;
+    }
+
+    boolean isLifecycleActive(ActionTask actionTask) {
+        return requireContexts(actionTask).lifecycleActive;
+    }
+
+    void setLifecycleActive(ActionTask actionTask, boolean active) {
+        requireContexts(actionTask).lifecycleActive = active;
     }
 
     private boolean hasContexts(ActionTask actionTask) {
@@ -245,7 +290,8 @@ class ActionTaskContextManager implements AutoCloseable {
      * <ol>
      *   <li>Selects a Java or Python runner context based on the action's {@code Exec} type.
      *   <li>Reuses any existing {@link RunnerContextImpl.MemoryContext} for this task; otherwise
-     *       builds a fresh one backed by the supplied sensory/short-term memory states.
+     *       builds one over the enclosing subgraph call's {@link MemoryScope} stores when it
+     *       carries any, or over the supplied sensory/short-term memory states.
      *   <li>Creates or reuses the per-Action call reporting context and wires it onto the runner
      *       context.
      *   <li>Calls {@link RunnerContextImpl#switchActionContext} so the shared context now points at
@@ -280,7 +326,6 @@ class ActionTaskContextManager implements AutoCloseable {
             MapState<String, MemoryObjectImpl.MemoryItem> shortTermMemState,
             PythonRunnerContextImpl pythonRunnerContext,
             @Nullable InteranlBaseLongTermMemory longTermMemory,
-            @Nullable RunnerContextImpl.ResourceScope resourceScope,
             @Nullable
                     Function<ActionTask, ExecutionReportingContext>
                             executionReportingContextFactory) {
@@ -290,16 +335,12 @@ class ActionTaskContextManager implements AutoCloseable {
             // transferContexts), so we never recreate here.
             createContexts(actionTask);
         }
-        if (resourceScope != null) {
-            setResourceScope(actionTask, resourceScope);
-        }
         ActionTaskContexts taskContexts = requireContexts(actionTask);
-        if (taskContexts.chatContext == null) {
-            ChatCallOwner owner =
-                    new ChatCallOwner(
-                            actionTask.getKey(), actionTask.getSequenceNumber(),
-                            actionTask.getAction().getName(), actionTask.getEvent());
-            taskContexts.chatContext = new ChatContext(chatCallManager, owner);
+        if (taskContexts.idAllocators == null) {
+            // Eager, though the per-target counters inside it are not: transferContexts reads this
+            // reference back off the runner context, so a lazily built source would hand a
+            // successor task a null.
+            taskContexts.idAllocators = newIdAllocators(actionTask);
         }
         if (actionTask.getEvent() instanceof SubgraphEvent) {
             taskContexts.subgraphInvocation =
@@ -308,12 +349,14 @@ class ActionTaskContextManager implements AutoCloseable {
         SubgraphInvocation<?> call = taskContexts.subgraphInvocation;
         if (call != null) {
             taskContexts.resourceScope = call.getResourceScope();
-            // Share the stores, not the per-action update/observation journal.
-            if (taskContexts.memoryContext == null) {
+            MemoryScope memoryScope = call.getMemoryScope();
+            // Share the call's stores, not the per-action update/observation journal. A call
+            // without a memory scope inherits the root stores wired below.
+            if (memoryScope != null && taskContexts.memoryContext == null) {
                 taskContexts.memoryContext =
                         new RunnerContextImpl.MemoryContext(
-                                call.getMemory().getSensoryMemStore(),
-                                call.getMemory().getShortTermMemStore());
+                                memoryScope.getSensoryMemStore(),
+                                memoryScope.getShortTermMemStore());
             }
         }
         RunnerContextImpl context;
@@ -358,6 +401,7 @@ class ActionTaskContextManager implements AutoCloseable {
                 actionTask.action.getName(),
                 memoryContext,
                 requireContexts(actionTask).pendingEvents,
+                actionTask.getKey(),
                 contextKey,
                 actionTask.getObservationId(),
                 MemoryEvent.isMemoryType(actionTask.event.getType()),
@@ -365,7 +409,7 @@ class ActionTaskContextManager implements AutoCloseable {
         // Applied on every switch (possibly null): the shared context must not inherit the scope
         // of whichever task was wired on previously.
         context.setResourceScope(getResourceScope(actionTask));
-        context.setChatContext(taskContexts.chatContext);
+        context.setIdAllocatorSource(taskContexts.idAllocators);
         context.setSubgraphCalls(subgraphCalls);
         context.setSubgraphInvocation(taskContexts.subgraphInvocation);
 
@@ -410,12 +454,13 @@ class ActionTaskContextManager implements AutoCloseable {
                 actionTask.action.getName(),
                 memoryContext,
                 requireContexts(actionTask).pendingEvents,
+                actionTask.getKey(),
                 requireContexts(actionTask).contextKey,
                 actionTask.getObservationId(),
                 MemoryEvent.isMemoryType(actionTask.event.getType()),
                 requireContexts(actionTask).executionReportingContext);
         context.setResourceScope(getResourceScope(actionTask));
-        context.setChatContext(requireContexts(actionTask).chatContext);
+        context.setIdAllocatorSource(requireContexts(actionTask).idAllocators);
         context.setSubgraphCalls(subgraphCalls);
         context.setSubgraphInvocation(requireContexts(actionTask).subgraphInvocation);
         if (context instanceof JavaRunnerContextImpl) {
@@ -432,6 +477,9 @@ class ActionTaskContextManager implements AutoCloseable {
             context.setDurableExecutionContext(durableContext);
         }
         actionTask.setRunnerContext(context);
+        // Last, because the hook captures the context just bound: an engine whose actions never
+        // yield needs the dispatcher to start a call's graph before the caller waits for it.
+        operator.installParallelSubgraphBootstrap(actionTask);
     }
 
     private void putMemoryContext(
@@ -480,7 +528,10 @@ class ActionTaskContextManager implements AutoCloseable {
         // Retain the parent Action context and listeners for reports emitted after suspension.
         requireContexts(toTask).executionReportingContext =
                 fromTask.getRunnerContext().getExecutionReportingContext();
-        requireContexts(toTask).chatContext = fromTask.getRunnerContext().getChatContext();
+        // Read off the runner context, not off fromTask's own record: the operator removes the
+        // finishing task's contexts before this runs. The counters are carried over rather than
+        // rebuilt — rebuilding from the successor's facts would change the digest and the ordinals.
+        requireContexts(toTask).idAllocators = fromTask.getRunnerContext().getIdAllocatorSource();
         requireContexts(toTask).subgraphInvocation =
                 fromTask.getRunnerContext().getSubgraphInvocation();
         RunnerContextImpl.DurableExecutionContext durableContext =
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ActionTaskLifecycleException.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ActionTaskLifecycleException.java
new file mode 100644
index 000000000..ee3acde46
--- /dev/null
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ActionTaskLifecycleException.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.operator.parallel;
+
+import javax.annotation.Nullable;
+
+/**
+ * The parallel engine failed to move an action task's execution between a worker and the mailbox:
+ * suspending the task's context before the lock is released, or resuming it after ownership is
+ * re-acquired.
+ *
+ * <p>Either is a framework fault rather than the action's own outcome, so the factories below hand
+ * back an {@link UncapturableException} already wrapped around it and construction stays
+ * package-private: a lifecycle fault can neither be recorded as a business action result nor reach
+ * a folding gate bare.
+ */
+public final class ActionTaskLifecycleException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    ActionTaskLifecycleException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /** The task's context could not be released before the execution lock was handed off. */
+    public static UncapturableException suspendFailed(Throwable cause) {
+        return new UncapturableException(
+                new ActionTaskLifecycleException("Could not suspend action task", cause));
+    }
+
+    /**
+     * The task's context could not be rebound after ownership was re-acquired. {@code
+     * supplierFailure} is whatever the handed-off call had itself failed with, kept as suppressed
+     * on the shell so the framework fault does not hide it.
+     */
+    public static UncapturableException resumeFailed(
+            Throwable cause, @Nullable Throwable supplierFailure) {
+        UncapturableException shell =
+                new UncapturableException(
+                        new ActionTaskLifecycleException("Could not resume action task", cause));
+        if (supplierFailure != null) {
+            shell.addSuppressed(supplierFailure);
+        }
+        return shell;
+    }
+}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextLifecycle.java
similarity index 55%
copy from runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java
copy to runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextLifecycle.java
index c84e559c4..2bb83b2bf 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextLifecycle.java
@@ -20,12 +20,17 @@ package org.apache.flink.agents.runtime.operator.parallel;
 import org.apache.flink.agents.runtime.operator.ActionTask;
 
 /**
- * Restores the shared runner context to a resuming action task. Called by the async executor after
- * a worker re-acquires the lock, so the shared context is repointed at the task's key, memory,
- * continuation, and durable-execution contexts before control returns to user code.
+ * Detaches and restores the shared runner context around a parallel execution ownership handoff.
+ * Called by the async executor around the window in which a worker holds no lock, so the shared
+ * context is detached from the yielding task before another worker can bind it, and repointed at
+ * the task's key, memory, continuation, and durable-execution contexts after ownership is
+ * re-acquired.
  */
-@FunctionalInterface
-public interface ParallelExecutionContextRestorer {
+public interface ParallelExecutionContextLifecycle {
 
-    void restore(Object key, ActionTask actionTask);
+    /** Suspends the task context while the worker still owns the execution lock. */
+    void suspend(Object key, ActionTask actionTask);
+
+    /** Restores and prepares the task context after the worker re-acquires the execution lock. */
+    void resume(Object key, ActionTask actionTask);
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionCoordinator.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionCoordinator.java
index faef8f850..b411aaf14 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionCoordinator.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionCoordinator.java
@@ -23,6 +23,8 @@ import org.apache.flink.util.function.ThrowingRunnable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -36,7 +38,9 @@ import static org.apache.flink.util.Preconditions.checkNotNull;
  * add} one node per queued task, and the coordinator submits one anonymous <em>dispatch permit</em>
  * per node to an elastic {@link ThreadPoolExecutor}. A pool thread redeems a permit under the lock
  * (node poll and FIFO task pull share the lock hold, keeping their binding correct — permits never
- * name a task); commits always run on the mailbox thread in per-key taskIndex order.
+ * name a task). Root commits run on the mailbox thread in per-key taskIndex order; dependent
+ * actions commit independently so a waiting caller cannot block their completion. Both remain
+ * outstanding until committed, even when a caller commits before its dependent actions.
  */
 public final class ParallelExecutionCoordinator implements AutoCloseable {
 
@@ -44,6 +48,28 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
 
     private static final long WORKER_TERMINATION_TIMEOUT_SECONDS = 180L;
 
+    /**
+     * Factor applied to {@code num-async-threads} when sizing the worker pool; see {@link
+     * #workerCeiling}.
+     */
+    private static final int WORKER_CEILING_MULTIPLIER = 2;
+
+    /** Lower bound for the worker pool; see {@link #workerCeiling}. */
+    private static final int MIN_WORKER_CEILING = 10;
+
+    /**
+     * Sizes the worker pool for {@code numAsyncThreads}. A worker stays occupied for the whole of a
+     * call it blocks on inline -- an async call, or a graph call whose lock handoff keeps the
+     * worker -- while the work queued behind it draws from this same pool, so the pool has to hold
+     * both. Too small a pool does not fail loudly: {@link DispatchQueue} is unbounded and the pool
+     * cannot grow past its maximum, so queued permits are never redeemed and the job hangs until
+     * Flink's checkpoint timeout fails it, naming no cause. The floor covers configurations the
+     * multiplier cannot reach.
+     */
+    public static int workerCeiling(int numAsyncThreads) {
+        return Math.max(MIN_WORKER_CEILING, WORKER_CEILING_MULTIPLIER * numAsyncThreads);
+    }
+
     @FunctionalInterface
     public interface MailboxDispatcher {
         void execute(ThrowingRunnable<? extends Exception> command, String description);
@@ -58,16 +84,35 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
     /** Supplies a fresh work; the work pulls and prepares its own task inside {@code execute()}. */
     private final Supplier<ParallelExecutionTask> workFactory;
 
-    /** Tasks pulled but not yet committed; read by {@link #isQuiesced()} for checkpoint quiesce. */
+    /**
+     * Uncommitted dependent actions per key. Mutated as a per-key atomic map operation, not a
+     * read-modify-write under {@link #parallelExecutionLock}: a worker interrupted before it
+     * acquires that lock gives its own charge back without it.
+     */
+    private final Map<Object, Integer> dependentTasks = new ConcurrentHashMap<>();
+
+    /**
+     * Pulled root tasks and submitted dependent actions not yet committed; read by {@link
+     * #isQuiesced()} for checkpoint quiesce.
+     */
     private final AtomicInteger inFlightExecuting = new AtomicInteger();
 
     /**
      * When {@code true}, workers finish in-flight tasks but pull no new nodes. Set before a
-     * checkpoint, cleared once the snapshot is taken.
+     * checkpoint, cleared once the snapshot is taken. Read under {@link #drainLock} together with
+     * {@link #forfeitedPermits}, so a worker either observes the drain and hands its permit back
+     * for the resume to re-submit, or observes the resume and pulls normally.
      */
     private volatile boolean draining;
 
-    private final Object drainMonitor = new Object();
+    private final Object drainLock = new Object();
+
+    /**
+     * Root permits handed back by workers that found a drain in progress. {@link #stopDraining()}
+     * re-submits exactly this many, so a pending node never loses the permit that will eventually
+     * pull it.
+     */
+    private int forfeitedPermits;
 
     /**
      * Permits submitted and not yet fully redeemed; compared against the pool size by {@link
@@ -125,9 +170,93 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
         workerExecutor.execute(this::runOneTask);
     }
 
+    /**
+     * Submits a dependent action independently of the root FIFO so its waiting caller cannot block
+     * its commit. Must be called holding the lock; the dependency is outstanding from submission.
+     */
+    public void addDependentTask(
+            ParallelExecutionTask work, Object key, long recordIndex, long taskIndex) {
+        parallelExecutionLock.checkReentrant();
+        dependentTasks.merge(key, 1, Integer::sum);
+        inFlightExecuting.incrementAndGet();
+        submittedPermits.incrementAndGet();
+        workerExecutor.execute(() -> runDependentTask(work, key, recordIndex, taskIndex));
+    }
+
+    private void runDependentTask(
+            ParallelExecutionTask work, Object key, long recordIndex, long taskIndex) {
+        try {
+            try {
+                parallelExecutionLock.acquireByWorker(Long.MAX_VALUE, Long.MAX_VALUE);
+            } catch (InterruptedException e) {
+                // This action will never run and never reach the commit mail that removes its
+                // charge, so give the charge back here: left in place, the key stays outstanding
+                // forever and the coordinator never reports quiescence again.
+                refundDependentTask(key);
+                Thread.currentThread().interrupt();
+                return;
+            }
+            try {
+                // Dependencies of in-flight callers must progress even during checkpoint draining.
+                work.setup(key, recordIndex, taskIndex);
+                work.execute();
+                if (workerExecutor.isShutdown() && !parallelExecutionLock.isHeldByCurrentThread()) {
+                    return;
+                }
+                parallelExecutionLock.checkReentrant();
+                mailboxDispatcher.execute(
+                        () -> {
+                            parallelExecutionLock.acquireByMain();
+                            try {
+                                try {
+                                    work.commit();
+                                } finally {
+                                    removeDependentTask(key);
+                                }
+                                if (!hasOutstanding(key)) {
+                                    work.finishGroup(work);
+                                }
+                            } finally {
+                                parallelExecutionLock.release();
+                            }
+                        },
+                        "complete dependent action task");
+            } catch (Throwable t) {
+                mailboxDispatcher.execute(
+                        () -> {
+                            parallelExecutionLock.acquireByMain();
+                            try {
+                                throw t;
+                            } finally {
+                                removeDependentTask(key);
+                                parallelExecutionLock.release();
+                            }
+                        },
+                        "throw dependent action task scheduling failure");
+            } finally {
+                if (parallelExecutionLock.isHeldByCurrentThread()) {
+                    parallelExecutionLock.releaseToMain();
+                }
+            }
+        } finally {
+            submittedPermits.decrementAndGet();
+        }
+    }
+
+    private void removeDependentTask(Object key) {
+        parallelExecutionLock.checkReentrant();
+        refundDependentTask(key);
+    }
+
+    /** Gives back one of the charges {@link #addDependentTask} made for {@code key}. */
+    private void refundDependentTask(Object key) {
+        dependentTasks.compute(key, (ignored, count) -> count == 1 ? null : count - 1);
+        inFlightExecuting.decrementAndGet();
+    }
+
     /** Whether {@code key} still has outstanding (added but not yet committed) work. */
     public boolean hasOutstanding(Object key) {
-        return schedule.hasOutstanding(key);
+        return schedule.hasOutstanding(key) || dependentTasks.containsKey(key);
     }
 
     /**
@@ -137,20 +266,30 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
      * {@link #isQuiesced()} can no longer miss a pulled task.
      */
     public void startDraining() throws InterruptedException {
-        draining = true;
+        synchronized (drainLock) {
+            draining = true;
+        }
         parallelExecutionLock.acquireByMain();
         parallelExecutionLock.release();
     }
 
     /**
-     * Resumes task dispatch after a checkpoint: wakes parked workers, then consumes any dangling
-     * sticky main-grant left by a declining worker (one acquire/release) so woken workers can take
-     * the lock immediately instead of stalling until the next mailbox action.
+     * Resumes task dispatch after a checkpoint: re-submits one permit per worker that handed its
+     * permit back during the drain, then takes and releases the lock once as the mailbox. That
+     * consumes any reservation left to the mailbox, which workers always yield to, so the
+     * re-submitted permits are redeemed at once instead of stalling until the next mailbox action.
+     * Idempotent: a second call finds nothing forfeited and only repeats the fence.
      */
     public void stopDraining() throws InterruptedException {
-        synchronized (drainMonitor) {
+        int resubmit;
+        synchronized (drainLock) {
             draining = false;
-            drainMonitor.notifyAll();
+            resubmit = forfeitedPermits;
+            forfeitedPermits = 0;
+        }
+        for (int i = 0; i < resubmit; i++) {
+            submittedPermits.incrementAndGet();
+            workerExecutor.execute(this::runOneTask);
         }
         parallelExecutionLock.acquireByMain();
         parallelExecutionLock.release();
@@ -161,39 +300,61 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
         return inFlightExecuting.get() == 0;
     }
 
+    /**
+     * Reports the pool state that explains a checkpoint drain which is not quiescing: how many
+     * workers exist against the ceiling, how many are executing, and the permit counters behind
+     * them. Reads counters only, so the mailbox can call this while workers are running.
+     */
+    public String diagnostics() {
+        synchronized (drainLock) {
+            return "workers="
+                    + workerExecutor.getPoolSize()
+                    + '/'
+                    + workerExecutor.getMaximumPoolSize()
+                    + ", executing="
+                    + workerExecutor.getActiveCount()
+                    + ", inFlight="
+                    + inFlightExecuting.get()
+                    + ", queuedPermits="
+                    + workerExecutor.getQueue().size()
+                    + ", submittedPermits="
+                    + submittedPermits.get()
+                    + ", forfeitedPermits="
+                    + forfeitedPermits;
+        }
+    }
+
     /**
      * Redeems one dispatch permit: under the lock, takes the highest-priority pending node, runs a
-     * fresh work, then hands the completion to the mailbox commit drain. During a checkpoint drain
-     * the permit is not forfeited: the thread parks and redeems it afterwards.
+     * fresh work, then hands the completion to the mailbox commit drain. A worker that finds a
+     * checkpoint drain in progress hands its permit back and exits instead of holding the thread.
      */
     private void runOneTask() {
         try {
-            // None of the interruptible calls below holds the lock when it throws, so one handler
-            // treats every interrupt as the shutdown signal.
             try {
                 // Fresh pulls acquire at the lowest priority: async resumes always take precedence.
                 parallelExecutionLock.acquireByWorker(Long.MAX_VALUE, Long.MAX_VALUE);
-                while (draining) {
-                    // Park without the lock until the drain ends; the node stays pending
-                    // meanwhile. No main-thread reservation is left behind, so in-flight tasks
-                    // can re-acquire the lock and commit while this worker waits.
-                    parallelExecutionLock.release();
-                    synchronized (drainMonitor) {
-                        while (draining) {
-                            drainMonitor.wait();
-                        }
-                    }
-                    parallelExecutionLock.acquireByWorker(Long.MAX_VALUE, Long.MAX_VALUE);
-                }
             } catch (InterruptedException e) {
+                // The interruptible call below throws without holding the lock, so one handler
+                // treats every interrupt as the shutdown signal.
                 Thread.currentThread().interrupt();
                 return;
             }
+            synchronized (drainLock) {
+                if (draining) {
+                    // Parking here would hold a worker out of the pool for the whole snapshot,
+                    // leaving everything queued behind it with no thread to run on. Forfeiting
+                    // costs nothing: the node is still pending and quiesce accounting starts after
+                    // the poll.
+                    forfeitedPermits++;
+                    parallelExecutionLock.release();
+                    return;
+                }
+            }
 
             // Holding the lock from here on: every failure is funneled to the mailbox (an uncaught
             // throwable would only kill this pool thread silently), and the lock is returned
             // unless a shutdown interrupt aborted the work's async re-acquire.
-            boolean ownsLock = true;
             try {
                 ParallelExecutionTaskQueue.Node node = schedule.pollPendingNode();
                 ParallelExecutionTask work = workFactory.get();
@@ -206,9 +367,9 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
                 if (workerExecutor.isShutdown() && !parallelExecutionLock.isHeldByCurrentThread()) {
                     // A shutdown interrupt aborted the work's async re-acquire, so this worker no
                     // longer owns the lock: abandon the task without completing or releasing it.
-                    ownsLock = false;
                     return;
                 }
+                parallelExecutionLock.checkReentrant();
                 schedule.markDone(node);
                 mailboxDispatcher.execute(() -> completeOnMailbox(node), "complete action task");
             } catch (Throwable t) {
@@ -218,7 +379,7 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
                         },
                         "throw action task scheduling failure");
             } finally {
-                if (ownsLock) {
+                if (parallelExecutionLock.isHeldByCurrentThread()) {
                     parallelExecutionLock.releaseToMain();
                 }
             }
@@ -243,7 +404,6 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
                     break;
                 }
                 try {
-                    head.getWork().restoreContext();
                     head.getWork().commit();
                     lastCommitted = head.getWork();
                 } finally {
@@ -297,6 +457,14 @@ public final class ParallelExecutionCoordinator implements AutoCloseable {
         return workerExecutor.getPoolSize();
     }
 
+    /** Root permits handed back by workers since the last resume; see {@link #runOneTask()}. */
+    @VisibleForTesting
+    public int getForfeitedPermitsForTesting() {
+        synchronized (drainLock) {
+            return forfeitedPermits;
+        }
+    }
+
     /**
      * Work queue of anonymous dispatch permits. {@link #offer} reports "full" when every pool
      * thread is busy and the pool may still grow — the only way to make {@link ThreadPoolExecutor}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionLock.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionLock.java
index b82e8d5ee..404f82106 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionLock.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionLock.java
@@ -177,13 +177,13 @@ public final class ParallelExecutionLock {
     }
 
     /** Whether the calling thread currently owns the lock. */
-    boolean isHeldByCurrentThread() {
+    public boolean isHeldByCurrentThread() {
         return ownerThread == Thread.currentThread();
     }
 
     /** Asserts that the calling thread currently owns the lock. */
     public void checkReentrant() {
-        if (ownerThread != Thread.currentThread()) {
+        if (!isHeldByCurrentThread()) {
             throw new IllegalStateException(
                     "Current thread does not own the lock. owner="
                             + ownerThread
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionTask.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionTask.java
index 55913dbef..cb31da3b0 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionTask.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionTask.java
@@ -22,8 +22,8 @@ import javax.annotation.Nullable;
 /**
  * A self-describing unit of worker execution for the parallel execution engine. A pool thread
  * {@link #setup} + {@link #execute()}s it (pull, prepare, run; result or failure stored inside);
- * the mailbox thread later {@link #restoreContext()} + {@link #commit()}s each done key-group head
- * in order and calls {@link #finishGroup} once per drain.
+ * the mailbox thread later {@link #commit()}s each done key-group head in order and calls {@link
+ * #finishGroup} once per drain.
  */
 public interface ParallelExecutionTask {
 
@@ -33,9 +33,6 @@ public interface ParallelExecutionTask {
      */
     void setup(Object key, long recordIndex, long taskIndex);
 
-    /** Re-establishes the runner context and Flink key for this work (used by the commit drain). */
-    void restoreContext();
-
     /**
      * Runs the action on a worker thread: pulls and prepares the next queued task, invokes the
      * action, and stores the result or failure inside this work. Never throws; failures are
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/UncapturableException.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/UncapturableException.java
new file mode 100644
index 000000000..2f7e27904
--- /dev/null
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/UncapturableException.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.operator.parallel;
+
+import org.apache.flink.util.ExceptionUtils;
+
+/**
+ * The shell every framework-level fault is raised in, so that it fails the job rather than becoming
+ * an answer the caller cannot distinguish from its child graph's own.
+ *
+ * <p>"Uncapturable" names a recording contract, not Java's: this is an ordinary unchecked
+ * exception, and what refuses it is every boundary that would otherwise turn a failure into a
+ * recorded outcome. Two fold an action's failure into a subgraph call's terminal result, {@code
+ * SubgraphInvocation.capturesActionFailure} and {@code SubgraphExecution.terminal}; the generic
+ * durable boundary in {@code RunnerContextImpl} writes a call's terminal state to the journal.
+ * Those are the only writers, so nothing carrying this shell is journaled — which is what makes the
+ * fault recoverable: a restart re-runs the action once its cause is corrected instead of replaying
+ * a recorded failure forever.
+ *
+ * <p>The real fault is always the cause. Construction is package-private and the faults using it
+ * expose only factories returning this type, so one cannot reach a gate bare. It is not an {@link
+ * Error}: an Error would fly through every {@code catch (Exception)} on the path and silently
+ * disable the generic failure handling there.
+ */
+public final class UncapturableException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    UncapturableException(Throwable frameworkFault) {
+        super(frameworkFault);
+    }
+
+    /**
+     * Whether {@code fault} is or carries this shell, the test every recording boundary shares. The
+     * scan walks causes because a boundary meets the shell inside the {@code ExecutionException} an
+     * awaited future rethrows as often as it meets it unwrapped.
+     */
+    public static boolean isUncapturable(Throwable fault) {
+        return ExceptionUtils.findThrowable(fault, UncapturableException.class).isPresent();
+    }
+}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/BaseSubagentSetup.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/BaseSubagentSetup.java
index 9756f97e0..564c850e0 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/BaseSubagentSetup.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/BaseSubagentSetup.java
@@ -23,6 +23,7 @@ import org.apache.flink.agents.api.resource.ResourceContext;
 import org.apache.flink.agents.api.resource.ResourceDescriptor;
 import org.apache.flink.agents.api.subagent.SubagentFuture;
 import org.apache.flink.agents.api.subagent.SubagentSetup;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
 import org.apache.flink.agents.runtime.lifecycle.TaskLifecycleListener;
 import org.apache.flink.agents.runtime.operator.ActionTask;
 import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
@@ -33,13 +34,14 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Runtime base for sub-agent setups, holding the per-task id allocators and pending-call registries
- * keyed to the currently executing action task. How an invocation is issued stays an execution mode
- * owned by the concrete subclass.
+ * Runtime base for sub-agent setups, holding the per-task pending-call registries keyed to the
+ * currently executing action task. Call ids come from that action's {@link
+ * DeterministicIdAllocator}, which the context manager owns and rebinds on every switch and
+ * restore, so nothing here counts ordinals and no id depends on a lifecycle notification having
+ * arrived. How an invocation is issued stays an execution mode owned by the concrete subclass.
  */
 public abstract class BaseSubagentSetup extends SubagentSetup implements TaskLifecycleListener {
 
-    private final Map<ActionTask, DeterministicIdAllocator> perTaskAllocators = new HashMap<>();
     private final Map<ActionTask, PendingSubagentCallRegistry> perTaskRegistries = new HashMap<>();
 
     /** The task whose execution is currently issuing calls. */
@@ -60,10 +62,6 @@ public abstract class BaseSubagentSetup extends SubagentSetup implements TaskLif
 
     @Override
     public void onActionTransferred(ActionTask from, ActionTask to) {
-        DeterministicIdAllocator allocator = perTaskAllocators.remove(from);
-        if (allocator != null) {
-            perTaskAllocators.put(to, allocator);
-        }
         PendingSubagentCallRegistry registry = perTaskRegistries.remove(from);
         if (registry != null) {
             registry.setActionName(to.getAction().getName());
@@ -81,7 +79,6 @@ public abstract class BaseSubagentSetup extends SubagentSetup implements TaskLif
     @Override
     public void onActionFinishing(ActionTask task) {
         currentTask = null;
-        perTaskAllocators.remove(task);
         PendingSubagentCallRegistry registry = perTaskRegistries.remove(task);
         if (registry != null) {
             registry.checkEmpty();
@@ -109,12 +106,6 @@ public abstract class BaseSubagentSetup extends SubagentSetup implements TaskLif
                 task, t -> new PendingSubagentCallRegistry(t.getAction().getName()));
     }
 
-    /** The task whose execution is currently issuing calls, or {@code null} outside one. */
-    @Nullable
-    protected final ActionTask currentTask() {
-        return currentTask;
-    }
-
     /**
      * Injected by the framework with the setup's resource name when the resource is materialized.
      */
@@ -131,34 +122,21 @@ public abstract class BaseSubagentSetup extends SubagentSetup implements TaskLif
     @Override
     public SubagentFuture submit(RunnerContext ctx, Object prompt, String sessionId)
             throws Exception {
-        return submit(ctx, prompt, sessionId, currentAllocator().nextCallId(sessionId));
+        return submit(ctx, prompt, sessionId, idAllocator(ctx).nextCallId(sessionId));
     }
 
     @Override
     public SubagentFuture submit(RunnerContext ctx, Object prompt) throws Exception {
-        DeterministicIdAllocator allocator = currentAllocator();
-        String sessionId = allocator.nextSessionId();
-        return submit(ctx, prompt, sessionId, allocator.nextCallId(sessionId));
+        DeterministicIdAllocator ids = idAllocator(ctx);
+        String sessionId = ids.nextSessionId();
+        return submit(ctx, prompt, sessionId, ids.nextCallId(sessionId));
     }
 
     /**
-     * The allocator of the currently executing task, scoped to one action execution so ordinals
-     * restart for the next action. Failover replays hand out the same ids.
+     * This sub-agent's id counter within the executing action's scope, so ordinals restart for the
+     * next action and a failover replay hands out the same ids.
      */
-    protected final DeterministicIdAllocator currentAllocator() {
-        if (currentTask == null) {
-            throw new IllegalStateException(
-                    "No prepared action task to assign sub-agent ids from.");
-        }
-        ActionTask task = currentTask;
-        return perTaskAllocators.computeIfAbsent(
-                task,
-                t ->
-                        new DeterministicIdAllocator(
-                                t.getKey(),
-                                t.getSequenceNumber(),
-                                t.getAction().getName(),
-                                t.getEvent(),
-                                subagentName));
+    protected final DeterministicIdAllocator idAllocator(RunnerContext ctx) {
+        return ((RunnerContextImpl) ctx).idAllocator(getSubagentName());
     }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java
index 75da4242d..a6e62fed8 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java
@@ -30,7 +30,7 @@ import java.util.concurrent.CancellationException;
 import java.util.function.Supplier;
 
 /** Deferred handle to one sub-agent invocation. */
-public final class DeferredSubagentFuture extends SubagentFuture {
+public final class DeferredSubagentFuture extends SubagentFuture implements PhasedSubagentFuture {
 
     private final RunnerContext ctx;
     @Nullable private final PendingSubagentCallRegistry registry;
@@ -56,15 +56,15 @@ public final class DeferredSubagentFuture extends SubagentFuture {
         }
     }
 
-    /** Prepares the request if it has not been prepared yet; must run on the mailbox thread. */
-    DurableCallable<SubagentResult> prepare() {
+    /** Prepares the request if it has not been prepared yet. */
+    @Override
+    public void prepare() {
         if (cancelled) {
             throw new CancellationException("Sub-agent call cancelled: " + identity());
         }
         if (prepared == null) {
             prepared = preparedSupplier.get();
         }
-        return prepared;
     }
 
     /**
@@ -74,8 +74,10 @@ public final class DeferredSubagentFuture extends SubagentFuture {
      * <p>A system-level failure escaping durable execution propagates and fails the action instead
      * of being folded into an error result.
      */
-    void execute() throws Exception {
-        complete(ctx.durableExecuteAsync(prepare()).await());
+    @Override
+    public void execute() throws Exception {
+        prepare();
+        complete(ctx.durableExecuteAsync(prepared).await());
     }
 
     /**
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentDefinition.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentDefinition.java
new file mode 100644
index 000000000..a74bbfc71
--- /dev/null
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentDefinition.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.subagent;
+
+import org.apache.flink.agents.api.Event;
+import org.apache.flink.agents.api.InputEvent;
+import org.apache.flink.agents.api.OutputEvent;
+import org.apache.flink.agents.api.subagent.SubagentResult;
+import org.apache.flink.agents.plan.actions.Action;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
+import org.apache.flink.agents.runtime.subgraph.SubgraphDefinition;
+import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+
+import javax.annotation.Nullable;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * An internal sub-agent's graph: the child plan's routing table and output contract, the child
+ * scope it runs in, and the identity scheme naming one of its calls. Every output the child emits
+ * accumulates into one result.
+ *
+ * <p>A call is named by a session id and a call id, both assigned by the caller's deterministic
+ * allocator, so one session can hold several calls and a replay issues the same call under the same
+ * id and finds the recorded result.
+ *
+ * <p>A child action's failure is the call's error result rather than its caller's failure, so it
+ * survives a failover the way a success does.
+ */
+final class InternalSubagentDefinition implements SubgraphDefinition<SubagentResult> {
+
+    private final InternalSubagentSetup setup;
+
+    InternalSubagentDefinition(InternalSubagentSetup setup) {
+        this.setup = setup;
+    }
+
+    @Override
+    public String kind() {
+        return "subagent";
+    }
+
+    /** The sub-agent-scope name of one call of a session. */
+    static String identity(String sessionId, String callId) {
+        return sessionId + "#" + callId;
+    }
+
+    @Override
+    public Class<SubagentResult> resultClass() {
+        return SubagentResult.class;
+    }
+
+    @Override
+    public Event inputEvent(Object input) {
+        return new InputEvent(input);
+    }
+
+    /** A sub-agent graph runs in the child scope, so the call gets the child's environment. */
+    @Override
+    public SubgraphInvocation<SubagentResult> newInvocation(
+            RunnerContextImpl context, String id, @Nullable Object key) {
+        return new InternalSubagentInvocation(id, key, this, setup.childScope(context));
+    }
+
+    @Override
+    public List<Action> matchActions(Event event) {
+        return setup.matchActions(event);
+    }
+
+    @Override
+    public boolean isOutput(Event event) {
+        return OutputEvent.EVENT_TYPE.equals(event.getType());
+    }
+
+    @Override
+    public SubagentResult finish(List<Event> outputs) {
+        return SubagentResult.ok(
+                outputs.stream()
+                        .map(event -> OutputEvent.fromEvent(event).getOutput())
+                        .collect(Collectors.toList()));
+    }
+
+    @Override
+    public boolean capturesActionFailures() {
+        return true;
+    }
+
+    @Override
+    public SubagentResult captureActionFailure(Throwable cause) {
+        return SubagentResult.error(
+                cause instanceof Exception ? (Exception) cause : new IllegalStateException(cause));
+    }
+}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentFuture.java
similarity index 59%
copy from runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java
copy to runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentFuture.java
index 75da4242d..e5bad6690 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/DeferredSubagentFuture.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentFuture.java
@@ -18,69 +18,90 @@
 
 package org.apache.flink.agents.runtime.subagent;
 
-import org.apache.flink.agents.api.context.DurableCallable;
 import org.apache.flink.agents.api.context.RunnerContext;
 import org.apache.flink.agents.api.subagent.SubagentFuture;
 import org.apache.flink.agents.api.subagent.SubagentFutures;
 import org.apache.flink.agents.api.subagent.SubagentResult;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
+import org.apache.flink.agents.runtime.subgraph.SubgraphExecution;
 
 import javax.annotation.Nullable;
 
 import java.util.concurrent.CancellationException;
-import java.util.function.Supplier;
 
-/** Deferred handle to one sub-agent invocation. */
-public final class DeferredSubagentFuture extends SubagentFuture {
+/**
+ * Handle to one internal sub-agent invocation, backed by {@link SubgraphExecution} rather than a
+ * durable callable of its own.
+ */
+final class InternalSubagentFuture extends SubagentFuture implements PhasedSubagentFuture {
 
     private final RunnerContext ctx;
+    private final InternalSubagentSetup setup;
+    private final Object prompt;
     @Nullable private final PendingSubagentCallRegistry registry;
-    private final Supplier<DurableCallable<SubagentResult>> preparedSupplier;
 
-    @Nullable private DurableCallable<SubagentResult> prepared;
+    /** The id every step after registration names this call by. */
+    @Nullable private String id;
+
     private boolean done;
     private boolean cancelled;
     @Nullable private SubagentResult value;
 
-    public DeferredSubagentFuture(
+    InternalSubagentFuture(
             String sessionId,
             String callId,
             RunnerContext ctx,
-            @Nullable PendingSubagentCallRegistry registry,
-            Supplier<DurableCallable<SubagentResult>> preparedSupplier) {
+            InternalSubagentSetup setup,
+            Object prompt,
+            @Nullable PendingSubagentCallRegistry registry) {
         super(sessionId, callId);
         this.ctx = ctx;
+        this.setup = setup;
+        this.prompt = prompt;
         this.registry = registry;
-        this.preparedSupplier = preparedSupplier;
         if (registry != null) {
             registry.trackPendingSubagentCall(identity());
         }
     }
 
-    /** Prepares the request if it has not been prepared yet; must run on the mailbox thread. */
-    DurableCallable<SubagentResult> prepare() {
+    /** Prepares the call, or installs the terminal result recorded in its durable slot. */
+    @Override
+    public void prepare() throws Exception {
         if (cancelled) {
             throw new CancellationException("Sub-agent call cancelled: " + identity());
         }
-        if (prepared == null) {
-            prepared = preparedSupplier.get();
+        if (id == null) {
+            RunnerContextImpl runner = (RunnerContextImpl) ctx;
+            SubgraphExecution.requireReleasableOperator(runner);
+            id =
+                    SubgraphExecution.prepare(
+                            runner, setup.invocation(runner, getSessionId(), getCallId()), prompt);
         }
-        return prepared;
     }
 
     /**
-     * Runs the prepared request through durable execution and records the outcome. Mailbox releases
-     * happen inside the durable execution itself.
-     *
-     * <p>A system-level failure escaping durable execution propagates and fails the action instead
-     * of being folded into an error result.
+     * Waits for the child graph through {@link SubgraphExecution#await}, then takes and persists
+     * its result.
      */
-    void execute() throws Exception {
-        complete(ctx.durableExecuteAsync(prepare()).await());
+    @Override
+    public void execute() throws Exception {
+        prepare();
+        RunnerContextImpl runner = (RunnerContextImpl) ctx;
+        SubgraphExecution.await(runner, id);
+        complete(SubgraphExecution.finish(runner, id));
+    }
+
+    @Override
+    public SubagentResult await() throws Exception {
+        if (!done) {
+            execute();
+        }
+        return value;
     }
 
     /**
-     * Cancels before the request is prepared: the request is discarded and resolving the handle
-     * fails. An already resolved handle ignores the cancellation request.
+     * Cancels before the call is issued: nothing was emitted, so there is nothing to undo. An
+     * already resolved handle ignores the cancellation request.
      */
     @Override
     public void cancel() {
@@ -93,11 +114,20 @@ public final class DeferredSubagentFuture extends SubagentFuture {
         }
     }
 
+    @Override
+    public boolean isDone() {
+        return done || cancelled;
+    }
+
+    @Override
+    public SubagentFutures combine(SubagentFuture... others) {
+        return new SubagentFutureGroup(this, others);
+    }
+
     private String identity() {
-        return getSessionId() + "#" + getCallId();
+        return InternalSubagentDefinition.identity(getSessionId(), getCallId());
     }
 
-    /** Records the outcome produced by a batched wait. */
     private void complete(SubagentResult outcome) {
         this.value = outcome;
         this.done = true;
@@ -105,25 +135,4 @@ public final class DeferredSubagentFuture extends SubagentFuture {
             registry.untrackPendingSubagentCall(identity());
         }
     }
-
-    @Override
-    public boolean isDone() {
-        return done || cancelled;
-    }
-
-    @Override
-    public SubagentResult await() throws Exception {
-        if (cancelled) {
-            throw new CancellationException("Sub-agent call cancelled: " + identity());
-        }
-        if (!done) {
-            execute();
-        }
-        return value;
-    }
-
-    @Override
-    public SubagentFutures combine(SubagentFuture... others) {
-        return new SubagentFutureGroup(this, others);
-    }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentInvocation.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentInvocation.java
index 619a627d4..ab9cdee7e 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentInvocation.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentInvocation.java
@@ -17,61 +17,52 @@
  */
 package org.apache.flink.agents.runtime.subagent;
 
-import org.apache.flink.agents.api.Event;
-import org.apache.flink.agents.api.OutputEvent;
-import org.apache.flink.agents.plan.actions.Action;
+import org.apache.flink.agents.api.subagent.SubagentResult;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl;
-import org.apache.flink.agents.runtime.subgraph.SubgraphDefinition;
+import org.apache.flink.agents.runtime.memory.MemoryScope;
+import org.apache.flink.agents.runtime.subgraph.SubgraphExecution;
 import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
 
-import java.util.List;
-import java.util.stream.Collectors;
+import javax.annotation.Nullable;
 
 /**
- * Subagent-specific result adapter. The common invocation owns action accounting and completion;
- * the setup retains this reference only to implement session/call lookup for public handles.
+ * One internal sub-agent call. The common invocation owns routing, action accounting and
+ * completion; this class supplies the sub-agent's environment and the identity a bridge names its
+ * call by.
+ *
+ * <p>The result type is the durable one, {@link SubagentResult}, so a replay installs the recorded
+ * result into the invocation instead of translating between two shapes.
  */
-public final class InternalSubagentInvocation extends SubgraphInvocation<List<Object>> {
+public final class InternalSubagentInvocation extends SubgraphInvocation<SubagentResult> {
+
     public InternalSubagentInvocation(
             String id,
-            Object key,
-            InternalSubagentSetup setup,
+            @Nullable Object key,
+            InternalSubagentDefinition definition,
             RunnerContextImpl.ResourceScope environment) {
         super(
                 id,
                 key,
-                new Definition(setup),
-                RunnerContextImpl.MemoryContext.createChildContext(),
+                definition,
+                // A sub-agent does not share memory with its caller, so the call gets stores of
+                // its own instead of inheriting the enclosing ones.
+                MemoryScope.isolated(),
                 environment);
     }
 
-    private static final class Definition implements SubgraphDefinition<List<Object>> {
-        private final InternalSubagentSetup setup;
-
-        private Definition(InternalSubagentSetup setup) {
-            this.setup = setup;
-        }
-
-        @Override
-        public List<Action> matchActions(Event event) {
-            return setup.matchActions(event);
-        }
-
-        @Override
-        public boolean isOutput(Event event) {
-            return OutputEvent.EVENT_TYPE.equals(event.getType());
-        }
-
-        @Override
-        public List<Object> finish(List<Event> outputs) {
-            return outputs.stream()
-                    .map(event -> OutputEvent.fromEvent(event).getOutput())
-                    .collect(Collectors.toList());
-        }
-
-        @Override
-        public boolean capturesActionFailures() {
-            return true;
-        }
+    /**
+     * Takes the identified call's result for a bridge that polls it: the child's terminal outcome
+     * once the graph has quiesced, or {@code null} while it still runs so the bridge can yield the
+     * mailbox and come back.
+     *
+     * <p>The polling turn is {@link SubgraphExecution#tryFinish}, which owns the registry lookup
+     * and the null-while-running contract; what stays here is this kind's own identity. A child
+     * failure stays inside the returned result rather than being thrown for the bridge to catch.
+     */
+    @Nullable
+    public static SubagentResult tryComplete(
+            RunnerContextImpl context, String sessionId, String callId) throws Exception {
+        return SubgraphExecution.tryFinish(
+                context, InternalSubagentDefinition.identity(sessionId, callId));
     }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentSetup.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentSetup.java
index 1d8372760..1540d8b90 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentSetup.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/InternalSubagentSetup.java
@@ -22,28 +22,21 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 import org.apache.flink.agents.api.Event;
-import org.apache.flink.agents.api.InputEvent;
-import org.apache.flink.agents.api.context.DurableCallable;
 import org.apache.flink.agents.api.context.RunnerContext;
 import org.apache.flink.agents.api.resource.ResourceContext;
 import org.apache.flink.agents.api.resource.ResourceDescriptor;
 import org.apache.flink.agents.api.subagent.InternalSubagentResourceDescriptorBuilder;
+import org.apache.flink.agents.api.subagent.SubagentFuture;
 import org.apache.flink.agents.api.subagent.SubagentResult;
 import org.apache.flink.agents.plan.AgentPlan;
 import org.apache.flink.agents.plan.actions.Action;
 import org.apache.flink.agents.plan.subagent.InternalSubagentPlans;
 import org.apache.flink.agents.runtime.ResourceCache;
-import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
-import org.apache.flink.agents.runtime.async.ContinuationNativeCallable;
 import org.apache.flink.agents.runtime.condition.ActionMatcher;
-import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl;
-import org.apache.flink.agents.runtime.operator.ActionTask;
-import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
+import org.apache.flink.agents.runtime.subgraph.SubgraphExecution;
+import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
 
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -54,24 +47,13 @@ import java.util.Map;
  * (through an ordinary resource descriptor); this runtime class owns everything the invocation
  * needs at execution time.
  *
- * <p>Execution mode is the deferred one, inherited from {@link BaseDeferredSubagentSetup}: {@link
- * #submit} returns a deferred handle whose request is prepared on first resolve. {@link #prepare}
- * then runs the mailbox-confined bootstrap — registering the invocation and sending one {@code
- * SubgraphEvent} — and returns the durable callable that waits for the child to quiesce. Unlike the
- * other deferred setups, that callable runs inline on the mailbox thread and releases it by
- * yielding the caller's continuation, so the operator can dispatch the child agent's actions in
- * between while no async-pool worker is held.
- *
- * <p>This adapter retains the child resource caches and session/call index needed by public
- * handles. The common subgraph runtime owns dispatch, action accounting and result completion.
- * Record cleanup still uses the inherited {@link
- * org.apache.flink.agents.runtime.lifecycle.TaskLifecycleListener} hooks.
+ * <p>Calls share {@link SubgraphExecution} with built-in chat calls.
  *
- * <p>Sending the event outside the durable boundary is deliberate: a replayed send carries the same
- * event attributes, so the child action resolves to the same persisted action state and replays its
- * recorded output instead of running again.
+ * <p>This adapter retains only what outlives one call: the pooled child resource caches. The calls
+ * themselves live in the operator-wide invocation registry under their {@code sessionId#callId} id,
+ * and record cleanup goes through {@code SubgraphCallManager}.
  */
-public class InternalSubagentSetup extends BaseDeferredSubagentSetup {
+public class InternalSubagentSetup extends BaseSubagentSetup {
 
     /**
      * Serializes the child plan with the same configuration {@code RunnerContextImpl} uses for the
@@ -85,19 +67,10 @@ public class InternalSubagentSetup extends BaseDeferredSubagentSetup {
 
     private final AgentPlan plan;
 
-    /** Nested map: sessionId → callId → invocation. */
-    private final Map<String, Map<String, InternalSubagentInvocation>> invocations =
-            new HashMap<>();
-
     private final Map<String, ResourceCache> childCaches = new HashMap<>();
 
-    private final Map<Object, List<String>> keySessionIds = new HashMap<>();
-
-    /**
-     * The runner contexts this setup registered a session-owner entry on, per session id. Used to
-     * unregister those entries when the owning record finishes.
-     */
-    private final Map<String, RunnerContextImpl> ownerContexts = new HashMap<>();
+    /** This scope's graph contract, one instance per setup since it holds no per-call state. */
+    private final InternalSubagentDefinition definition;
 
     /** Lazily built event-to-action matcher for the plan. */
     private ActionMatcher actionMatcher;
@@ -112,6 +85,11 @@ public class InternalSubagentSetup extends BaseDeferredSubagentSetup {
             throw new IllegalArgumentException("Internal sub-agent requires a scope");
         }
         this.plan = InternalSubagentPlans.decode(descriptor);
+        this.definition = new InternalSubagentDefinition(this);
+    }
+
+    InternalSubagentDefinition definition() {
+        return definition;
     }
 
     public String getScope() {
@@ -155,170 +133,51 @@ public class InternalSubagentSetup extends BaseDeferredSubagentSetup {
     }
 
     /**
-     * The mailbox-confined bootstrap plus the wait. Sending the bootstrap event must happen before
-     * the wait releases the mailbox, so it runs here, on the resolving thread.
-     *
-     * <p>The returned callable is {@link ContinuationNativeCallable}, so it runs inline inside the
-     * caller's continuation rather than on an async-pool worker, and its wait suspends by yielding
-     * that continuation. A worker-dispatched wait would hold a pool worker for the whole child call
-     * while the child's own durable calls queue behind it for a worker from the same finite pool —
-     * a self-deadlock at {@code num-async-threads=1} and under enough nested or concurrent waits at
-     * any size (issue #1213).
+     * Returns the handle running the common graph-call chain when it resolves. Nothing is issued
+     * here, so a handle that is never resolved issues no call.
      */
     @Override
-    protected DurableCallable<SubagentResult> prepare(
+    public SubagentFuture submit(
             RunnerContext ctx, Object prompt, String sessionId, String callId) {
-        requireMailboxSuspension(ctx);
-        try {
-            bootstrap(ctx, sessionId, callId, prompt);
-        } catch (Exception e) {
-            throw new IllegalStateException(
-                    "Failed to bootstrap internal sub-agent call for scope " + scope, e);
-        }
-        return new ContinuationNativeCallable<SubagentResult>() {
-            @Override
-            public String getId() {
-                return sessionId + "#" + callId;
-            }
-
-            @Override
-            public Class<SubagentResult> getResultClass() {
-                return SubagentResult.class;
-            }
-
-            @Override
-            public SubagentResult call() {
-                // Runs inline on the mailbox thread; the wait yields the continuation, so the
-                // operator can dispatch the child's actions without a pool worker being held.
-                // Failures converge into a failed SubagentResult like the other deferred setups.
-                try {
-                    return SubagentResult.ok(awaitSubagentCallYielding(ctx, sessionId, callId));
-                } catch (Exception e) {
-                    return SubagentResult.error(e);
-                }
-            }
-        };
+        return new InternalSubagentFuture(
+                sessionId, callId, ctx, this, prompt, currentTaskRegistry());
     }
 
-    /**
-     * Fail-fast guard before the wait starts. Waiting for the child must release the mailbox so the
-     * operator can dispatch the child's actions; without stackful suspension the wait would block
-     * the mailbox and deadlock, so resolving fails immediately instead.
-     */
-    private static void requireMailboxSuspension(RunnerContext ctx) {
-        boolean suspendable =
-                ContinuationActionExecutor.isContinuationSupported()
-                        && (!(ctx instanceof JavaRunnerContextImpl)
-                                || (((JavaRunnerContextImpl) ctx).getContinuationExecutor() != null
-                                        && ((JavaRunnerContextImpl) ctx).getContinuationContext()
-                                                != null));
-        if (!suspendable) {
-            throw new IllegalStateException(
-                    "Resolving an internal sub-agent call requires stackful suspension to release"
-                            + " the mailbox while the child runs (JDK 21+ with the Continuation"
-                            + " API); the current runtime would block the mailbox and deadlock.");
-        }
+    /** The call one action issues against this scope's child plan under the assigned identity. */
+    SubgraphInvocation<SubagentResult> invocation(
+            RunnerContextImpl ctx, String sessionId, String callId) {
+        return definition.newInvocation(
+                ctx, InternalSubagentDefinition.identity(sessionId, callId), ctx.getRecordKey());
     }
 
     /**
-     * Registers the invocation under the framework-assigned {@code (sessionId, callId)} identity
-     * and sends the bootstrap event (mailbox-thread only), without blocking.
+     * Prepares one call for a bridge that polls it afterwards: the common chain registers the call
+     * and either installs the result its durable slot recorded or emits its bootstrap envelope.
      *
      * <p>The identity is supplied rather than minted here so it is reproducible after failover: a
      * replayed call sends an envelope with the same attributes, which is what lets the child action
-     * resolve to its persisted action state instead of running again. The record key is read from
-     * the executing task rather than an ambient holder.
+     * resolve to its persisted action state instead of running again.
      */
     public void bootstrap(RunnerContext ctx, String sessionId, String callId, Object prompt) {
-        ActionTask task = currentTask();
-        Object key = task != null ? task.getKey() : null;
-        RunnerContextImpl runner = (RunnerContextImpl) ctx;
-        String id = invocationId(scope, sessionId, callId);
-        ResourceCache childCache =
-                getOrCreateChildCache(
-                        Thread.currentThread().getContextClassLoader(),
-                        runner.currentResourceCache());
-        RunnerContextImpl.ResourceScope environment =
-                new RunnerContextImpl.ResourceScope(
-                        runner.getAgentMetricGroup(), plan, childCache, getPlanJson());
-        InternalSubagentInvocation invocation =
-                new InternalSubagentInvocation(id, key, this, environment);
-        runner.getSubgraphCalls().register(invocation);
-        invocations.computeIfAbsent(sessionId, k -> new HashMap<>()).put(callId, invocation);
-        if (key != null) {
-            keySessionIds.computeIfAbsent(key, k -> new ArrayList<>()).add(sessionId);
-        }
-        if (ctx instanceof RunnerContextImpl) {
-            // Let the shared context resolve this session off the mailbox thread (pemja await),
-            // independent of whichever scope is wired onto it at that moment.
-            RunnerContextImpl runnerContext = (RunnerContextImpl) ctx;
-            runnerContext.registerInternalCallOwner(sessionId, this);
-            ownerContexts.put(sessionId, runnerContext);
-        }
-        ctx.sendEvent(new SubgraphEvent(id, new InputEvent(prompt), true));
-    }
-
-    /** Namespaces the public session/call pair; allocation itself remains replay-stable. */
-    public static String invocationId(String scope, String sessionId, String callId) {
-        return "subagent:" + scope + ":" + sessionId + "#" + callId;
-    }
-
-    /**
-     * Blocks until the internal sub-agent call identified by {@code (sessionId, callId)} completes
-     * and returns its accumulated output. Must be invoked off the mailbox thread.
-     */
-    public List<Object> awaitSubagentCall(String sessionId, String callId) throws Exception {
         try {
-            return requireInvocation(sessionId, callId).awaitResult();
-        } catch (java.util.concurrent.ExecutionException e) {
-            throw unwrapChildFailure(e);
-        }
-    }
-
-    /**
-     * Awaits the identified call by yielding the caller's continuation, so the wait holds no
-     * async-pool worker and the child can draw from the pool to make progress (issue #1213).
-     *
-     * <p>The wait runs inline on the mailbox thread, so the blocking {@link #awaitSubagentCall} is
-     * not an option here — it would pin the mailbox and stall the very child it waits for. Only a
-     * Java action reaches {@link #prepare}; Python bootstraps through {@code
-     * RunnerContextImpl.bootstrapSubagentCallForScope} and blocks on its own async worker instead.
-     */
-    private List<Object> awaitSubagentCallYielding(
-            RunnerContext ctx, String sessionId, String callId) throws Exception {
-        InternalSubagentInvocation invocation = requireInvocation(sessionId, callId);
-        return invocation.awaitResult((JavaRunnerContextImpl) ctx);
-    }
-
-    private InternalSubagentInvocation requireInvocation(String sessionId, String callId) {
-        InternalSubagentInvocation invocation = getInvocation(sessionId, callId);
-        if (invocation == null) {
+            RunnerContextImpl runner = (RunnerContextImpl) ctx;
+            SubgraphExecution.prepare(runner, invocation(runner, sessionId, callId), prompt);
+        } catch (Exception e) {
             throw new IllegalStateException(
-                    "No internal sub-agent call registered for sessionId="
-                            + sessionId
-                            + ", callId="
-                            + callId);
+                    "Failed to bootstrap internal sub-agent call for scope " + scope, e);
         }
-        return invocation;
     }
 
     /**
-     * Surfaces the child's failure directly, so the caller's {@link SubagentResult} carries the
-     * failing action's exception rather than the future's plumbing.
+     * The environment this scope's child actions run in: the child plan, its cache and its JSON.
      */
-    private static Exception unwrapChildFailure(java.util.concurrent.ExecutionException e) {
-        Throwable cause = e.getCause();
-        return cause instanceof Exception ? (Exception) cause : e;
-    }
-
-    /** The identified invocation, or {@code null} when this setup owns none. */
-    @Nullable
-    public InternalSubagentInvocation getInvocation(String sessionId, String callId) {
-        Map<String, InternalSubagentInvocation> calls = invocations.get(sessionId);
-        if (calls == null) {
-            return null;
-        }
-        return calls.get(callId);
+    public RunnerContextImpl.ResourceScope childScope(RunnerContextImpl runner) {
+        ResourceCache childCache =
+                getOrCreateChildCache(
+                        Thread.currentThread().getContextClassLoader(),
+                        runner.currentResourceCache());
+        return new RunnerContextImpl.ResourceScope(
+                runner.getAgentMetricGroup(), plan, childCache, getPlanJson());
     }
 
     /**
@@ -338,22 +197,4 @@ public class InternalSubagentSetup extends BaseDeferredSubagentSetup {
                                 rootResourceCache,
                                 planJson));
     }
-
-    /**
-     * Record lifecycle: drop this setup's sessions minted under {@code key} and their statuses.
-     * Idempotent — safe across layers and repeated notifications.
-     */
-    @Override
-    public void onRecordFinished(Object key) {
-        List<String> sessionIds = keySessionIds.remove(key);
-        if (sessionIds != null) {
-            for (String sid : sessionIds) {
-                invocations.remove(sid);
-                RunnerContextImpl owner = ownerContexts.remove(sid);
-                if (owner != null) {
-                    owner.unregisterInternalCallOwner(sid);
-                }
-            }
-        }
-    }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/PhasedSubagentFuture.java
similarity index 60%
copy from runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java
copy to runtime/src/main/java/org/apache/flink/agents/runtime/subagent/PhasedSubagentFuture.java
index c84e559c4..a41268171 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/PhasedSubagentFuture.java
@@ -15,17 +15,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.flink.agents.runtime.operator.parallel;
 
-import org.apache.flink.agents.runtime.operator.ActionTask;
+package org.apache.flink.agents.runtime.subagent;
 
 /**
- * Restores the shared runner context to a resuming action task. Called by the async executor after
- * a worker re-acquires the lock, so the shared context is repointed at the task's key, memory,
- * continuation, and durable-execution contexts before control returns to user code.
+ * A handle with separate preparation and execution phases. {@link SubagentFutureGroup} prepares
+ * every member before executing any; preparation need not issue the call.
  */
-@FunctionalInterface
-public interface ParallelExecutionContextRestorer {
+interface PhasedSubagentFuture {
 
-    void restore(Object key, ActionTask actionTask);
+    /** Prepares the call without waiting for it. Idempotent. */
+    void prepare() throws Exception;
+
+    /** Waits for the prepared call, preparing it first if this handle was awaited on its own. */
+    void execute() throws Exception;
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/SubagentFutureGroup.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/SubagentFutureGroup.java
index c7312de46..5c8692d91 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/SubagentFutureGroup.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subagent/SubagentFutureGroup.java
@@ -58,16 +58,17 @@ final class SubagentFutureGroup extends SubagentFutures {
 
     @Override
     public List<SubagentResult> awaitAll() throws Exception {
+        checkNotMixedInternalAndDeferred();
         for (SubagentFuture future : futures) {
-            if (future instanceof DeferredSubagentFuture && !future.isDone()) {
-                ((DeferredSubagentFuture) future).prepare();
+            if (future instanceof PhasedSubagentFuture && !future.isDone()) {
+                ((PhasedSubagentFuture) future).prepare();
             }
         }
         // TODO(#926): execute the prepared calls as one batch once durable execution supports
         // batched submission; until then the prepared calls are executed one by one.
         for (SubagentFuture future : futures) {
-            if (future instanceof DeferredSubagentFuture && !future.isDone()) {
-                ((DeferredSubagentFuture) future).execute();
+            if (future instanceof PhasedSubagentFuture && !future.isDone()) {
+                ((PhasedSubagentFuture) future).execute();
             }
         }
         List<SubagentResult> outcomes = new ArrayList<>(futures.size());
@@ -77,6 +78,45 @@ final class SubagentFutureGroup extends SubagentFutures {
         return outcomes;
     }
 
+    /**
+     * Refuses a group mixing internal and deferred handles: the two consult this action's durable
+     * journal in different phases, so mixing them currently breaks durable recovery.
+     */
+    private void checkNotMixedInternalAndDeferred() {
+        SubagentFuture internal = null;
+        SubagentFuture deferred = null;
+        for (SubagentFuture future : futures) {
+            // A resolved member is skipped by both loops above, so it consults no journal.
+            if (future instanceof InternalSubagentFuture) {
+                if (internal == null && !future.isDone()) {
+                    internal = future;
+                }
+            } else if (future instanceof DeferredSubagentFuture) {
+                if (deferred == null && !future.isDone()) {
+                    deferred = future;
+                }
+            }
+        }
+        if (internal != null && deferred != null) {
+            throw new IllegalStateException(
+                    String.format(
+                            "A combined sub-agent group cannot mix the internal call %s with the"
+                                    + " deferred call %s: the two consult this action's durable"
+                                    + " journal in different phases, so recovery cannot replay the"
+                                    + " reads in the written order. Resolve the two calls"
+                                    + " separately.",
+                            describe(internal), describe(deferred)));
+        }
+    }
+
+    private static String describe(SubagentFuture future) {
+        return future.getClass().getSimpleName()
+                + " "
+                + future.getSessionId()
+                + "#"
+                + future.getCallId();
+    }
+
     @Override
     public void cancel() {
         for (SubagentFuture future : futures) {
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphCallManager.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphCallManager.java
index a0a6735bd..9412ff649 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphCallManager.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphCallManager.java
@@ -24,8 +24,9 @@ import java.util.Map;
 import java.util.Objects;
 
 /**
- * Operator-owned invocation registry, confined to the mailbox. Both chat and internal subagents
- * register here; adapters may retain references for their public handles but own no scheduler.
+ * Operator-owned invocation registry, accessed on the mailbox thread or under the parallel
+ * execution lock. Both chat and internal subagents register here; adapters may retain references
+ * for their public handles but own no scheduler.
  */
 public final class SubgraphCallManager {
     private final Map<String, SubgraphInvocation<?>> calls = new HashMap<>();
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphDefinition.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphDefinition.java
index 241f3602d..4297c37ec 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphDefinition.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphDefinition.java
@@ -19,16 +19,31 @@ package org.apache.flink.agents.runtime.subgraph;
 
 import org.apache.flink.agents.api.Event;
 import org.apache.flink.agents.plan.actions.Action;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
+
+import javax.annotation.Nullable;
 
 import java.util.List;
 
 /**
- * Routing and result contract of an internal event-driven graph.
+ * Routing and result contract of one kind of internal event-driven graph, plus the environment its
+ * calls run in: the event the graph consumes, the type its recorded result is read back as, and the
+ * resource and memory scope it selects.
+ *
+ * <p>Definitions contain no invocation state, so one instance serves every call of its kind. What
+ * differs between two calls of one kind — the identity and the payload — reaches this interface as
+ * arguments, never as fields; the per-call half is the {@link SubgraphInvocation} it builds.
  *
- * <p>Definitions contain no invocation state. Resource and memory scopes are supplied separately by
- * the caller. Cycles and nested calls use the normal action executor, not a second scheduler.
+ * <p>Cycles and nested calls use the normal action executor, not a second scheduler.
  */
 public interface SubgraphDefinition<R> {
+    /**
+     * Names this kind of graph. It is also the namespace prefix of the durable slot its calls
+     * record into, so it is part of the persisted state: changing it orphans results recorded by
+     * earlier runs.
+     */
+    String kind();
+
     /** Selects only actions belonging to this graph, never the caller's outer listeners. */
     List<Action> matchActions(Event event);
 
@@ -38,12 +53,35 @@ public interface SubgraphDefinition<R> {
     /** Validates and decodes the outputs once all graph work has finished. */
     R finish(List<Event> outputs);
 
+    /** The type the result recorded in the caller's durable slot is deserialized as. */
+    Class<R> resultClass();
+
+    /** Builds the graph's input event when no terminal result is available in the durable slot. */
+    Event inputEvent(Object input);
+
     /**
-     * Whether an ordinary exception from an action body belongs to the call's error result.
-     * Failures outside action invocation (such as journal persistence and event dispatch),
-     * cancellation and fatal errors are never delegated to this policy.
+     * Builds the call under an identity supplied by the kind's entry point, in the environment this
+     * kind selects. The identity must be reproducible after failover.
+     */
+    SubgraphInvocation<R> newInvocation(RunnerContextImpl context, String id, @Nullable Object key);
+
+    /**
+     * Whether an ordinary exception from an action body belongs to the call's error result. A kind
+     * that answers yes turns its graph's failure into its own terminal result instead of failing
+     * the caller. Failures outside action invocation (such as journal persistence and event
+     * dispatch), cancellation, JVM errors and framework faults marked {@code UncapturableException}
+     * are never delegated to this policy.
      */
     default boolean capturesActionFailures() {
         return false;
     }
+
+    /**
+     * The terminal result this call's graph failure becomes, so a failure survives a failover the
+     * way a success does. Consulted only when {@link #capturesActionFailures()} is true. The chain
+     * rethrows faults marked {@code UncapturableException} before consulting this.
+     */
+    default R captureActionFailure(Throwable cause) {
+        return null;
+    }
 }
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphEvent.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphEvent.java
index 6c9ab26f0..38020f4de 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphEvent.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphEvent.java
@@ -29,9 +29,12 @@ import java.util.UUID;
  * Private event envelope shared by all internal graph calls. Only bootstraps can be dispatched
  * while their producing action is suspended. The delegate is what a business action receives.
  *
- * <p>Action-state lookup uses the invocation id, bootstrap flag, and delegate type and attributes.
- * The delegate's event id is retained on the event but is not part of the envelope attributes used
- * for lookup. Event occurrence identity remains subject to the strategy tracked by issue 1084.
+ * <p>The envelope's attributes are what a child action's state is keyed on, and they carry the
+ * invocation id and the delegate's type and attributes — all reproducible after a failover, because
+ * the invocation id comes from the deterministic id tooling. The delegate's own id is not among
+ * them and is not replay-stable; nothing may key persisted state on it. Graph outputs keep their
+ * ids in completed ActionState. This does not resolve the caller-identity collision tracked by
+ * issue 1084.
  */
 public final class SubgraphEvent extends Event {
     public static final String EVENT_TYPE = "_internal_subgraph";
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphExecution.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphExecution.java
new file mode 100644
index 000000000..b9033e833
--- /dev/null
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphExecution.java
@@ -0,0 +1,226 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.subgraph;
+
+import org.apache.flink.agents.api.Event;
+import org.apache.flink.agents.api.context.Outcome;
+import org.apache.flink.agents.api.context.RunnerContext;
+import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
+import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
+import org.apache.flink.agents.runtime.memory.EventAttachmentUtils;
+import org.apache.flink.agents.runtime.operator.parallel.UncapturableException;
+import org.apache.flink.util.ExceptionUtils;
+
+import javax.annotation.Nullable;
+
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * Shared execution chain for internal graph calls, with durable result reuse and runtime-specific
+ * waiting.
+ *
+ * <p>Every step after {@link #prepare} names its call by the id that step returned, never by the
+ * invocation, so a caller can prepare every member of a group before waiting for any and their
+ * graphs run concurrently.
+ *
+ * <p>Two driving protocols are built from the same steps. The blocking one runs {@link #prepare},
+ * {@link #await} and {@link #finish} in one turn, with {@link #requireReleasableOperator} as its
+ * fail-fast guard. The polling one, for a bridge that drives its call from a generator yielding
+ * between polls, pairs {@link #prepare} with {@link #tryFinish}, which returns {@code null} while
+ * the graph still runs; releasing the operator is that yield's job, so such a bridge never calls
+ * {@link #await}.
+ *
+ * <p>What a built-in chat call and an internal sub-agent call differ in lives in the {@link
+ * SubgraphDefinition} the call's kind supplies. Nothing here is checkpointed: a replay rebuilds the
+ * invocation from the caller's identity and the durable slot supplies the completed work.
+ */
+public final class SubgraphExecution {
+
+    private SubgraphExecution() {}
+
+    /**
+     * Registers one call and either installs its recorded terminal result or emits the event that
+     * starts its graph. Returns the id used by later steps. Requires operator ownership.
+     *
+     * <p>A recorded terminal result skips input construction and child execution. Without one,
+     * recovery starts the graph again and may reuse its actions' recorded state.
+     *
+     * <p>The journal is an ordered cursor and one call may consult it only once, so a caller that
+     * prepares through here must not read the slot again itself.
+     */
+    public static <R> String prepare(
+            RunnerContextImpl context, SubgraphInvocation<R> invocation, Object input)
+            throws Exception {
+        context.checkMailboxThread();
+        context.getSubgraphCalls().register(invocation);
+        Optional<Outcome<R>> recorded =
+                context.tryGetCachedResult(
+                        invocation.getDurableSlotKey(), invocation.resultClass());
+        if (recorded.isPresent()) {
+            invocation.installRecorded(recorded.get().getValue());
+            return invocation.getId();
+        }
+        Event delegate = invocation.inputEvent(input);
+        // The delegate rides inside the envelope, so its attachments must be offloaded before the
+        // envelope's own JSON-serializability is checked.
+        EventAttachmentUtils.storeEventAttachments(delegate, context);
+        // Start a nested graph; the caller remains in flight while awaiting its result.
+        context.addPendingEvent(new SubgraphEvent(invocation.getId(), delegate, true));
+        // Under continuations the caller yields next and the operator drains the bootstrap then.
+        // An engine whose action never yields installs a dispatcher here instead, so the graph
+        // starts before the caller waits for it rather than after it finishes.
+        context.dispatchSubgraphBootstrap();
+        return invocation.getId();
+    }
+
+    /**
+     * Releases the operator while the graph of the call registered under {@code id} runs, so it can
+     * dispatch the graph's actions. A call whose result came from the durable slot is already done
+     * and does not yield.
+     *
+     * <p>Waiting is all this does; {@link #finish} takes the result. A call whose graph failure is
+     * its own result therefore tolerates the wait's exception rather than failing the caller with
+     * it.
+     *
+     * <p>Yielding a continuation holds no async-pool worker. The parallel engine instead waits on
+     * the caller's worker and hands off only the execution lock, so its pool must hold both the
+     * caller and the graph's work.
+     */
+    public static void await(RunnerContextImpl context, String id) throws Exception {
+        SubgraphInvocation<?> invocation = context.getSubgraphCalls().get(id);
+        if (invocation.isDone()) {
+            return;
+        }
+        try {
+            JavaRunnerContextImpl javaContext =
+                    context instanceof JavaRunnerContextImpl
+                            ? (JavaRunnerContextImpl) context
+                            : null;
+            if (javaContext != null && canYieldContinuation(javaContext)) {
+                invocation.awaitResult(javaContext);
+            } else {
+                context.resolveAsync(invocation::awaitResult);
+            }
+        } catch (Exception e) {
+            if (!invocation.capturesActionFailure(e)) {
+                throw e;
+            }
+        }
+    }
+
+    /**
+     * Takes the terminal result of the call registered under {@code id}, which must have been
+     * waited for and therefore be done.
+     *
+     * @throws NullPointerException if the call's graph has not quiesced yet; a caller that polls
+     *     rather than waits uses {@link #tryFinish}, which reports that as {@code null}.
+     */
+    public static <R> R finish(RunnerContextImpl context, String id) throws Exception {
+        return Objects.requireNonNull(
+                tryFinish(context, id), "Graph call returned before its result: " + id);
+    }
+
+    /**
+     * Takes and persists the terminal result, or returns {@code null} while the graph still runs. A
+     * replayed result is not recorded again. Calls that capture action failures remain registered
+     * until record cleanup; other calls are removed here.
+     */
+    @Nullable
+    public static <R> R tryFinish(RunnerContextImpl context, String id) throws Exception {
+        @SuppressWarnings("unchecked")
+        SubgraphInvocation<R> invocation =
+                (SubgraphInvocation<R>) context.getSubgraphCalls().get(id);
+        context.checkMailboxThread();
+        if (!invocation.isDone()) {
+            return null;
+        }
+        R result = terminal(invocation);
+        if (!invocation.isReplayed()) {
+            context.recordDurableCompletion(invocation.getDurableSlotKey(), result, null);
+        }
+        if (!invocation.capturesActionFailures()) {
+            context.getSubgraphCalls().remove(invocation.getId());
+        }
+        return result;
+    }
+
+    /**
+     * Fail-fast guard before a chain that waits for a child graph. Waiting must release the
+     * operator so it can dispatch the graph's actions; an engine that can neither yield a
+     * continuation nor hand off its execution lock would block the operator and deadlock, so the
+     * call fails before anything is emitted.
+     */
+    public static void requireReleasableOperator(@Nullable RunnerContextImpl context) {
+        if (!canReleaseOperator(context)) {
+            throw new UnsupportedOperationException(
+                    "Resolving an internal graph call requires a runtime that releases the"
+                            + " operator while the child graph runs: either stackful suspension"
+                            + " (JDK 21+ with the Continuation API) or the parallel execution"
+                            + " engine's lock handoff. The current runtime would block the"
+                            + " operator and deadlock.");
+        }
+    }
+
+    /**
+     * Whether waiting for a child graph can release the operator, by either mechanism: yielding the
+     * caller's continuation, or handing off the parallel engine's execution lock. A caller that is
+     * not a Java context drives its call through a polling bridge and never waits here, so
+     * continuation support for the graph it starts is all that is asked of it.
+     */
+    private static boolean canReleaseOperator(@Nullable RunnerContext context) {
+        if (!(context instanceof JavaRunnerContextImpl)) {
+            return ContinuationActionExecutor.isContinuationSupported();
+        }
+        JavaRunnerContextImpl javaContext = (JavaRunnerContextImpl) context;
+        ContinuationActionExecutor executor = javaContext.getContinuationExecutor();
+        if (executor == null) {
+            return false;
+        }
+        return canYieldContinuation(javaContext) || executor.canHandOffExecutionLock();
+    }
+
+    /** Whether this caller can release the operator by yielding its own continuation. */
+    private static boolean canYieldContinuation(JavaRunnerContextImpl context) {
+        return ContinuationActionExecutor.isContinuationSupported()
+                && context.getContinuationExecutor() != null
+                && context.getContinuationContext() != null;
+    }
+
+    private static <R> R terminal(SubgraphInvocation<R> invocation) throws Exception {
+        try {
+            return invocation.awaitResult();
+        } catch (ExecutionException e) {
+            if (!invocation.capturesActionFailures()) {
+                throw e;
+            }
+            Throwable cause = e.getCause() != null ? e.getCause() : e;
+            // The last gate before a failure becomes this call's own result, so a framework fault
+            // is rethrown as found -- the very instance, keeping its type and stack -- rather than
+            // folded into an answer the caller cannot distinguish from its child's own.
+            Optional<UncapturableException> uncapturable =
+                    ExceptionUtils.findThrowable(cause, UncapturableException.class);
+            if (uncapturable.isPresent()) {
+                throw uncapturable.get();
+            }
+            return invocation.captureActionFailure(cause);
+        }
+    }
+}
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphInvocation.java b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphInvocation.java
index 0e055aeac..99488ed45 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphInvocation.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/subgraph/SubgraphInvocation.java
@@ -22,6 +22,8 @@ import org.apache.flink.agents.plan.actions.Action;
 import org.apache.flink.agents.plan.utils.CancellationUtils;
 import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl;
+import org.apache.flink.agents.runtime.memory.MemoryScope;
+import org.apache.flink.agents.runtime.operator.parallel.UncapturableException;
 
 import javax.annotation.Nullable;
 
@@ -33,36 +35,50 @@ import java.util.concurrent.ExecutionException;
 /**
  * Runtime-only state of one internal graph call, shared by Java and Python.
  *
- * <p>All mutations run on the mailbox. A logical action remains in flight across yield/resume; it
- * is retired only after its durable output has been dispatched. This accounts for buffered events
- * and nested calls without counting continuation tasks as new executions. Each dispatch registers
- * all successor actions before its producer is retired.
+ * <p>All mutations run on the mailbox thread or under the parallel execution lock. A logical action
+ * remains in flight across yield/resume; it is retired only after its durable output has been
+ * dispatched. This accounts for buffered events and nested calls without counting continuation
+ * tasks as new executions. Each dispatch registers all successor actions before its producer is
+ * retired.
  *
  * <p>The future is not checkpointed. Root replay rebuilds this object and child ActionState
  * supplies completed work. Waiters capture this object instead of reading a switched context.
  */
 public class SubgraphInvocation<R> {
     private final String id;
+    private final String durableSlotKey;
     @Nullable private final Object key;
     private final SubgraphDefinition<R> definition;
-    private final RunnerContextImpl.MemoryContext memory;
+    @Nullable private final MemoryScope memoryScope;
     @Nullable private final RunnerContextImpl.ResourceScope resourceScope;
     private final CompletableFuture<R> response = new CompletableFuture<>();
     private final List<Event> outputs = new ArrayList<>();
     private int runningActions;
     private boolean started;
+    private boolean replayed;
     @Nullable private IllegalStateException failure;
 
+    /** Creates a call with no memory policy of its own: its actions use the enclosing stores. */
     public SubgraphInvocation(
             String id,
             @Nullable Object key,
             SubgraphDefinition<R> definition,
-            RunnerContextImpl.MemoryContext memory,
+            @Nullable RunnerContextImpl.ResourceScope resourceScope) {
+        this(id, key, definition, null, resourceScope);
+    }
+
+    public SubgraphInvocation(
+            String id,
+            @Nullable Object key,
+            SubgraphDefinition<R> definition,
+            @Nullable MemoryScope memoryScope,
             @Nullable RunnerContextImpl.ResourceScope resourceScope) {
         this.id = id;
+        // Ids are only unique within their kind, so the slot carries the kind too.
+        this.durableSlotKey = definition.kind() + ":" + id;
         this.key = key;
         this.definition = definition;
-        this.memory = memory;
+        this.memoryScope = memoryScope;
         this.resourceScope = resourceScope;
     }
 
@@ -70,13 +86,20 @@ public class SubgraphInvocation<R> {
         return id;
     }
 
+    /** The caller's durable slot this call's terminal result is recorded in and read back from. */
+    public final String getDurableSlotKey() {
+        return durableSlotKey;
+    }
+
     @Nullable
     public final Object getKey() {
         return key;
     }
 
-    public final RunnerContextImpl.MemoryContext getMemory() {
-        return memory;
+    /** The stores this call's actions share, or {@code null} to inherit the enclosing ones. */
+    @Nullable
+    public final MemoryScope getMemoryScope() {
+        return memoryScope;
     }
 
     @Nullable
@@ -88,7 +111,12 @@ public class SubgraphInvocation<R> {
         return response.isDone();
     }
 
-    /** Routes one persisted output or an authorized bootstrap on the mailbox thread. */
+    /** Whether the terminal outcome came from the caller's durable slot rather than the graph. */
+    public final boolean isReplayed() {
+        return replayed;
+    }
+
+    /** Routes one persisted output or an authorized bootstrap under operator ownership. */
     public final List<Action> dispatch(Event event) {
         if (failure != null) {
             // Already scheduled siblings may finish after a captured child failure. Their outputs
@@ -125,32 +153,59 @@ public class SubgraphInvocation<R> {
         tryComplete();
     }
 
-    /** Only ordinary action-body failures can become a graph outcome. */
+    /**
+     * Only ordinary action-body failures can become a graph outcome. Anything carrying an {@link
+     * UncapturableException} is excluded too, so a framework fault fails the job instead of being
+     * reported as this call's own result. The scan walks causes because either can arrive wrapped.
+     */
     public final boolean capturesActionFailure(Throwable failure) {
         if (!(failure instanceof Exception) || CancellationUtils.isCancellation(failure)) {
             return false;
         }
         Throwable cause = failure;
         for (int depth = 0; cause != null && depth < 64; depth++, cause = cause.getCause()) {
-            if (cause instanceof Error) {
+            if (cause instanceof Error || cause instanceof UncapturableException) {
                 return false;
             }
             if (cause.getCause() == cause) {
                 break;
             }
         }
+        return capturesActionFailures();
+    }
+
+    /**
+     * Whether this call's graph failure belongs to its own result instead of failing the caller.
+     */
+    public final boolean capturesActionFailures() {
         return definition.capturesActionFailures();
     }
 
+    public final R captureActionFailure(Throwable cause) {
+        return definition.captureActionFailure(cause);
+    }
+
+    public final Class<R> resultClass() {
+        return definition.resultClass();
+    }
+
+    public final Event inputEvent(Object input) {
+        return definition.inputEvent(input);
+    }
+
     public final void cancel() {
         response.cancel(false);
     }
 
-    /** Reuses a recorded terminal outcome without starting the graph. */
-    protected final void replay(R result) {
+    /**
+     * Reuses a recorded terminal outcome without starting the graph, marking the call replayed so
+     * its result is not persisted a second time.
+     */
+    public final void installRecorded(R result) {
         if (started || !response.complete(result)) {
             throw new IllegalStateException("Duplicate subgraph result: " + id);
         }
+        replayed = true;
     }
 
     public final R awaitResult() throws InterruptedException, ExecutionException {
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/utils/DeterministicIdAllocator.java b/runtime/src/main/java/org/apache/flink/agents/runtime/utils/DeterministicIdAllocator.java
index a833eb5ad..30f3c68f2 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/utils/DeterministicIdAllocator.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/utils/DeterministicIdAllocator.java
@@ -32,6 +32,7 @@ import javax.annotation.Nullable;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 import java.util.UUID;
 
 /**
@@ -49,7 +50,20 @@ public final class DeterministicIdAllocator {
     /** Creates an allocator for one action execution from the execution's caller-side facts. */
     public DeterministicIdAllocator(
             Object key, long sequenceNumber, String actionName, Event event, String targetName) {
-        this.namespace = new Namespace(key, sequenceNumber, actionName, event, targetName);
+        // The target name is required. It is the only input that separates the id ranges of two
+        // calls issued from the same execution, so a null here would collapse them onto one digest
+        // and one ordinal sequence, colliding registration keys and durable slots.
+        this.namespace =
+                new Namespace(
+                        key,
+                        sequenceNumber,
+                        actionName,
+                        event,
+                        Objects.requireNonNull(
+                                targetName,
+                                "An id allocation target name is required: the framework must"
+                                        + " inject the sub-agent resource name, and a built-in"
+                                        + " chat call supplies its own namespace."));
     }
 
     /** Creates a new, ordinal-increasing session id scoped to this task's namespace. */
@@ -59,7 +73,8 @@ public final class DeterministicIdAllocator {
 
     /**
      * Creates a new call id by appending the per-session ordinal (starting at 1) to the session id.
-     * Ordinals restart per action execution, so ids assigned here stay valid only within it.
+     * A caller-supplied session id is used verbatim and never parsed. Ordinals restart per action
+     * execution, so ids assigned here stay valid only within it.
      */
     public String nextCallId(String sessionId) {
         int ordinal = perSessionCallOrdinals.merge(sessionId, 1, Integer::sum);
@@ -105,10 +120,7 @@ public final class DeterministicIdAllocator {
         @JsonProperty("subagentName")
         private final String targetName;
 
-        /**
-         * Computed lazily on the first allocation. Digesting is mailbox-confined, so it needs no
-         * synchronization.
-         */
+        /** Computed lazily under operator ownership, so it needs no additional synchronization. */
         @JsonIgnore @Nullable private String digest;
 
         public Namespace(
diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java b/runtime/src/main/java/org/apache/flink/agents/runtime/utils/IdAllocatorSource.java
similarity index 53%
rename from runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java
rename to runtime/src/main/java/org/apache/flink/agents/runtime/utils/IdAllocatorSource.java
index c84e559c4..0e7d34ce2 100644
--- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/parallel/ParallelExecutionContextRestorer.java
+++ b/runtime/src/main/java/org/apache/flink/agents/runtime/utils/IdAllocatorSource.java
@@ -15,17 +15,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.flink.agents.runtime.operator.parallel;
 
-import org.apache.flink.agents.runtime.operator.ActionTask;
+package org.apache.flink.agents.runtime.utils;
 
 /**
- * Restores the shared runner context to a resuming action task. Called by the async executor after
- * a worker re-acquires the lock, so the shared context is repointed at the task's key, memory,
- * continuation, and durable-execution contexts before control returns to user code.
+ * The executing action's source of {@link DeterministicIdAllocator}s, one per call target.
+ *
+ * <p>Installed on the runner context by the operator on every task switch, restore and transfer, so
+ * a caller reads the executing action's counters off the context it was handed. The mapping from an
+ * execution to its allocators is owned by the installer and outlives a single task, so a
+ * suspend/resume transfer hands the successor the same counters instead of restarting them.
  */
-@FunctionalInterface
-public interface ParallelExecutionContextRestorer {
+public interface IdAllocatorSource {
 
-    void restore(Object key, ActionTask actionTask);
+    /** The counter assigning ids for one target of the executing action, created on first use. */
+    DeterministicIdAllocator allocator(String targetName);
 }
diff --git a/runtime/src/main/java21/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java b/runtime/src/main/java21/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java
index ef7e4f662..4c650d853 100644
--- a/runtime/src/main/java21/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java
+++ b/runtime/src/main/java21/org/apache/flink/agents/runtime/async/ContinuationActionExecutor.java
@@ -22,7 +22,7 @@ import org.apache.flink.agents.api.context.Outcome;
 import jdk.internal.vm.Continuation;
 import jdk.internal.vm.ContinuationScope;
 
-import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextRestorer;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextLifecycle;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionLock;
 
 import java.time.Duration;
@@ -63,13 +63,13 @@ public class ContinuationActionExecutor {
     /**
      * Constructor kept signature-compatible with the base (JDK&lt;21) executor for multi-release
      * uniformity. Continuation execution owns its own async thread pool and never uses the mailbox
-     * lock or context restorer, so both are ignored here.
+     * lock or context lifecycle, so both are ignored here.
      */
     public ContinuationActionExecutor(
             int numAsyncThreads,
             Runnable threadCleanup,
             ParallelExecutionLock parallelExecutionLock,
-            ParallelExecutionContextRestorer contextRestorer) {
+            ParallelExecutionContextLifecycle contextLifecycle) {
         LOG.info("Initialize fixed thread pool for async task with {} threads", numAsyncThreads);
         this.asyncThreadFactory = new AsyncExecutorThreadFactory(threadCleanup);
         this.asyncExecutor =
@@ -440,4 +440,12 @@ public class ContinuationActionExecutor {
     public static boolean isContinuationSupported() {
         return true;
     }
+
+    /**
+     * Always false here: continuation execution releases the operator by yielding the caller's
+     * continuation, never by handing off a parallel execution lock it does not use.
+     */
+    public boolean canHandOffExecutionLock() {
+        return false;
+    }
 }
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutorTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutorTest.java
index 4a196d708..a64a3fdab 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutorTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/async/ContinuationActionExecutorTest.java
@@ -17,13 +17,21 @@
  */
 package org.apache.flink.agents.runtime.async;
 
-import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextRestorer;
+import org.apache.flink.agents.runtime.operator.ActionTask;
+import org.apache.flink.agents.runtime.operator.parallel.ActionTaskLifecycleException;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextLifecycle;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionLock;
+import org.apache.flink.agents.runtime.operator.parallel.UncapturableException;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+import org.junit.jupiter.params.provider.ValueSource;
 
 import java.util.List;
-import java.util.concurrent.Callable;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -31,13 +39,21 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Supplier;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.jupiter.api.Assumptions.assumeFalse;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
 
 /** Tests the JDK<21 mailbox-lock handoff contract. */
+@Timeout(15)
 class ContinuationActionExecutorTest {
 
     @BeforeEach
@@ -48,24 +64,18 @@ class ContinuationActionExecutorTest {
         assumeFalse(ContinuationActionExecutor.isContinuationSupported());
     }
 
-    @Test
-    void executeAsyncReleasesAndReacquiresLockAndRestoresContext() throws Exception {
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void suspendsAndResumesUnderLockAroundSupplier(boolean batch) throws Exception {
         ParallelExecutionLock lock = new ParallelExecutionLock();
-        AtomicBoolean restored = new AtomicBoolean();
-        // The executor drives the restorer once the worker re-acquires the lock after the blocking
-        // callable returns; the context is otherwise opaque to this test.
-        ParallelExecutionContextRestorer restorer =
-                (key, action) -> {
-                    lock.checkReentrant();
-                    restored.set(true);
-                };
-        ContinuationActionExecutor executor =
-                new ContinuationActionExecutor(1, () -> {}, lock, restorer);
         ContinuationContext context = new ContinuationContext();
-
+        Queue<String> calls = new ConcurrentLinkedQueue<>();
+        ParallelExecutionContextLifecycle lifecycle = recordingLifecycle(lock, calls);
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
         CountDownLatch supplierStarted = new CountDownLatch(1);
         CountDownLatch allowSupplierToFinish = new CountDownLatch(1);
-
+        CountDownLatch supplierFinished = new CountDownLatch(1);
         ExecutorService workerExecutor = Executors.newSingleThreadExecutor();
         try {
             Future<String> workerResult =
@@ -73,37 +83,283 @@ class ContinuationActionExecutorTest {
                             () -> {
                                 lock.acquireByWorker(0, 0);
                                 try {
-                                    return executor.executeAsync(
+                                    return execute(
+                                            executor,
                                             context,
+                                            batch,
                                             () -> {
+                                                assertThat(lock.isHeldByCurrentThread()).isFalse();
+                                                calls.add("supplier");
                                                 supplierStarted.countDown();
                                                 await(allowSupplierToFinish);
+                                                supplierFinished.countDown();
                                                 return "result";
                                             });
                                 } finally {
-                                    lock.release();
+                                    if (lock.isHeldByCurrentThread()) {
+                                        lock.release();
+                                    }
                                 }
                             });
 
             assertThat(supplierStarted.await(5, TimeUnit.SECONDS)).isTrue();
-
             lock.acquireByMain();
             try {
-                lock.checkReentrant();
+                allowSupplierToFinish.countDown();
+                assertThat(supplierFinished.await(5, TimeUnit.SECONDS)).isTrue();
+                assertThat(calls).containsExactly("suspend", "supplier");
             } finally {
                 lock.release();
             }
-            assertThat(restored).isFalse();
-
-            allowSupplierToFinish.countDown();
             assertThat(workerResult.get(5, TimeUnit.SECONDS)).isEqualTo("result");
-            assertThat(restored).isTrue();
+            assertThat(calls).containsExactly("suspend", "supplier", "resume");
         } finally {
+            allowSupplierToFinish.countDown();
             workerExecutor.shutdownNow();
             executor.close();
         }
     }
 
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void abortsBeforeCallbacksAndSupplierWhenCallerDoesNotOwnLock(boolean batch) {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        AtomicBoolean supplierCalled = new AtomicBoolean();
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
+        try {
+            assertThatThrownBy(
+                            () ->
+                                    execute(
+                                            executor,
+                                            new ContinuationContext(),
+                                            batch,
+                                            () -> {
+                                                supplierCalled.set(true);
+                                                return "unexpected";
+                                            }))
+                    .isInstanceOf(IllegalStateException.class);
+            assertThat(supplierCalled).isFalse();
+            verifyNoInteractions(lifecycle);
+        } finally {
+            executor.close();
+        }
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void suspendFailureKeepsLockAndSkipsSupplierAndResume(boolean batch) throws Exception {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        ContinuationContext context = new ContinuationContext();
+        AtomicBoolean supplierCalled = new AtomicBoolean();
+        AssertionError failure = new AssertionError("suspend failed");
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
+        doAnswer(
+                        invocation -> {
+                            lock.checkReentrant();
+                            throw failure;
+                        })
+                .when(lifecycle)
+                .suspend(null, null);
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
+        lock.acquireByWorker(0, 0);
+        try {
+            assertThatThrownBy(
+                            () ->
+                                    execute(
+                                            executor,
+                                            context,
+                                            batch,
+                                            () -> {
+                                                supplierCalled.set(true);
+                                                return "unexpected";
+                                            }))
+                    .isExactlyInstanceOf(UncapturableException.class)
+                    .satisfies(
+                            shell ->
+                                    assertThat(shell.getCause())
+                                            .isExactlyInstanceOf(ActionTaskLifecycleException.class)
+                                            .hasMessage("Could not suspend action task")
+                                            .hasCause(failure));
+            assertThat(lock.isHeldByCurrentThread()).isTrue();
+            assertThat(supplierCalled).isFalse();
+            verify(lifecycle).suspend(null, null);
+            verifyNoMoreInteractions(lifecycle);
+        } finally {
+            if (lock.isHeldByCurrentThread()) {
+                lock.release();
+            }
+            executor.close();
+        }
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void resumeFailureIsUncapturableAfterSupplierCompletes(boolean batch) throws Exception {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        ContinuationContext context = new ContinuationContext();
+        AtomicBoolean supplierCalled = new AtomicBoolean();
+        AssertionError failure = new AssertionError("resume failed");
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
+        doAnswer(
+                        invocation -> {
+                            lock.checkReentrant();
+                            assertThat(supplierCalled).isTrue();
+                            throw failure;
+                        })
+                .when(lifecycle)
+                .resume(null, null);
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
+        lock.acquireByWorker(0, 0);
+        try {
+            assertThatThrownBy(
+                            () ->
+                                    execute(
+                                            executor,
+                                            context,
+                                            batch,
+                                            () -> {
+                                                supplierCalled.set(true);
+                                                return "result";
+                                            }))
+                    .isExactlyInstanceOf(UncapturableException.class)
+                    .satisfies(
+                            shell ->
+                                    assertThat(shell.getCause())
+                                            .isExactlyInstanceOf(ActionTaskLifecycleException.class)
+                                            .hasMessage("Could not resume action task")
+                                            .hasCause(failure))
+                    .satisfies(shell -> assertThat(shell.getSuppressed()).isEmpty());
+            assertThat(lock.isHeldByCurrentThread()).isTrue();
+            verify(lifecycle).suspend(null, null);
+            verify(lifecycle).resume(null, null);
+            verifyNoMoreInteractions(lifecycle);
+        } finally {
+            lock.release();
+            executor.close();
+        }
+    }
+
+    @ParameterizedTest
+    @CsvSource({"false, false", "false, true", "true, true"})
+    void resumeFailureSuppressesEscapingSupplierFailure(boolean batch, boolean supplierThrowsError)
+            throws Exception {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        ContinuationContext context = new ContinuationContext();
+        Throwable supplierFailure =
+                supplierThrowsError
+                        ? new AssertionError("supplier failed")
+                        : new IllegalArgumentException("supplier failed");
+        IllegalStateException resumeFailure = new IllegalStateException("resume failed");
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
+        doAnswer(
+                        invocation -> {
+                            lock.checkReentrant();
+                            throw resumeFailure;
+                        })
+                .when(lifecycle)
+                .resume(null, null);
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
+        lock.acquireByWorker(0, 0);
+        try {
+            assertThatThrownBy(
+                            () ->
+                                    execute(
+                                            executor,
+                                            context,
+                                            batch,
+                                            () -> {
+                                                if (supplierFailure instanceof Error) {
+                                                    throw (Error) supplierFailure;
+                                                }
+                                                throw (RuntimeException) supplierFailure;
+                                            }))
+                    .isExactlyInstanceOf(UncapturableException.class)
+                    .satisfies(
+                            shell ->
+                                    assertThat(shell.getCause())
+                                            .isExactlyInstanceOf(ActionTaskLifecycleException.class)
+                                            .hasMessage("Could not resume action task")
+                                            .hasCause(resumeFailure))
+                    .satisfies(
+                            shell ->
+                                    assertThat(shell.getSuppressed())
+                                            .containsExactly(supplierFailure));
+            assertThat(lock.isHeldByCurrentThread()).isTrue();
+        } finally {
+            lock.release();
+            executor.close();
+        }
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void supplierErrorIsNotWrappedWhenResumeSucceeds(boolean batch) throws Exception {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        ContinuationContext context = new ContinuationContext();
+        Queue<String> calls = new ConcurrentLinkedQueue<>();
+        AssertionError failure = new AssertionError("supplier failed");
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, recordingLifecycle(lock, calls));
+        lock.acquireByWorker(0, 0);
+        try {
+            assertThatThrownBy(
+                            () ->
+                                    execute(
+                                            executor,
+                                            context,
+                                            batch,
+                                            () -> {
+                                                calls.add("supplier");
+                                                throw failure;
+                                            }))
+                    .isSameAs(failure);
+            assertThat(calls).containsExactly("suspend", "supplier", "resume");
+            assertThat(lock.isHeldByCurrentThread()).isTrue();
+        } finally {
+            lock.release();
+            executor.close();
+        }
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void supplierExceptionKeepsBusinessSemantics(boolean batch) throws Exception {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        ContinuationContext context = new ContinuationContext();
+        Queue<String> calls = new ConcurrentLinkedQueue<>();
+        IllegalArgumentException failure = new IllegalArgumentException("supplier failed");
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, recordingLifecycle(lock, calls));
+        Supplier<String> supplier =
+                () -> {
+                    calls.add("supplier");
+                    throw failure;
+                };
+        lock.acquireByWorker(0, 0);
+        try {
+            if (batch) {
+                BatchExecutionResult<String> result =
+                        executor.executeAllAsync(
+                                context, List.of(supplier::get, () -> "second"), null, 1);
+                assertThat(result.getOutcomes().get(0).getError()).isSameAs(failure);
+                assertThat(result.getOutcomes().get(1).getValue()).isEqualTo("second");
+            } else {
+                assertThatThrownBy(() -> executor.executeAsync(context, supplier))
+                        .isSameAs(failure);
+            }
+            assertThat(calls).containsExactly("suspend", "supplier", "resume");
+            assertThat(lock.isHeldByCurrentThread()).isTrue();
+        } finally {
+            lock.release();
+            executor.close();
+        }
+    }
+
     @Test
     void executeAsyncKeepsResultWhenCallLeavesInterruptFlagSet() throws Throwable {
         assertThat(
@@ -135,17 +391,21 @@ class ContinuationActionExecutorTest {
      */
     private static String runInterruptingCall(Supplier<String> call) throws Throwable {
         ParallelExecutionLock lock = new ParallelExecutionLock();
-        AtomicBoolean restored = new AtomicBoolean();
+        AtomicBoolean resumed = new AtomicBoolean();
         AtomicBoolean interruptedAfterCall = new AtomicBoolean();
+        ParallelExecutionContextLifecycle lifecycle =
+                new ParallelExecutionContextLifecycle() {
+                    @Override
+                    public void suspend(Object key, ActionTask actionTask) {}
+
+                    @Override
+                    public void resume(Object key, ActionTask actionTask) {
+                        lock.checkReentrant();
+                        resumed.set(true);
+                    }
+                };
         ContinuationActionExecutor executor =
-                new ContinuationActionExecutor(
-                        1,
-                        () -> {},
-                        lock,
-                        (key, action) -> {
-                            lock.checkReentrant();
-                            restored.set(true);
-                        });
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
         ExecutorService workerExecutor = Executors.newSingleThreadExecutor();
         try {
             Future<String> workerResult =
@@ -156,7 +416,9 @@ class ContinuationActionExecutorTest {
                                     return executor.executeAsync(new ContinuationContext(), call);
                                 } finally {
                                     interruptedAfterCall.set(Thread.interrupted());
-                                    lock.release();
+                                    if (lock.isHeldByCurrentThread()) {
+                                        lock.release();
+                                    }
                                 }
                             });
             try {
@@ -164,7 +426,7 @@ class ContinuationActionExecutorTest {
             } catch (ExecutionException e) {
                 throw e.getCause();
             } finally {
-                assertThat(restored).isTrue();
+                assertThat(resumed).isTrue();
                 assertThat(interruptedAfterCall).isTrue();
             }
         } finally {
@@ -173,103 +435,154 @@ class ContinuationActionExecutorTest {
         }
     }
 
-    @Test
-    void executeAllAsyncReleasesAndReacquiresLockAndRestoresContext() throws Exception {
+    /**
+     * An interrupt arriving while the worker waits to re-acquire -- the coordinator's shutdown
+     * interrupt, rather than a flag the call left set -- still abandons the handoff: the worker
+     * ends up without the lock and the context is never resumed.
+     */
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void interruptedReacquisitionDoesNotResume(boolean supplierFails) throws Exception {
         ParallelExecutionLock lock = new ParallelExecutionLock();
-        AtomicBoolean restored = new AtomicBoolean();
-        ParallelExecutionContextRestorer restorer =
-                (key, action) -> {
-                    lock.checkReentrant();
-                    restored.set(true);
-                };
-        ContinuationActionExecutor executor =
-                new ContinuationActionExecutor(1, () -> {}, lock, restorer);
         ContinuationContext context = new ContinuationContext();
-        CountDownLatch supplierStarted = new CountDownLatch(1);
-        CountDownLatch allowSupplierToFinish = new CountDownLatch(1);
-        List<Callable<String>> suppliers =
-                List.of(
-                        () -> {
-                            supplierStarted.countDown();
-                            await(allowSupplierToFinish);
-                            return "first";
-                        },
-                        () -> "second");
-
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
+        ContinuationActionExecutor executor =
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
+        CountDownLatch inSupplier = new CountDownLatch(1);
+        CountDownLatch mainHoldsLock = new CountDownLatch(1);
+        AtomicReference<Thread> workerThread = new AtomicReference<>();
         ExecutorService workerExecutor = Executors.newSingleThreadExecutor();
         try {
-            Future<BatchExecutionResult<String>> workerResult =
+            Future<String> workerResult =
                     workerExecutor.submit(
                             () -> {
                                 lock.acquireByWorker(0, 0);
+                                workerThread.set(Thread.currentThread());
                                 try {
-                                    return executor.executeAllAsync(
-                                            context, suppliers, null, suppliers.size());
+                                    return executor.executeAsync(
+                                            context,
+                                            () -> {
+                                                inSupplier.countDown();
+                                                await(mainHoldsLock);
+                                                if (supplierFails) {
+                                                    throw new IllegalArgumentException(
+                                                            "supplier failed");
+                                                }
+                                                return "result";
+                                            });
                                 } finally {
-                                    lock.release();
+                                    if (lock.isHeldByCurrentThread()) {
+                                        lock.release();
+                                    }
                                 }
                             });
+            assertThat(inSupplier.await(5, TimeUnit.SECONDS)).isTrue();
 
-            assertThat(supplierStarted.await(5, TimeUnit.SECONDS)).isTrue();
-
+            // Hold the lock here so the worker's re-acquire has to queue behind it, then interrupt
+            // that wait. An interrupt landing before the worker queues is consumed by the
+            // flag-clearing the handoff does, so it is repeated until the wait is abandoned.
             lock.acquireByMain();
             try {
-                lock.checkReentrant();
+                mainHoldsLock.countDown();
+                long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(5);
+                while (!workerResult.isDone()) {
+                    workerThread.get().interrupt();
+                    assertThat(System.nanoTime())
+                            .as("worker never abandoned the interrupted re-acquire")
+                            .isLessThan(deadline);
+                    Thread.sleep(10L);
+                }
+                assertThatThrownBy(() -> workerResult.get(5, TimeUnit.SECONDS))
+                        .isExactlyInstanceOf(ExecutionException.class)
+                        .hasCauseExactlyInstanceOf(InterruptedException.class);
             } finally {
                 lock.release();
             }
-            assertThat(restored).isFalse();
 
-            allowSupplierToFinish.countDown();
-            BatchExecutionResult<String> result = workerResult.get(5, TimeUnit.SECONDS);
-            assertThat(result.getOutcomes().get(0).getValue()).isEqualTo("first");
-            assertThat(result.getOutcomes().get(1).getValue()).isEqualTo("second");
-            assertThat(restored).isTrue();
+            verify(lifecycle).suspend(null, null);
+            verify(lifecycle, never()).resume(null, null);
         } finally {
+            mainHoldsLock.countDown();
             workerExecutor.shutdownNow();
             executor.close();
         }
     }
 
-    @Test
-    void executeAsyncAbortsBeforeSupplierWhenCallerDoesNotOwnLock() throws Exception {
-        ParallelExecutionLock lock = new ParallelExecutionLock();
-        AtomicBoolean supplierCalled = new AtomicBoolean();
-        AtomicBoolean restored = new AtomicBoolean();
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void executionWithoutLockDoesNotCallLifecycle(boolean batch) throws Exception {
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
         ContinuationActionExecutor executor =
-                new ContinuationActionExecutor(
-                        1, () -> {}, lock, (key, action) -> restored.set(true));
+                new ContinuationActionExecutor(1, () -> {}, null, lifecycle);
         try {
-            // executeAsync asserts mailbox-lock ownership before releasing it. Calling without the
-            // lock must fail fast, before the supplier runs and before any restore.
-            assertThatThrownBy(
-                            () ->
-                                    executor.executeAsync(
-                                            new ContinuationContext(),
-                                            () -> {
-                                                supplierCalled.set(true);
-                                                return "unexpected";
-                                            }))
-                    .isInstanceOf(IllegalStateException.class);
-            assertThat(supplierCalled).isFalse();
-            assertThat(restored).isFalse();
+            assertThat(execute(executor, new ContinuationContext(), batch, () -> "result"))
+                    .isEqualTo("result");
+            verifyNoInteractions(lifecycle);
         } finally {
             executor.close();
         }
     }
 
-    @Test
-    void executeAsyncWithoutMailboxLockKeepsSynchronousFallback() throws Exception {
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void emptyBatchDoesNotCallLifecycleOrChangeLockOwnership(boolean ownsLock) throws Exception {
+        ParallelExecutionLock lock = new ParallelExecutionLock();
+        ParallelExecutionContextLifecycle lifecycle = mock(ParallelExecutionContextLifecycle.class);
         ContinuationActionExecutor executor =
-                new ContinuationActionExecutor(1, () -> {}, null, null);
+                new ContinuationActionExecutor(1, () -> {}, lock, lifecycle);
+        if (ownsLock) {
+            lock.acquireByWorker(0, 0);
+        }
         try {
-            assertThat(executor.executeAsync(new ContinuationContext(), () -> "result"))
-                    .isEqualTo("result");
+            assertThat(
+                            executor.executeAllAsync(new ContinuationContext(), List.of(), null, 1)
+                                    .getOutcomes())
+                    .isEmpty();
+            assertThat(lock.isHeldByCurrentThread()).isEqualTo(ownsLock);
+            verifyNoInteractions(lifecycle);
         } finally {
+            if (lock.isHeldByCurrentThread()) {
+                lock.release();
+            }
             executor.close();
         }
     }
 
+    private static ParallelExecutionContextLifecycle recordingLifecycle(
+            ParallelExecutionLock lock, Queue<String> calls) {
+        return new ParallelExecutionContextLifecycle() {
+            @Override
+            public void suspend(Object key, ActionTask actionTask) {
+                lock.checkReentrant();
+                assertThat(key).isNull();
+                assertThat(actionTask).isNull();
+                calls.add("suspend");
+            }
+
+            @Override
+            public void resume(Object key, ActionTask actionTask) {
+                lock.checkReentrant();
+                assertThat(key).isNull();
+                assertThat(actionTask).isNull();
+                calls.add("resume");
+            }
+        };
+    }
+
+    private static String execute(
+            ContinuationActionExecutor executor,
+            ContinuationContext context,
+            boolean batch,
+            Supplier<String> supplier)
+            throws Exception {
+        if (batch) {
+            BatchExecutionResult<String> result =
+                    executor.executeAllAsync(context, List.of(supplier::get), null, 1);
+            return result.getOutcomes().get(0).getValue();
+        }
+        return executor.executeAsync(context, supplier);
+    }
+
     private static void await(CountDownLatch latch) {
         try {
             assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue();
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallDeadlockTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallDeadlockTest.java
new file mode 100644
index 000000000..9f2cda700
--- /dev/null
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallDeadlockTest.java
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.chat;
+
+import org.apache.flink.agents.api.Event;
+import org.apache.flink.agents.api.InputEvent;
+import org.apache.flink.agents.api.OutputEvent;
+import org.apache.flink.agents.api.agents.Agent;
+import org.apache.flink.agents.api.agents.AgentExecutionOptions;
+import org.apache.flink.agents.api.annotation.ToolParam;
+import org.apache.flink.agents.api.chat.messages.ChatMessage;
+import org.apache.flink.agents.api.chat.messages.ChatResult;
+import org.apache.flink.agents.api.chat.messages.ToolCallBlock;
+import org.apache.flink.agents.api.chat.model.BaseChatModelSetup;
+import org.apache.flink.agents.api.context.RunnerContext;
+import org.apache.flink.agents.api.resource.ResourceContext;
+import org.apache.flink.agents.api.resource.ResourceDescriptor;
+import org.apache.flink.agents.api.resource.ResourceType;
+import org.apache.flink.agents.api.tools.Tool;
+import org.apache.flink.agents.plan.AgentPlan;
+import org.apache.flink.agents.runtime.operator.ActionExecutionOperator;
+import org.apache.flink.agents.runtime.operator.ActionExecutionOperatorFactory;
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.api.java.functions.KeySelector;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.api.condition.EnabledForJreRange;
+import org.junit.jupiter.api.condition.JRE;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * The chat side of GitHub issue #1213. Awaiting a chat response used to be dispatched to an
+ * async-pool worker, which then blocked there for the whole call. The chat subgraph the caller is
+ * waiting for runs its own {@code chat_model_action} and {@code tool_call_action} through {@code
+ * durableExecuteAsync}, so it needs a worker from that same finite pool to make progress. With
+ * {@code num-async-threads=1} the caller holds the only worker the subgraph needs — a self-deadlock
+ * — and nested or concurrent chat calls exhaust any larger pool the same way.
+ *
+ * <p>The wait must instead yield the caller's continuation and hold no worker. These tests time out
+ * under the broken behavior and complete promptly once fixed.
+ */
+@EnabledForJreRange(min = JRE.JAVA_21)
+public class ChatCallDeadlockTest {
+
+    private static final AtomicInteger MODEL_CALLS = new AtomicInteger();
+    private static final AtomicInteger TOOL_CALLS = new AtomicInteger();
+
+    @BeforeEach
+    void resetCounters() {
+        MODEL_CALLS.set(0);
+        TOOL_CALLS.set(0);
+    }
+
+    /**
+     * Trivial provider: it returns immediately, but reaching it still costs an async-pool worker
+     * because {@code chat.async} and {@code tool-call.async} keep their defaults. Under the
+     * deadlock that worker is never granted.
+     */
+    public static class Model extends BaseChatModelSetup {
+        public Model(ResourceDescriptor descriptor, ResourceContext ctx) {
+            super(descriptor, ctx);
+        }
+
+        @Override
+        public void open() {}
+
+        @Override
+        public Map<String, Object> getParameters() {
+            return Map.of();
+        }
+
+        @Override
+        public ChatResult chat(
+                List<ChatMessage> messages, Map<String, Object> args, Map<String, Object> params) {
+            MODEL_CALLS.incrementAndGet();
+            String text = messages.get(0).getText();
+            if ("tool".equals(text) && messages.size() == 1) {
+                return new ChatResult(
+                        ChatMessage.assistant(
+                                List.of(
+                                        new ToolCallBlock(
+                                                "tool-1", "echo", Map.of("value", "hello")))));
+            }
+            return new ChatResult(ChatMessage.assistant("answer:" + text));
+        }
+    }
+
+    public static String echo(@ToolParam(name = "value") String value) {
+        TOOL_CALLS.incrementAndGet();
+        return value;
+    }
+
+    @SuppressWarnings("unused")
+    public static void caller(Event event, RunnerContext ctx) throws Exception {
+        String input = String.valueOf(InputEvent.fromEvent(event).getInput());
+        ctx.getShortTermMemory().set("caller", "visible");
+        ChatResult response = ctx.chat("model", List.of(ChatMessage.user(input))).await();
+        ctx.sendEvent(new OutputEvent(response.getText()));
+    }
+
+    /**
+     * One model turn: the caller's await must not hold the only worker, or {@code
+     * chat_model_action} can never run its durable async call and this test times out.
+     */
+    @Test
+    @Timeout(30)
+    void singleAsyncThreadDoesNotDeadlockOnChatModelCall() throws Exception {
+        assertThat(run("hello")).containsExactly("answer:hello");
+        assertThat(MODEL_CALLS.get()).isEqualTo(1);
+        assertThat(TOOL_CALLS.get()).isZero();
+    }
+
+    /**
+     * A model/tool/model loop multiplies the workers the subgraph needs while the caller's single
+     * wait is still in flight, so both built-in actions must be served without the caller holding
+     * one.
+     */
+    @Test
+    @Timeout(30)
+    void singleAsyncThreadDoesNotDeadlockOnChatToolLoop() throws Exception {
+        assertThat(run("tool")).containsExactly("answer:tool");
+        assertThat(MODEL_CALLS.get()).isEqualTo(2);
+        assertThat(TOOL_CALLS.get()).isEqualTo(1);
+    }
+
+    // --- helpers ---
+
+    /**
+     * A plan with a single async worker. {@code chat.async} and {@code tool-call.async} stay at
+     * their defaults, so the chat subgraph genuinely competes with the caller for that one worker.
+     */
+    private static AgentPlan plan() throws Exception {
+        Agent agent = new Agent();
+        agent.addResource(
+                "model",
+                ResourceType.CHAT_MODEL,
+                ResourceDescriptor.Builder.newBuilder(Model.class.getName()).build());
+        agent.addResource(
+                "echo",
+                ResourceType.TOOL,
+                Tool.fromMethod(ChatCallDeadlockTest.class.getMethod("echo", String.class)));
+        agent.addAction(
+                new String[] {InputEvent.EVENT_TYPE},
+                ChatCallDeadlockTest.class.getMethod("caller", Event.class, RunnerContext.class));
+        AgentPlan plan = new AgentPlan(agent);
+        plan.getConfig().set(AgentExecutionOptions.NUM_ASYNC_THREADS, 1);
+        return plan;
+    }
+
+    private static List<Object> run(String input) throws Exception {
+        try (KeyedOneInputStreamOperatorTestHarness<String, String, Object> harness =
+                new KeyedOneInputStreamOperatorTestHarness<>(
+                        new ActionExecutionOperatorFactory<>(plan(), true),
+                        (KeySelector<String, String>) value -> value,
+                        TypeInformation.of(String.class))) {
+            harness.open();
+            harness.processElement(new StreamRecord<>(input));
+            ((ActionExecutionOperator<?, ?>) harness.getOperator()).waitInFlightEventsFinished();
+            List<Object> values = new ArrayList<>();
+            for (Object record : harness.getRecordOutput()) {
+                values.add(((StreamRecord<?>) record).getValue());
+            }
+            return values;
+        }
+    }
+}
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallOwnerTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallOwnerTest.java
deleted file mode 100644
index 779ebe669..000000000
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallOwnerTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.agents.runtime.chat;
-
-import org.apache.flink.agents.api.Event;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/** Verifies distinct call IDs within one execution and stable IDs across replay. */
-class ChatCallOwnerTest {
-    @Test
-    void multipleCallsHaveDistinctCallIds() {
-        ChatCallOwner owner = new ChatCallOwner("key", 1, "action", new Event("input"));
-        String firstCallId = owner.nextCallId();
-        String secondCallId = owner.nextCallId();
-
-        assertThat(secondCallId).isNotEqualTo(firstCallId);
-        assertThat(owner.getKey()).isEqualTo("key");
-    }
-
-    @Test
-    void replayRecreatesCallIds() {
-        ChatCallOwner original = new ChatCallOwner("key", 1, "action", new Event("input"));
-        ChatCallOwner replay = new ChatCallOwner("key", 1, "action", new Event("input"));
-
-        assertThat(replay.nextCallId()).isEqualTo(original.nextCallId());
-        assertThat(replay.nextCallId()).isEqualTo(original.nextCallId());
-    }
-}
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/ChatCallManagerTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallTest.java
similarity index 61%
rename from runtime/src/test/java/org/apache/flink/agents/runtime/context/ChatCallManagerTest.java
rename to runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallTest.java
index 9cfd6b869..fdbdb4560 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/ChatCallManagerTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatCallTest.java
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.flink.agents.runtime.context;
+package org.apache.flink.agents.runtime.chat;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.flink.agents.api.Event;
@@ -31,12 +31,15 @@ import org.apache.flink.agents.runtime.actionstate.ActionState;
 import org.apache.flink.agents.runtime.actionstate.ActionStateSerde;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
 import org.apache.flink.agents.runtime.async.ContinuationContext;
-import org.apache.flink.agents.runtime.chat.ChatCallManager;
-import org.apache.flink.agents.runtime.chat.ChatCallOwner;
-import org.apache.flink.agents.runtime.chat.ChatContext;
-import org.apache.flink.agents.runtime.chat.ChatInvocation;
+import org.apache.flink.agents.runtime.context.ActionStatePersister;
+import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.subgraph.SubgraphCallManager;
 import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
+import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
+import org.apache.flink.agents.runtime.utils.IdAllocatorSource;
 import org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledForJreRange;
@@ -54,51 +57,76 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 
-class ChatCallManagerTest {
+/** Exercises the chat call through the two bridge methods a polling caller drives it by. */
+class ChatCallTest {
     private static final ObjectMapper MAPPER = new ObjectMapper();
-    private final ChatCallManager manager = new ChatCallManager();
+    private final SubgraphCallManager calls = new SubgraphCallManager();
+
+    /**
+     * Stands in for the id counters the context manager installs for one task execution: one
+     * allocator per target name over the caller's digest facts, whose ordinals continue for as long
+     * as this source stays bound.
+     */
+    private static void bindChatIds(RunnerContextImpl context, Object key, Event event) {
+        Map<String, DeterministicIdAllocator> byTarget = new HashMap<>();
+        context.setIdAllocatorSource(
+                name ->
+                        byTarget.computeIfAbsent(
+                                name,
+                                target ->
+                                        new DeterministicIdAllocator(
+                                                key, 1, "action", event, target)));
+    }
+
+    /**
+     * Moves a context onto a different record. The record key travels with the action context, so
+     * this — and not the id counters — is what separates two calls for record-scoped cleanup. The
+     * counters are rebound over the same key so the digest facts agree with it.
+     */
+    private static void switchToRecord(RunnerContextImpl context, String recordKey, Event event) {
+        context.switchActionContext(
+                "action",
+                new RunnerContextImpl.MemoryContext(null, null),
+                new ArrayList<>(),
+                recordKey,
+                recordKey,
+                "observation",
+                false,
+                null);
+        bindChatIds(context, recordKey, event);
+    }
 
     @Test
-    void sharedManagerUsesTheExplicitCallerForPersistence() throws Exception {
+    void persistenceFollowsTheExplicitCallerContext() throws Exception {
         ActionState firstState = new ActionState(new Event("input"));
         ActionState secondState = new ActionState(new Event("input"));
         RunnerContextImpl first = context(firstState, (k, s, a, e, saved) -> {});
         RunnerContextImpl second = context(secondState, (k, s, a, e, saved) -> {});
-        second.setChatContext(
-                new ChatContext(
-                        manager, new ChatCallOwner("second-key", 1, "action", new Event("input"))));
-        String firstId = manager.prepareCall(first, request());
-        String secondId = manager.prepareCall(second, request());
-        ChatInvocation firstCall = manager.get(firstId);
-        ChatInvocation secondCall = manager.get(secondId);
-        firstCall.complete(
-                ChatResponseEvent.success(
-                        firstCall.getRequestId(), new ChatResult(ChatMessage.assistant("first"))));
-        secondCall.complete(
-                ChatResponseEvent.success(
-                        secondCall.getRequestId(),
-                        new ChatResult(ChatMessage.assistant("second"))));
+        bindChatIds(second, "second-key", new Event("input"));
+        String firstId = first.prepareChatCall(request());
+        String secondId = second.prepareChatCall(request());
+        chatCall(first, firstId)
+                .dispatch(
+                        ChatResponseEvent.success(
+                                UUID.randomUUID(), new ChatResult(ChatMessage.assistant("first"))));
+        chatCall(second, secondId)
+                .dispatch(
+                        ChatResponseEvent.success(
+                                UUID.randomUUID(),
+                                new ChatResult(ChatMessage.assistant("second"))));
 
         assertThat(firstState.getCallResults()).isEmpty();
         assertThat(secondState.getCallResults()).isEmpty();
-        assertThat(
-                        ((ChatResponseEvent)
-                                        Event.fromJson(manager.tryCompleteCall(second, secondId)))
-                                .getResponse()
-                                .getText())
+        assertThat(response(second.tryCompleteChatCall(secondId)).getResponse().getText())
                 .isEqualTo("second");
         assertThat(secondState.getCallResults()).hasSize(1);
         assertThat(firstState.getCallResults()).isEmpty();
-        assertThat(
-                        ((ChatResponseEvent)
-                                        Event.fromJson(manager.tryCompleteCall(first, firstId)))
-                                .getResponse()
-                                .getText())
+        assertThat(response(first.tryCompleteChatCall(firstId)).getResponse().getText())
                 .isEqualTo("first");
         assertThat(firstState.getCallResults()).hasSize(1);
-        assertThatThrownBy(() -> manager.get(firstId))
+        assertThatThrownBy(() -> chatCall(first, firstId))
                 .hasMessageContaining("Missing subgraph call");
-        assertThatThrownBy(() -> manager.get(secondId))
+        assertThatThrownBy(() -> chatCall(second, secondId))
                 .hasMessageContaining("Missing subgraph call");
     }
 
@@ -108,38 +136,31 @@ class ChatCallManagerTest {
                 context(new ActionState(new Event("input")), (k, s, a, e, saved) -> {});
         RunnerContextImpl second =
                 context(new ActionState(new Event("input")), (k, s, a, e, saved) -> {});
-        second.setChatContext(
-                new ChatContext(
-                        manager, new ChatCallOwner("second-key", 1, "action", new Event("input"))));
-        String firstId = manager.prepareCall(first, request());
-        String secondId = manager.prepareCall(second, request());
-        manager.finishRecord("key");
-        assertThatThrownBy(() -> manager.get(firstId))
+        switchToRecord(second, "second-key", new Event("input"));
+        String firstId = first.prepareChatCall(request());
+        String secondId = second.prepareChatCall(request());
+        calls.finishRecord("key");
+        assertThatThrownBy(() -> chatCall(first, firstId))
                 .hasMessageContaining("Missing subgraph call");
-        assertThat(manager.get(secondId).getId()).isEqualTo(secondId);
-        manager.clear();
-        assertThatThrownBy(() -> manager.get(secondId))
+        assertThat(chatCall(second, secondId).getId()).isEqualTo(secondId);
+        calls.clear();
+        assertThatThrownBy(() -> chatCall(second, secondId))
                 .hasMessageContaining("Missing subgraph call");
     }
 
     @Test
-    void replayedBootstrapKeepsRequestId() throws Exception {
-        RunnerContextImpl original =
+    void bootstrapDelegateKeepsTheCallersRequestId() throws Exception {
+        RunnerContextImpl context =
                 context(new ActionState(new Event("input")), (k, seq, action, event, saved) -> {});
-        String id = manager.prepareCall(original, request());
-        SubgraphEvent bootstrap = (SubgraphEvent) original.getPendingEvents().get(0);
-        UUID requestId = bootstrap.getDelegate().getId();
-        assertThat(manager.get(id).getRequestId()).isEqualTo(requestId);
-        manager.clear();
+        ChatRequestEvent request =
+                new ChatRequestEvent("model", List.of(ChatMessage.user("hello")));
+        context.prepareChatCall(MAPPER.writeValueAsString(request));
 
-        RunnerContextImpl restored =
-                context(new ActionState(new Event("input")), (k, seq, action, event, saved) -> {});
-        String replayId = manager.prepareCall(restored, request());
-        SubgraphEvent replay = (SubgraphEvent) restored.getPendingEvents().get(0);
-        assertThat(replayId).isEqualTo(id);
-        assertThat(replay.getDelegate().getId()).isEqualTo(requestId);
-        assertThat(manager.get(replayId).getRequestId()).isEqualTo(requestId);
-        assertThat(replay.getAttributes()).doesNotContainKey("delegate_id");
+        SubgraphEvent bootstrap = (SubgraphEvent) context.getPendingEvents().get(0);
+        // The response names the request the caller holds, so the delegate keeps its id ...
+        assertThat(bootstrap.getDelegate().getId()).isEqualTo(request.getId());
+        // ... but that id is not replay-stable, so no attribute may key state on it.
+        assertThat(bootstrap.getAttributes()).doesNotContainKey("delegate_id");
     }
 
     @ParameterizedTest
@@ -147,8 +168,8 @@ class ChatCallManagerTest {
     void terminalResponseReplaysWithoutBootstrap(boolean failed) throws Exception {
         ActionState state = new ActionState(new Event("input"));
         RunnerContextImpl context = context(state, (k, seq, action, event, saved) -> {});
-        String id = manager.prepareCall(context, request());
-        ChatInvocation call = manager.get(id);
+        String id = context.prepareChatCall(request());
+        UUID requestId = UUID.randomUUID();
         ChatResult result =
                 new ChatResult(
                         ChatMessage.assistant("answer"),
@@ -159,10 +180,10 @@ class ChatCallManagerTest {
                         Map.of("provider", "test"));
         ChatResponseEvent response =
                 failed
-                        ? ChatResponseEvent.failed(call.getRequestId(), "provider refused", 2, 3)
-                        : ChatResponseEvent.success(call.getRequestId(), result);
-        call.complete(response);
-        manager.tryCompleteCall(context, id);
+                        ? ChatResponseEvent.failed(requestId, "provider refused", 2, 3)
+                        : ChatResponseEvent.success(requestId, result);
+        chatCall(context, id).dispatch(response);
+        context.tryCompleteChatCall(id);
         assertThat(state.getCallResults()).hasSize(1);
         assertThat(state.getCallResults().get(0).isSuccess()).isTrue();
 
@@ -172,11 +193,10 @@ class ChatCallManagerTest {
                         (k, seq, action, event, saved) -> {
                             throw new AssertionError("replay persisted again");
                         });
-        String replayId = manager.prepareCall(restored, request());
+        String replayId = restored.prepareChatCall(request());
         assertThat(replayId).isEqualTo(id);
         assertThat(restored.getPendingEvents()).isEmpty();
-        ChatResponseEvent replay =
-                (ChatResponseEvent) Event.fromJson(manager.tryCompleteCall(restored, replayId));
+        ChatResponseEvent replay = response(restored.tryCompleteChatCall(replayId));
         assertThat(replay.getStatus()).isEqualTo(response.getStatus());
         assertThat(replay.getRequestId()).isEqualTo(response.getRequestId());
         if (failed) {
@@ -194,14 +214,14 @@ class ChatCallManagerTest {
         RunnerContextImpl context = context(state, (k, seq, action, event, saved) -> {});
         Event ordinary = new Event("ordinary");
         context.sendEvent(ordinary);
-        String id = manager.prepareCall(context, request());
-        assertThat(manager.tryCompleteCall(context, id)).isNull();
+        String id = context.prepareChatCall(request());
+        assertThat(context.tryCompleteChatCall(id)).isNull();
         assertThat(state.getCallResults()).isEmpty();
         List<Event> dispatched = context.drainEventsAtActionYield(42L);
         assertThat(dispatched).hasSize(1);
         assertThat(dispatched.get(0)).isInstanceOf(SubgraphEvent.class);
         assertThat(context.getPendingEvents()).containsExactly(ordinary);
-        assertThat(manager.get(id).isDone()).isFalse();
+        assertThat(chatCall(context, id).isDone()).isFalse();
     }
 
     @Test
@@ -212,33 +232,26 @@ class ChatCallManagerTest {
                         (k, seq, action, event, saved) -> {
                             throw new IllegalStateException("state unavailable");
                         });
-        String id = manager.prepareCall(context, request());
-        ChatInvocation call = manager.get(id);
-        call.complete(
+        String id = context.prepareChatCall(request());
+        SubgraphInvocation<ChatResponseEvent> call = chatCall(context, id);
+        call.dispatch(
                 ChatResponseEvent.success(
-                        call.getRequestId(), new ChatResult(ChatMessage.assistant("answer"))));
-        assertThatThrownBy(() -> manager.tryCompleteCall(context, id))
-                .hasMessage("state unavailable");
-        assertThat(call.awaitResponse().isSuccess()).isTrue();
+                        UUID.randomUUID(), new ChatResult(ChatMessage.assistant("answer"))));
+        assertThatThrownBy(() -> context.tryCompleteChatCall(id)).hasMessage("state unavailable");
+        assertThat(call.awaitResult().isSuccess()).isTrue();
     }
 
     @Test
-    void mismatchedAndDuplicateResponsesAreRejected() throws Exception {
+    void duplicateRecordedResponseIsRejected() throws Exception {
         RunnerContextImpl context =
                 context(new ActionState(new Event("input")), (k, s, a, e, saved) -> {});
-        ChatInvocation call = manager.get(manager.prepareCall(context, request()));
-        assertThatThrownBy(
-                        () ->
-                                call.complete(
-                                        ChatResponseEvent.success(
-                                                UUID.randomUUID(),
-                                                new ChatResult(ChatMessage.assistant("wrong")))))
-                .hasMessageContaining("does not match");
+        SubgraphInvocation<ChatResponseEvent> call =
+                chatCall(context, context.prepareChatCall(request()));
         ChatResponseEvent response =
                 ChatResponseEvent.success(
-                        call.getRequestId(), new ChatResult(ChatMessage.assistant("answer")));
-        call.complete(response);
-        assertThatThrownBy(() -> call.complete(response)).hasMessageContaining("Duplicate");
+                        UUID.randomUUID(), new ChatResult(ChatMessage.assistant("answer")));
+        call.installRecorded(response);
+        assertThatThrownBy(() -> call.installRecorded(response)).hasMessageContaining("Duplicate");
     }
 
     @Test
@@ -256,15 +269,15 @@ class ChatCallManagerTest {
     void clearingActiveChatCallRestoresOrdinaryEventRouting() throws Exception {
         RunnerContextImpl context =
                 context(new ActionState(new Event("input")), (k, s, a, e, saved) -> {});
-        ChatContext callerContext = context.getChatContext();
-        ChatCallManager chats = callerContext.getManager();
-        ChatInvocation call = manager.get(chats.prepareCall(context, request()));
+        IdAllocatorSource callerIds = context.getIdAllocatorSource();
+        SubgraphInvocation<ChatResponseEvent> call =
+                chatCall(context, context.prepareChatCall(request()));
         context.getPendingEvents().clear();
         context.setSubgraphInvocation(call);
         context.sendEvent(new ChatRequestEvent("model", List.of()));
         assertThat(context.getPendingEvents()).singleElement().isInstanceOf(SubgraphEvent.class);
         context.getPendingEvents().clear();
-        context.setChatContext(callerContext);
+        context.setIdAllocatorSource(callerIds);
         context.setSubgraphInvocation(null);
         ChatRequestEvent ordinary = new ChatRequestEvent("model", List.of());
         context.sendEvent(ordinary);
@@ -281,9 +294,7 @@ class ChatCallManagerTest {
                         null,
                         "job",
                         null);
-        context.setChatContext(
-                new ChatContext(
-                        manager, new ChatCallOwner("key", 1, "action", new Event("input"))));
+        bindChatIds(context, "key", new Event("input"));
         return context;
     }
 
@@ -301,9 +312,6 @@ class ChatCallManagerTest {
                             "job",
                             executor);
             context.setContinuationContext(new ContinuationContext());
-            context.setChatContext(
-                    new ChatContext(
-                            manager, new ChatCallOwner("key", 1, "action", new Event("input"))));
             assertThatThrownBy(() -> context.chat("model", List.of()).await())
                     .isInstanceOf(UnsupportedOperationException.class)
                     .hasMessageContaining("JDK 21");
@@ -327,17 +335,28 @@ class ChatCallManagerTest {
                 new RunnerContextImpl.MemoryContext(null, null),
                 new ArrayList<>(),
                 "key",
+                "key",
                 "observation",
                 false,
                 null);
-        context.setChatContext(
-                new ChatContext(manager, new ChatCallOwner("key", 1, "action", input)));
+        context.setSubgraphCalls(calls);
+        bindChatIds(context, "key", input);
         context.setDurableExecutionContext(
                 new RunnerContextImpl.DurableExecutionContext(
                         "key", 1, mock(Action.class), input, state, persister));
         return context;
     }
 
+    @SuppressWarnings("unchecked")
+    private static SubgraphInvocation<ChatResponseEvent> chatCall(
+            RunnerContextImpl context, String id) {
+        return (SubgraphInvocation<ChatResponseEvent>) context.getSubgraphCalls().get(id);
+    }
+
+    private static ChatResponseEvent response(String json) throws Exception {
+        return (ChatResponseEvent) Event.fromJson(json);
+    }
+
     private static String request() throws Exception {
         return MAPPER.writeValueAsString(
                 new ChatRequestEvent("model", List.of(ChatMessage.user("hello"))));
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/ChatDurableFutureTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatDurableFutureTest.java
similarity index 73%
rename from runtime/src/test/java/org/apache/flink/agents/runtime/context/ChatDurableFutureTest.java
rename to runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatDurableFutureTest.java
index 0b3bc166e..3ab3f48bf 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/ChatDurableFutureTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatDurableFutureTest.java
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.flink.agents.runtime.context;
+package org.apache.flink.agents.runtime.chat;
 
 import org.apache.flink.agents.api.Event;
 import org.apache.flink.agents.api.chat.messages.ChatMessage;
@@ -29,12 +29,14 @@ import org.apache.flink.agents.runtime.actionstate.ActionState;
 import org.apache.flink.agents.runtime.actionstate.ActionStateSerde;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
 import org.apache.flink.agents.runtime.async.ContinuationContext;
-import org.apache.flink.agents.runtime.chat.ChatCallManager;
-import org.apache.flink.agents.runtime.chat.ChatCallOwner;
-import org.apache.flink.agents.runtime.chat.ChatContext;
-import org.apache.flink.agents.runtime.chat.ChatInvocation;
+import org.apache.flink.agents.runtime.context.ActionStatePersister;
+import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
+import org.apache.flink.agents.runtime.context.RunnerContextImpl;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.subgraph.SubgraphCallManager;
 import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
+import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+import org.apache.flink.agents.runtime.utils.DeterministicIdAllocator;
 import org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
@@ -47,8 +49,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Supplier;
@@ -57,15 +58,15 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 
-/** Exercises the real continuation/worker boundary, not an inline mock of executeAsync. */
+/** Exercises the real continuation boundary, not an inline mock of executeAsync. */
 @EnabledForJreRange(min = JRE.JAVA_21)
 @Timeout(10)
 class ChatDurableFutureTest {
-    private final ChatCallManager manager = new ChatCallManager();
+    private final SubgraphCallManager calls = new SubgraphCallManager();
 
     @ParameterizedTest
     @ValueSource(booleans = {false, true})
-    void waitsOnWorkerAndRecordsOnlyOneTerminalResponse(boolean failed) throws Exception {
+    void yieldsWithoutWorkerAndRecordsOnlyOneTerminalResponse(boolean failed) throws Exception {
         InspectingExecutor executor = new InspectingExecutor();
         try {
             ActionState state = new ActionState(new Event("input"));
@@ -77,26 +78,26 @@ class ChatDurableFutureTest {
             context.sendEvent(ordinary);
             Runnable action = () -> awaitTwice(handle, failed);
 
+            // The wait suspends by yielding the continuation, so the async pool is never entered.
             assertThat(executor.executeAction(context.getContinuationContext(), action)).isFalse();
-            assertThat(executor.workerStarted.await(5, TimeUnit.SECONDS)).isTrue();
-            assertThat(executor.worker.get()).isNotSameAs(Thread.currentThread());
+            assertThat(executor.submissions).isZero();
+            assertThat(executor.worker.get()).isNull();
             assertThat(state.getCallResults()).isEmpty();
-            ChatInvocation call = dispatchedCall(context);
+            SubgraphInvocation<ChatResponseEvent> call = dispatchedCall(context);
             assertThat(context.getPendingEvents()).containsExactly(ordinary);
-            call.complete(
+            call.dispatch(
                     failed
-                            ? ChatResponseEvent.failed(
-                                    call.getRequestId(), "provider refused", 1, 1)
-                            : ChatResponseEvent.success(call.getRequestId(), resultWithMetadata()));
+                            ? ChatResponseEvent.failed(UUID.randomUUID(), "provider refused", 1, 1)
+                            : ChatResponseEvent.success(UUID.randomUUID(), resultWithMetadata()));
             finish(executor, context, action);
 
-            assertThat(executor.submissions).isEqualTo(1);
+            assertThat(executor.submissions).isZero();
             assertThat(writes).hasValue(1);
             assertThat(state.getCallResults()).hasSize(1);
             // A FAILED response is still a recorded response, not a wait/execution exception.
             assertThat(state.getCallResults().get(0).isSuccess()).isTrue();
             assertThat(context.getDurableExecutionContext().getCurrentCallIndex()).isEqualTo(1);
-            assertThatThrownBy(() -> manager.get(call.getId()))
+            assertThatThrownBy(() -> chatCall(context, call.getId()))
                     .hasMessageContaining("Missing subgraph call");
 
             JavaRunnerContextImpl restored =
@@ -113,7 +114,7 @@ class ChatDurableFutureTest {
                                     () -> awaitTwice(replay, failed)))
                     .isTrue();
             assertThat(restored.getPendingEvents()).isEmpty();
-            assertThat(executor.submissions).isEqualTo(1);
+            assertThat(executor.submissions).isZero();
             assertThat(restored.getDurableExecutionContext().getCurrentCallIndex()).isEqualTo(1);
         } finally {
             executor.close();
@@ -121,36 +122,7 @@ class ChatDurableFutureTest {
     }
 
     @Test
-    void interruptedWaitPropagatesWithoutRecordingAChatFailure() throws Exception {
-        InspectingExecutor executor = new InspectingExecutor();
-        try {
-            ActionState state = new ActionState(new Event("input"));
-            JavaRunnerContextImpl context =
-                    context(
-                            executor,
-                            state,
-                            (k, s, a, e, saved) -> {
-                                throw new AssertionError("Interrupted wait must not be persisted");
-                            });
-            AtomicReference<Exception> error = new AtomicReference<>();
-            Runnable action = captureFailure(context.chat("model", List.of()), error);
-            assertThat(executor.executeAction(context.getContinuationContext(), action)).isFalse();
-            assertThat(executor.workerStarted.await(5, TimeUnit.SECONDS)).isTrue();
-            ChatInvocation call = dispatchedCall(context);
-            executor.worker.get().interrupt();
-            finish(executor, context, action);
-
-            assertThat(error.get()).isInstanceOf(InterruptedException.class);
-            assertThat(call.isDone()).isFalse();
-            assertThat(state.getCallResults()).isEmpty();
-            assertThat(context.getDurableExecutionContext().getCurrentCallIndex()).isZero();
-        } finally {
-            executor.close();
-        }
-    }
-
-    @Test
-    void persistenceFailureAfterWorkerWaitIsNotConvertedToAChatFailure() throws Exception {
+    void persistenceFailureAfterYieldingWaitIsNotConvertedToAChatFailure() throws Exception {
         InspectingExecutor executor = new InspectingExecutor();
         try {
             IllegalStateException failure = new IllegalStateException("store unavailable");
@@ -164,13 +136,13 @@ class ChatDurableFutureTest {
             AtomicReference<Exception> error = new AtomicReference<>();
             Runnable action = captureFailure(context.chat("model", List.of()), error);
             assertThat(executor.executeAction(context.getContinuationContext(), action)).isFalse();
-            ChatInvocation call = dispatchedCall(context);
-            call.complete(
+            SubgraphInvocation<ChatResponseEvent> call = dispatchedCall(context);
+            call.dispatch(
                     ChatResponseEvent.success(
-                            call.getRequestId(), new ChatResult(ChatMessage.assistant("answer"))));
+                            UUID.randomUUID(), new ChatResult(ChatMessage.assistant("answer"))));
             finish(executor, context, action);
             assertThat(error.get()).isSameAs(failure);
-            assertThat(call.awaitResponse().isSuccess()).isTrue();
+            assertThat(call.awaitResult().isSuccess()).isTrue();
         } finally {
             executor.close();
         }
@@ -215,10 +187,16 @@ class ChatDurableFutureTest {
         };
     }
 
-    private ChatInvocation dispatchedCall(JavaRunnerContextImpl context) {
+    private SubgraphInvocation<ChatResponseEvent> dispatchedCall(JavaRunnerContextImpl context) {
         List<Event> events = context.drainEventsAtActionYield(null);
         assertThat(events).singleElement().isInstanceOf(SubgraphEvent.class);
-        return manager.get(((SubgraphEvent) events.get(0)).getInvocationId());
+        return chatCall(context, ((SubgraphEvent) events.get(0)).getInvocationId());
+    }
+
+    @SuppressWarnings("unchecked")
+    private static SubgraphInvocation<ChatResponseEvent> chatCall(
+            JavaRunnerContextImpl context, String id) {
+        return (SubgraphInvocation<ChatResponseEvent>) context.getSubgraphCalls().get(id);
     }
 
     private static void finish(
@@ -247,20 +225,28 @@ class ChatDurableFutureTest {
                 new RunnerContextImpl.MemoryContext(null, null),
                 new ArrayList<>(),
                 "key",
+                "key",
                 "observation",
                 false,
                 null);
         context.setContinuationContext(new ContinuationContext());
-        context.setChatContext(
-                new ChatContext(manager, new ChatCallOwner("key", 1, "action", input)));
+        context.setSubgraphCalls(calls);
+        Map<String, DeterministicIdAllocator> byTarget = new HashMap<>();
+        context.setIdAllocatorSource(
+                name ->
+                        byTarget.computeIfAbsent(
+                                name,
+                                target ->
+                                        new DeterministicIdAllocator(
+                                                "key", 1, "action", input, target)));
         context.setDurableExecutionContext(
                 new RunnerContextImpl.DurableExecutionContext(
                         "key", 1, mock(Action.class), input, state, persister));
         return context;
     }
 
+    /** Probes that awaiting a chat response never dispatches work to the async pool. */
     private static final class InspectingExecutor extends ContinuationActionExecutor {
-        private final CountDownLatch workerStarted = new CountDownLatch(1);
         private final AtomicReference<Thread> worker = new AtomicReference<>();
         private int submissions;
 
@@ -276,7 +262,6 @@ class ChatDurableFutureTest {
                     context,
                     () -> {
                         worker.set(Thread.currentThread());
-                        workerStarted.countDown();
                         return supplier.get();
                     });
         }
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinitionTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinitionTest.java
index 6115a352c..52622b145 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinitionTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/chat/ChatSubgraphDefinitionTest.java
@@ -35,10 +35,10 @@ import static org.mockito.Mockito.mock;
 class ChatSubgraphDefinitionTest {
     private final UUID requestId = UUID.randomUUID();
     private final ChatSubgraphDefinition definition =
-            new ChatSubgraphDefinition(mock(AgentPlan.class), requestId);
+            new ChatSubgraphDefinition(mock(AgentPlan.class));
 
     @Test
-    void requiresExactlyOneMatchingResponse() {
+    void requiresExactlyOneResponse() {
         ChatResponseEvent response =
                 ChatResponseEvent.success(requestId, new ChatResult(ChatMessage.assistant("ok")));
         // Event conversion reconstructs the typed event; identity is not part of the contract.
@@ -47,21 +47,13 @@ class ChatSubgraphDefinitionTest {
                 .hasMessageContaining("exactly one response");
         assertThatThrownBy(() -> definition.finish(List.of(response, response)))
                 .hasMessageContaining("exactly one response");
-        assertThatThrownBy(
-                        () ->
-                                definition.finish(
-                                        List.of(
-                                                ChatResponseEvent.success(
-                                                        UUID.randomUUID(),
-                                                        new ChatResult(
-                                                                ChatMessage.assistant("other"))))))
-                .hasMessageContaining("does not match");
     }
 
     @Test
     void ordinaryObservationEventsRemainPrivateAndRuntimeFailuresAreNotCaptured() {
         assertThat(definition.matchActions(new Event("observation"))).isEmpty();
         assertThat(definition.isOutput(new Event("observation"))).isFalse();
+        // A chat response is terminal for its graph, so the failure policy does not apply.
         assertThat(definition.capturesActionFailures()).isFalse();
     }
 }
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImplAsyncExecutionTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImplAsyncExecutionTest.java
index e294c708d..b84555426 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImplAsyncExecutionTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImplAsyncExecutionTest.java
@@ -26,6 +26,8 @@ import org.apache.flink.agents.plan.AgentPlan;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
 import org.apache.flink.agents.runtime.async.ContinuationContext;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.operator.ActionTask;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextLifecycle;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionLock;
 import org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups;
 import org.junit.jupiter.api.Test;
@@ -152,9 +154,17 @@ class JavaRunnerContextImplAsyncExecutionTest {
                         1,
                         () -> {},
                         lock,
-                        (key, task) -> {
-                            lock.checkReentrant();
-                            restored.set(true);
+                        new ParallelExecutionContextLifecycle() {
+                            @Override
+                            public void suspend(Object key, ActionTask task) {
+                                lock.checkReentrant();
+                            }
+
+                            @Override
+                            public void resume(Object key, ActionTask task) {
+                                lock.checkReentrant();
+                                restored.set(true);
+                            }
                         });
         JavaRunnerContextImpl context = createContext(executor, new ContinuationContext());
         ExecutorService worker = Executors.newSingleThreadExecutor();
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/PythonBridgeContractTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/context/PythonBridgeContractTest.java
new file mode 100644
index 000000000..f5f0bfea3
--- /dev/null
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/context/PythonBridgeContractTest.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.runtime.context;
+
+import org.apache.flink.agents.runtime.python.context.PythonRunnerContextImpl;
+import org.junit.jupiter.api.Test;
+
+import javax.annotation.Nullable;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * The graph-call entry points the Python bridge reaches over pemja, pinned by name and arity.
+ *
+ * <p>The bridge looks these up by string and the Python tests hold a fake context, so a rename used
+ * to fail only in a cross-language run.
+ */
+class PythonBridgeContractTest {
+
+    /** The two Python modules that call into the runner context by name. */
+    private static final Path RUNNER_CONTEXT_PY =
+            Paths.get("..", "python", "flink_agents", "runtime", "flink_runner_context.py");
+
+    private static final Path CHAT_FUTURE_PY =
+            Paths.get("..", "python", "flink_agents", "runtime", "chat_future.py");
+
+    private static final Pattern RUNNER_CONTEXT_CALL =
+            Pattern.compile("_j_runner_context\\.([A-Za-z_][A-Za-z0-9_]*)");
+
+    private static final Pattern CHAT_FUTURE_CALL =
+            Pattern.compile("self\\._ctx\\.([A-Za-z_][A-Za-z0-9_]*)");
+
+    /**
+     * The internal sub-agent poll and the chat poll both report "still running" as a Java {@code
+     * null}, which is what lets the bridge yield the mailbox instead of blocking it. Both return a
+     * terminal outcome as JSON, the wire format the bridge converts.
+     */
+    @Test
+    void graphCallEntryPointsKeepTheSignaturesTheBridgeCalls() throws Exception {
+        assertThat(
+                        method(
+                                        "bootstrapInternalSubagentCallForScope",
+                                        String.class,
+                                        String.class,
+                                        String.class,
+                                        Object.class)
+                                .getReturnType())
+                .isEqualTo(void.class);
+
+        Method subagentPoll = method("tryCompleteInternalSubagentCall", String.class, String.class);
+        assertThat(subagentPoll.getReturnType()).isEqualTo(String.class);
+        assertThat(subagentPoll.isAnnotationPresent(Nullable.class)).isTrue();
+
+        assertThat(method("prepareChatCall", String.class).getReturnType()).isEqualTo(String.class);
+
+        Method chatPoll = method("tryCompleteChatCall", String.class);
+        assertThat(chatPoll.getReturnType()).isEqualTo(String.class);
+        assertThat(chatPoll.isAnnotationPresent(Nullable.class)).isTrue();
+    }
+
+    /**
+     * The chat call used to run through a {@code ChatContext} the bridge held; a returning accessor
+     * would let that second path be rebuilt beside the graph-call chain.
+     */
+    @Test
+    void removedChatAccessorsStayRemoved() {
+        assertThat(methodNames(PythonRunnerContextImpl.class))
+                .doesNotContain("getChatContext", "setChatContext", "awaitSubagentCall");
+    }
+
+    /**
+     * Every name the two bridge modules look up resolves on the {@link PythonRunnerContextImpl} the
+     * operator hands them, so a Java-side rename cannot leave a Python call site pointing at
+     * nothing. It is a sibling of {@link JavaRunnerContextImpl}, not a subclass.
+     */
+    @Test
+    void everyPythonCallSiteResolvesOnTheRunnerContext() throws IOException {
+        Set<String> called = new TreeSet<>();
+        called.addAll(callSites(RUNNER_CONTEXT_PY, RUNNER_CONTEXT_CALL));
+        called.addAll(callSites(CHAT_FUTURE_PY, CHAT_FUTURE_CALL));
+
+        assertThat(called)
+                .contains(
+                        "bootstrapInternalSubagentCallForScope",
+                        "tryCompleteInternalSubagentCall",
+                        "prepareChatCall",
+                        "tryCompleteChatCall");
+        assertThat(methodNames(PythonRunnerContextImpl.class)).containsAll(called);
+    }
+
+    private static Method method(String name, Class<?>... parameters) throws Exception {
+        return RunnerContextImpl.class.getMethod(name, parameters);
+    }
+
+    private static Set<String> methodNames(Class<?> type) {
+        return Arrays.stream(type.getMethods()).map(Method::getName).collect(Collectors.toSet());
+    }
+
+    private static Set<String> callSites(Path source, Pattern call) throws IOException {
+        assertThat(source).exists();
+        Set<String> names = new TreeSet<>();
+        Matcher matcher =
+                call.matcher(new String(Files.readAllBytes(source), StandardCharsets.UTF_8));
+        while (matcher.find()) {
+            names.add(matcher.group(1));
+        }
+        return names;
+    }
+}
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplDurableExecuteTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplDurableExecuteTest.java
index e17dc12c4..25a152952 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplDurableExecuteTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplDurableExecuteTest.java
@@ -25,6 +25,8 @@ import org.apache.flink.agents.plan.actions.Action;
 import org.apache.flink.agents.runtime.actionstate.ActionState;
 import org.apache.flink.agents.runtime.actionstate.CallResult;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.operator.parallel.ActionTaskLifecycleException;
+import org.apache.flink.agents.runtime.operator.parallel.UncapturableException;
 import org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
@@ -32,6 +34,7 @@ import org.junit.jupiter.api.Test;
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import static org.junit.jupiter.api.Assertions.*;
@@ -172,6 +175,87 @@ class RunnerContextImplDurableExecuteTest {
         assertTrue(pending.isPending(), "interrupted pending slot should remain unfinalized");
     }
 
+    @Test
+    void frameworkFaultIsNotPersistedAsADurableFailure() {
+        RunnerContextImpl context = createContext(new ActionState(null));
+        UncapturableException fault =
+                ActionTaskLifecycleException.suspendFailed(new IllegalStateException("no context"));
+        TestDurableCallable<String> callable =
+                new TestDurableCallable<>(
+                        "tool-call",
+                        String.class,
+                        () -> {
+                            throw fault;
+                        });
+
+        UncapturableException thrown =
+                assertThrows(UncapturableException.class, () -> context.durableExecute(callable));
+
+        assertSame(fault, thrown, "the shell must reach the caller with its marker intact");
+        assertEquals(0, persistCallCount.get());
+        assertEquals(0, context.getDurableExecutionContext().getActionState().getCallResultCount());
+    }
+
+    @Test
+    void frameworkFaultArrivingWrappedIsNotPersistedAsADurableFailure() {
+        RunnerContextImpl context = createContext(new ActionState(null));
+        UncapturableException fault =
+                ActionTaskLifecycleException.resumeFailed(
+                        new IllegalStateException("no context"), null);
+        TestDurableCallable<String> callable =
+                new TestDurableCallable<>(
+                        "tool-call",
+                        String.class,
+                        () -> {
+                            throw new ExecutionException(fault);
+                        });
+
+        ExecutionException thrown =
+                assertThrows(ExecutionException.class, () -> context.durableExecute(callable));
+
+        assertSame(fault, thrown.getCause());
+        assertEquals(0, persistCallCount.get());
+        assertEquals(0, context.getDurableExecutionContext().getActionState().getCallResultCount());
+    }
+
+    @Test
+    void frameworkFaultLeavesTheReconcilableSlotForRecoveryToRerun() throws Exception {
+        RunnerContextImpl context = createContext(new ActionState(null));
+        UncapturableException fault =
+                ActionTaskLifecycleException.suspendFailed(new IllegalStateException("no context"));
+        TestReconcilableCallable<String> callable =
+                new TestReconcilableCallable<>(
+                        "recon-call",
+                        String.class,
+                        () -> {
+                            throw fault;
+                        },
+                        () -> fail("reconcile should not be called on initial execution"));
+
+        assertThrows(UncapturableException.class, () -> context.durableExecute(callable));
+
+        // Reserving the slot is all that is written, so a restart drives the call again once the
+        // fault is corrected instead of replaying it as a recorded failure.
+        assertEquals(1, persistCallCount.get());
+        CallResult slot =
+                context.getDurableExecutionContext().getActionState().getCallResults().get(0);
+        assertTrue(slot.isPending(), "a framework fault must leave the slot unfinalized");
+
+        ActionState restored =
+                org.apache.flink.agents.runtime.actionstate.ActionStateSerde.deserialize(
+                        org.apache.flink.agents.runtime.actionstate.ActionStateSerde.serialize(
+                                lastPersistedState));
+        RunnerContextImpl replay = createContext(restored);
+        TestReconcilableCallable<String> recovered =
+                new TestReconcilableCallable<>(
+                        "recon-call",
+                        String.class,
+                        () -> fail("a pending slot is reconciled, not re-executed"),
+                        () -> "ok");
+
+        assertEquals("ok", replay.durableExecute(recovered));
+    }
+
     @Test
     void testGatherStopsBatchOnInterruptionInsteadOfRecordingFailure() {
         RunnerContextImpl context = createContext(new ActionState(null));
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplExecutionReporterTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplExecutionReporterTest.java
index 9625d7dbc..ff870a16b 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplExecutionReporterTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextImplExecutionReporterTest.java
@@ -331,7 +331,14 @@ class RunnerContextImplExecutionReporterTest {
         RunnerContextImpl runnerContext =
                 new RunnerContextImpl(null, () -> {}, emptyAgentPlan(), null, "job");
         runnerContext.switchActionContext(
-                "chat_model_action", null, new ArrayList<>(), "business-key", "obs-1", false, null);
+                "chat_model_action",
+                null,
+                new ArrayList<>(),
+                null,
+                "business-key",
+                "obs-1",
+                false,
+                null);
 
         assertThatCode(
                         () -> {
@@ -459,6 +466,7 @@ class RunnerContextImplExecutionReporterTest {
                 "chat_model_action",
                 null,
                 new ArrayList<>(),
+                null,
                 "business-key",
                 "obs-1",
                 false,
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextPendingEventsContractTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextPendingEventsContractTest.java
index e462657fd..961c95b9c 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextPendingEventsContractTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/context/RunnerContextPendingEventsContractTest.java
@@ -45,7 +45,7 @@ class RunnerContextPendingEventsContractTest {
         Event second = new Event("second");
         SubgraphEvent bootstrap = new SubgraphEvent("child-call", new InputEvent(1L), true);
 
-        context.switchActionContext("action", memory, buffer, "key", "obs", false, null);
+        context.switchActionContext("action", memory, buffer, null, "key", "obs", false, null);
         context.sendEvent(first);
         context.sendEvent(bootstrap);
         context.sendEvent(second);
@@ -71,7 +71,6 @@ class RunnerContextPendingEventsContractTest {
                         "child-call",
                         "key",
                         org.mockito.Mockito.mock(SubgraphDefinition.class),
-                        new RunnerContextImpl.MemoryContext(null, null),
                         null));
         Event next = new Event("next");
         SubgraphEvent nestedCall = new SubgraphEvent("nested-call", new InputEvent(1L), true);
@@ -100,15 +99,18 @@ class RunnerContextPendingEventsContractTest {
         List<Event> bufferB = new ArrayList<>();
         Event eventA = new InputEvent(1L);
 
-        context.switchActionContext("action-a", memoryA, bufferA, "key-a", "obs-a", false, null);
+        context.switchActionContext(
+                "action-a", memoryA, bufferA, null, "key-a", "obs-a", false, null);
         context.sendEvent(eventA);
         assertThat(context.drainEventsAtActionYield(null)).isEmpty();
 
-        context.switchActionContext("action-b", memoryB, bufferB, "key-b", "obs-b", false, null);
+        context.switchActionContext(
+                "action-b", memoryB, bufferB, null, "key-b", "obs-b", false, null);
         assertThat(context.drainEventsAtActionFinish(null)).isEmpty();
         context.checkNoPendingEvents();
 
-        context.switchActionContext("action-a", memoryA, bufferA, "key-a", "obs-a", false, null);
+        context.switchActionContext(
+                "action-a", memoryA, bufferA, null, "key-a", "obs-a", false, null);
         assertThat(context.drainEventsAtActionFinish(null)).containsExactly(eventA);
         context.checkNoPendingEvents();
     }
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/context/TestMemoryObservationFlush.java b/runtime/src/test/java/org/apache/flink/agents/runtime/context/TestMemoryObservationFlush.java
index caa57a55c..4891ade18 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/context/TestMemoryObservationFlush.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/context/TestMemoryObservationFlush.java
@@ -86,6 +86,7 @@ class TestMemoryObservationFlush {
                         new CachedMemoryStore(new ForTestMemoryMapState<>()),
                         new CachedMemoryStore(new ForTestMemoryMapState<>())),
                 new ArrayList<>(),
+                null,
                 contextKey,
                 "observation-1",
                 suppressed,
@@ -226,6 +227,7 @@ class TestMemoryObservationFlush {
                         new CachedMemoryStore(new ForTestMemoryMapState<>()),
                         new CachedMemoryStore(new ForTestMemoryMapState<>())),
                 new ArrayList<>(),
+                null,
                 "user-43",
                 "observation-2",
                 true,
@@ -265,6 +267,7 @@ class TestMemoryObservationFlush {
                         new CachedMemoryStore(new ForTestMemoryMapState<>()),
                         new CachedMemoryStore(new ForTestMemoryMapState<>())),
                 new ArrayList<>(),
+                null,
                 "user-42",
                 "observation-2",
                 false,
@@ -282,6 +285,7 @@ class TestMemoryObservationFlush {
                         new CachedMemoryStore(new ForTestMemoryMapState<>()),
                         new CachedMemoryStore(new ForTestMemoryMapState<>())),
                 new ArrayList<>(),
+                null,
                 "user-42",
                 "observation-1",
                 false,
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListenerNotificationTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListenerNotificationTest.java
index 1693af27a..3d95c97ae 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListenerNotificationTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/lifecycle/TaskLifecycleListenerNotificationTest.java
@@ -36,6 +36,7 @@ import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
 import org.apache.flink.agents.runtime.operator.ActionExecutionOperator;
 import org.apache.flink.agents.runtime.operator.ActionExecutionOperatorFactory;
 import org.apache.flink.agents.runtime.operator.ActionTask;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionCoordinator;
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.api.java.functions.KeySelector;
 import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
@@ -45,13 +46,17 @@ import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
 import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 /**
  * Tests that {@link ActionExecutionOperator} broadcasts the record/task lifecycle events to
@@ -65,6 +70,11 @@ public class TaskLifecycleListenerNotificationTest {
         RecordingListener.EVENTS.clear();
     }
 
+    private static boolean usesParallelWorker(AgentPlan plan) {
+        return plan.getConfig().get(AgentExecutionOptions.PARALLEL_EXECUTION_ENABLED)
+                && !ContinuationActionExecutor.isContinuationSupported();
+    }
+
     /** Plain listener that records every lifecycle notification it receives. */
     public static class RecordingListener implements TaskLifecycleListener {
 
@@ -178,33 +188,27 @@ public class TaskLifecycleListenerNotificationTest {
             testHarness.processElement(new StreamRecord<>(7L));
             operator.waitInFlightEventsFinished();
 
-            assertThat(RecordingListener.EVENTS)
-                    .containsExactly(
-                            "recordStart:7",
-                            "prepared:handleInput",
-                            "started:handleInput",
-                            "finishing:handleInput",
-                            "finished:handleInput",
-                            "recordFinished:7");
+            List<String> expectedRound =
+                    new ArrayList<>(
+                            List.of(
+                                    "recordStart:7",
+                                    "prepared:handleInput",
+                                    "started:handleInput"));
+            if (usesParallelWorker(plan)) {
+                expectedRound.addAll(
+                        List.of("transferred:handleInput->handleInput", "prepared:handleInput"));
+            }
+            expectedRound.addAll(
+                    List.of("finishing:handleInput", "finished:handleInput", "recordFinished:7"));
+            assertThat(RecordingListener.EVENTS).containsExactlyElementsOf(expectedRound);
 
             // A second record on the same key starts and finishes its own round.
             testHarness.processElement(new StreamRecord<>(7L));
             operator.waitInFlightEventsFinished();
 
-            assertThat(RecordingListener.EVENTS)
-                    .containsExactly(
-                            "recordStart:7",
-                            "prepared:handleInput",
-                            "started:handleInput",
-                            "finishing:handleInput",
-                            "finished:handleInput",
-                            "recordFinished:7",
-                            "recordStart:7",
-                            "prepared:handleInput",
-                            "started:handleInput",
-                            "finishing:handleInput",
-                            "finished:handleInput",
-                            "recordFinished:7");
+            List<String> expectedRecords = new ArrayList<>(expectedRound);
+            expectedRecords.addAll(expectedRound);
+            assertThat(RecordingListener.EVENTS).containsExactlyElementsOf(expectedRecords);
         }
     }
 
@@ -359,12 +363,14 @@ public class TaskLifecycleListenerNotificationTest {
             testHarness.processElement(new StreamRecord<>(7L));
             operator.waitInFlightEventsFinished();
 
-            assertThat(RecordingListener.EVENTS)
-                    .containsExactly(
-                            "recordStart:7",
-                            "prepared:handleInput",
-                            "reused:handleInput",
-                            "recordFinished:7");
+            List<String> expected =
+                    new ArrayList<>(List.of("recordStart:7", "prepared:handleInput"));
+            if (usesParallelWorker(plan)) {
+                expected.addAll(
+                        List.of("transferred:handleInput->handleInput", "prepared:handleInput"));
+            }
+            expected.addAll(List.of("reused:handleInput", "recordFinished:7"));
+            assertThat(RecordingListener.EVENTS).containsExactlyElementsOf(expected);
         }
     }
 
@@ -373,8 +379,8 @@ public class TaskLifecycleListenerNotificationTest {
 
     @Test
     void resumedInFlightRecordReEmitsRecordStart() throws Exception {
-        // Force serial: the parallel engine drains in-flight tasks before checkpoint, so no
-        // in-flight record survives the snapshot — this test exercises the serial restore path.
+        // Serial restore: the record is in flight because its task is still pending on the mailbox.
+        // The queued-task branch on the parallel engine has its own test below.
         AgentConfiguration serialConfig = new AgentConfiguration();
         serialConfig.set(AgentExecutionOptions.PARALLEL_EXECUTION_ENABLED, false);
         AgentPlan plan = new AgentPlan(new SyncAgent(), serialConfig);
@@ -417,6 +423,148 @@ public class TaskLifecycleListenerNotificationTest {
         }
     }
 
+    /**
+     * Agent whose input action parks inside a durable async call. On the parallel engine that parks
+     * the worker holding it, which is how a test fills the pool and leaves a later task queued.
+     */
+    public static class ParkingAgent extends Agent {
+
+        static volatile CountDownLatch started;
+        static volatile CountDownLatch allow;
+
+        static void resetFixture(int startedCount) {
+            started = new CountDownLatch(startedCount);
+            allow = new CountDownLatch(1);
+        }
+
+        @org.apache.flink.agents.api.annotation.Action(EventType.InputEvent)
+        public static void handleInput(Event event, RunnerContext context) throws Exception {
+            Long input = (Long) InputEvent.fromEvent(event).getInput();
+            Long result =
+                    context.durableExecuteAsync(
+                                    new DurableCallable<Long>() {
+                                        @Override
+                                        public String getId() {
+                                            return "parking";
+                                        }
+
+                                        @Override
+                                        public Class<Long> getResultClass() {
+                                            return Long.class;
+                                        }
+
+                                        @Override
+                                        public Long call() {
+                                            started.countDown();
+                                            try {
+                                                allow.await();
+                                            } catch (InterruptedException e) {
+                                                Thread.currentThread().interrupt();
+                                            }
+                                            return input * 2;
+                                        }
+                                    })
+                            .await();
+            context.sendEvent(new OutputEvent(result));
+        }
+    }
+
+    @Test
+    @Timeout(30)
+    void resumedInFlightRecordReEmitsRecordStartOnParallelRestore() throws Exception {
+        assumeFalse(ContinuationActionExecutor.isContinuationSupported());
+        int numAsyncThreads = 1;
+        // Every worker has to be parked before the key under test queues its task, or a free
+        // worker pulls that task and it retires during the drain, leaving nothing in flight to
+        // restore. Derived from the ceiling rather than hard-coded, so it tracks the pool it fills.
+        int workers = ParallelExecutionCoordinator.workerCeiling(numAsyncThreads);
+        long queuedKey = workers + 1L;
+        AgentConfiguration config = new AgentConfiguration();
+        config.set(AgentExecutionOptions.NUM_ASYNC_THREADS, numAsyncThreads);
+        config.set(AgentExecutionOptions.MAX_IN_FLIGHT_INPUT_RECORDS, workers + 2);
+        AgentPlan plan = new AgentPlan(new ParkingAgent(), config);
+        assertThat(usesParallelWorker(plan)).isTrue();
+
+        // Phase 1: fill the pool, queue one record no worker is left to pull, then drain. The
+        // drain retires the parked keys and forfeits the queued record's dispatch permit, so the
+        // snapshot captures it as a processing key whose task is still queued.
+        OperatorSubtaskState snapshot;
+        ParkingAgent.resetFixture(workers);
+        Thread releaser = null;
+        try (KeyedOneInputStreamOperatorTestHarness<Long, Long, Object> testHarness =
+                new KeyedOneInputStreamOperatorTestHarness<>(
+                        new ActionExecutionOperatorFactory<>(plan, true),
+                        (KeySelector<Long, Long>) value -> value,
+                        TypeInformation.of(Long.class))) {
+            testHarness.open();
+            ActionExecutionOperator<Long, Object> operator =
+                    (ActionExecutionOperator<Long, Object>) testHarness.getOperator();
+
+            for (long key = 1; key <= workers; key++) {
+                testHarness.processElement(new StreamRecord<>(key));
+            }
+            assertThat(ParkingAgent.started.await(5, TimeUnit.SECONDS)).isTrue();
+            testHarness.processElement(new StreamRecord<>(queuedKey));
+
+            // Released only once the drain has paused dispatch: any earlier and a retiring worker
+            // pulls the queued task, which then retires and empties the snapshot.
+            releaser =
+                    new Thread(
+                            () -> {
+                                try {
+                                    Thread.sleep(300);
+                                } catch (InterruptedException e) {
+                                    Thread.currentThread().interrupt();
+                                }
+                                ParkingAgent.allow.countDown();
+                            });
+            releaser.setDaemon(true);
+            releaser.start();
+            operator.prepareSnapshotPreBarrier(1L);
+            snapshot = testHarness.snapshot(1L, 1L);
+        } finally {
+            ParkingAgent.allow.countDown();
+            if (releaser != null) {
+                releaser.join();
+            }
+        }
+
+        // Phase 2: the restored round opens its bracket before dispatching, so the record start
+        // precedes every action callback the resumed task emits and the bracket closes on it.
+        ParkingAgent.resetFixture(1);
+        try (KeyedOneInputStreamOperatorTestHarness<Long, Long, Object> restored =
+                new KeyedOneInputStreamOperatorTestHarness<>(
+                        new ListenerInjectingOperatorFactory(plan, new RecordingListener()),
+                        (KeySelector<Long, Long>) value -> value,
+                        TypeInformation.of(Long.class))) {
+            restored.initializeState(snapshot);
+            restored.open();
+            ActionExecutionOperator<Long, Object> operator =
+                    (ActionExecutionOperator<Long, Object>) restored.getOperator();
+            // Proof the snapshot really held the queued record: it was re-dispatched and reached
+            // the async stage. Without this the assertions below would pass on an empty restore.
+            assertThat(ParkingAgent.started.await(5, TimeUnit.SECONDS)).isTrue();
+            ParkingAgent.allow.countDown();
+            operator.waitInFlightEventsFinished();
+
+            assertThat(RecordingListener.EVENTS)
+                    .containsExactly(
+                            "recordStart:" + queuedKey,
+                            "prepared:handleInput",
+                            "started:handleInput",
+                            "transferred:handleInput->handleInput",
+                            "prepared:handleInput",
+                            "transferred:handleInput->handleInput",
+                            "prepared:handleInput",
+                            "finishing:handleInput",
+                            "finished:handleInput",
+                            "recordFinished:" + queuedKey);
+            List<StreamRecord<Object>> output =
+                    (List<StreamRecord<Object>>) restored.getRecordOutput();
+            assertThat(output).extracting(StreamRecord::getValue).containsExactly(queuedKey * 2);
+        }
+    }
+
     @Test
     void resumedInFlightRecordCountsAsOneActiveInputRun() throws Exception {
         AgentConfiguration serialConfig = new AgentConfiguration();
@@ -463,7 +611,7 @@ public class TaskLifecycleListenerNotificationTest {
     }
 
     @Test
-    void recordWithoutTriggeredActionsEmitsNoLifecycleEvents() throws Exception {
+    void recordWithoutTriggeredActionsStillEmitsTheRecordBracket() throws Exception {
         AgentPlan plan = new AgentPlan(new EmptyAgent());
         try (KeyedOneInputStreamOperatorTestHarness<Long, Long, Object> testHarness =
                 new KeyedOneInputStreamOperatorTestHarness<>(
@@ -478,8 +626,11 @@ public class TaskLifecycleListenerNotificationTest {
             testHarness.processElement(new StreamRecord<>(3L));
             operator.waitInFlightEventsFinished();
 
-            // No task was ever created, so the start/finished pair stays closed.
-            assertThat(RecordingListener.EVENTS).isEmpty();
+            // The record was admitted and retired even though no task was ever created, so the
+            // bracket still closes -- with nothing between its two ends, since the internal noop
+            // that retires the round on the parallel engine reports no action callback.
+            assertThat(RecordingListener.EVENTS)
+                    .containsExactly("recordStart:3", "recordFinished:3");
         }
     }
 
@@ -534,8 +685,22 @@ public class TaskLifecycleListenerNotificationTest {
                             .isEqualTo("transferred:handleInput->handleInput");
                     assertThat(suspensionRounds.get(i + 1)).isEqualTo("prepared:handleInput");
                 }
+            } else if (usesParallelWorker(plan)) {
+                // One off-lock async call, then the worker-to-mailbox handoff.
+                assertThat(RecordingListener.EVENTS)
+                        .containsExactly(
+                                "recordStart:5",
+                                "prepared:handleInput",
+                                "started:handleInput",
+                                "transferred:handleInput->handleInput",
+                                "prepared:handleInput",
+                                "transferred:handleInput->handleInput",
+                                "prepared:handleInput",
+                                "finishing:handleInput",
+                                "finished:handleInput",
+                                "recordFinished:5");
             } else {
-                // JDK 11 fallback runs the action synchronously: no suspension, no transfer.
+                // Serial fallback runs the action synchronously: no suspension, no transfer.
                 assertThat(RecordingListener.EVENTS)
                         .containsExactly(
                                 "recordStart:5",
@@ -578,12 +743,17 @@ public class TaskLifecycleListenerNotificationTest {
                     .hasStackTraceContaining("action boom");
 
             // The failure notification replaces the finishing/finished/recordFinished tail.
-            assertThat(RecordingListener.EVENTS)
-                    .containsExactly(
-                            "recordStart:7",
-                            "prepared:handleInput",
-                            "started:handleInput",
-                            "failed:handleInput");
+            List<String> expected =
+                    new ArrayList<>(
+                            List.of(
+                                    "recordStart:7",
+                                    "prepared:handleInput",
+                                    "started:handleInput"));
+            if (usesParallelWorker(plan)) {
+                expected.add("transferred:handleInput->handleInput");
+            }
+            expected.add("failed:handleInput");
+            assertThat(RecordingListener.EVENTS).containsExactlyElementsOf(expected);
         }
     }
 }
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/metrics/BuiltInExecutionMetricsTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/metrics/BuiltInExecutionMetricsTest.java
index fe887bba9..b92503e3d 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/metrics/BuiltInExecutionMetricsTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/metrics/BuiltInExecutionMetricsTest.java
@@ -72,6 +72,7 @@ class BuiltInExecutionMetricsTest {
                 ACTION_NAME,
                 null,
                 new ArrayList<>(),
+                null,
                 "key",
                 "obs",
                 false,
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorCapacityIntegrationTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorCapacityIntegrationTest.java
index 6e7963226..edf45d4a2 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorCapacityIntegrationTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorCapacityIntegrationTest.java
@@ -28,6 +28,7 @@ import org.apache.flink.agents.plan.AgentPlan;
 import org.apache.flink.agents.plan.JavaFunction;
 import org.apache.flink.agents.plan.actions.Action;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionCoordinator;
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.api.java.functions.KeySelector;
 import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
@@ -55,8 +56,15 @@ import static org.assertj.core.api.Assumptions.assumeThat;
 class ActionExecutionOperatorCapacityIntegrationTest {
 
     private static final int NUM_ASYNC_THREADS = 2;
-    private static final int WORKER_BACKLOG_ACTIONS = NUM_ASYNC_THREADS * 2;
-    private static final int NUM_ACTIONS = WORKER_BACKLOG_ACTIONS + 2;
+
+    /** Workers the operator sizes the pool with for {@link #NUM_ASYNC_THREADS}. */
+    private static final int WORKERS =
+            ParallelExecutionCoordinator.workerCeiling(NUM_ASYNC_THREADS);
+
+    /** Actions left without a worker, since the first {@link #WORKERS} each block holding one. */
+    private static final int WORKER_BACKLOG_ACTIONS = 2;
+
+    private static final int NUM_ACTIONS = WORKERS + WORKER_BACKLOG_ACTIONS;
 
     @Test
     @Timeout(20)
@@ -78,11 +86,12 @@ class ActionExecutionOperatorCapacityIntegrationTest {
                     (ActionExecutionOperator<Long, Object>) testHarness.getOperator();
 
             testHarness.processElement(new StreamRecord<>(0L));
-            // Resident workers pull and start the tasks autonomously once the input is admitted;
-            // only NUM_ASYNC_THREADS of them can enter the async stage at once.
+            // Workers pull and start the tasks on their own once the input is admitted, but only
+            // WORKERS of them can be in the async stage at once: a call there keeps its worker
+            // and only hands off the execution lock.
 
             assertThat(CapacityAgent.FIRST_BATCH_STARTED.await(5, TimeUnit.SECONDS)).isTrue();
-            assertThat(CapacityAgent.STARTED_COUNT).hasValue(NUM_ASYNC_THREADS);
+            assertThat(CapacityAgent.STARTED_COUNT).hasValue(WORKERS);
             assertThat(testHarness.getRecordOutput()).isEmpty();
 
             CapacityAgent.ALLOW_FIRST_BATCH.countDown();
@@ -147,8 +156,7 @@ class ActionExecutionOperatorCapacityIntegrationTest {
                     .isTrue();
 
             beforeRestore = outputValues(testHarness);
-            assertThat(beforeRestore)
-                    .containsExactlyInAnyOrder("capacity-action-1", "capacity-action-2");
+            assertThat(beforeRestore).containsExactlyInAnyOrderElementsOf(firstBatchActions());
 
             CapacityAgent.ALLOW_REMAINING_ACTIONS.countDown();
             operator.waitInFlightEventsFinished();
@@ -205,11 +213,24 @@ class ActionExecutionOperatorCapacityIntegrationTest {
     }
 
     private static Set<String> expectedActions() {
-        Set<String> expected = new LinkedHashSet<>();
-        for (int i = 1; i <= NUM_ACTIONS; i++) {
-            expected.add("capacity-action-" + i);
+        return actionNames(1, NUM_ACTIONS);
+    }
+
+    /**
+     * The actions whose output the snapshot already contains. They were in flight when the drain
+     * started, so quiesce waits for them; the backlog's permits are handed back instead, leaving
+     * those actions pending in the snapshot for the restore to run.
+     */
+    private static Set<String> firstBatchActions() {
+        return actionNames(1, WORKERS);
+    }
+
+    private static Set<String> actionNames(int from, int to) {
+        Set<String> names = new LinkedHashSet<>();
+        for (int i = from; i <= to; i++) {
+            names.add("capacity-action-" + i);
         }
-        return expected;
+        return names;
     }
 
     public static class CapacityAgent {
@@ -233,7 +254,7 @@ class ActionExecutionOperatorCapacityIntegrationTest {
         }
 
         private static void resetFirstBatchGate() {
-            FIRST_BATCH_STARTED = new CountDownLatch(NUM_ASYNC_THREADS);
+            FIRST_BATCH_STARTED = new CountDownLatch(WORKERS);
             ALLOW_FIRST_BATCH = new CountDownLatch(1);
             STARTED_COUNT.set(0);
         }
@@ -273,7 +294,7 @@ class ActionExecutionOperatorCapacityIntegrationTest {
                                             .computeIfAbsent(
                                                     actionId, ignored -> new AtomicInteger())
                                             .incrementAndGet();
-                                    if (actionNumber <= NUM_ASYNC_THREADS) {
+                                    if (actionNumber <= WORKERS) {
                                         FIRST_BATCH_STARTED.countDown();
                                         if (!ALLOW_FIRST_BATCH.await(5, TimeUnit.SECONDS)) {
                                             throw new IllegalStateException(
@@ -318,6 +339,30 @@ class ActionExecutionOperatorCapacityIntegrationTest {
             runAction(event, context, 6);
         }
 
+        public static void capacityAction7(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, 7);
+        }
+
+        public static void capacityAction8(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, 8);
+        }
+
+        public static void capacityAction9(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, 9);
+        }
+
+        public static void capacityAction10(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, 10);
+        }
+
+        public static void capacityAction11(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, 11);
+        }
+
+        public static void capacityAction12(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, 12);
+        }
+
         private static AgentPlan getAgentPlan(AgentConfiguration config) throws Exception {
             Map<String, Action> actions = new LinkedHashMap<>();
             for (int i = 1; i <= NUM_ACTIONS; i++) {
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorDrainDeadlockIntegrationTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorDrainDeadlockIntegrationTest.java
index 9f70a95a7..467f998cd 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorDrainDeadlockIntegrationTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorDrainDeadlockIntegrationTest.java
@@ -57,28 +57,37 @@ import static org.assertj.core.api.Assumptions.assumeThat;
 
 /**
  * Component-level regression test for the checkpoint drain quiesce of the JDK&lt;21 parallel
- * engine: a worker that redeems a queued dispatch permit while the drain is active must park
- * without holding back the in-flight tasks whose completion the quiesce is waiting for.
+ * engine: a worker that redeems a queued dispatch permit while the drain is active must hand the
+ * permit back without holding back the in-flight tasks whose completion the quiesce is waiting for.
  *
- * <p>Timeline (three actions, two workers; the harness mailbox thread is the test thread, so the
- * post-barrier steps are driven from a controller thread):
+ * <p>Timeline (one blocking action per worker plus one queued action; the harness mailbox thread is
+ * the test thread, so the post-barrier steps are driven from a controller thread):
  *
  * <ol>
- *   <li>One input record queues actions A, B and C. The workers pull A and B, which block in their
- *       async sections; C's dispatch permit stays queued behind the saturated pool.
+ *   <li>One input record queues every action. The workers pull the blocking ones, which each park
+ *       in their async section holding a worker; the queued action's dispatch permit stays behind
+ *       the saturated pool.
  *   <li>The barrier arrives: the test thread enters {@code prepareSnapshotPreBarrier} and blocks in
  *       the quiesce loop.
- *   <li>The controller releases A; its worker commits A, redeems C's queued permit, sees the drain
- *       and parks.
- *   <li>The controller releases B; B's async resume must re-acquire the lock so the drain can
- *       quiesce. If it cannot, the controller flags the deadlock and interrupts the mailbox thread
- *       so the test reports instead of hanging until the JUnit timeout.
+ *   <li>The controller releases the first blocking action; its worker commits, redeems the queued
+ *       permit, sees the drain and forfeits the permit, returning its thread to the pool.
+ *   <li>The controller releases the rest; the last async resume must re-acquire the lock so the
+ *       drain can quiesce. If it cannot, the controller flags the deadlock and interrupts the
+ *       mailbox thread so the test reports instead of hanging until the JUnit timeout.
  * </ol>
+ *
+ * <p>Two further tests cover the other end of that wait, which has no bound of its own: an abort
+ * for the checkpoint being drained must end it with a failure naming the pool state, while an abort
+ * for an older checkpoint must leave the drain running.
  */
 class ActionExecutionOperatorDrainDeadlockIntegrationTest {
 
     private static final int NUM_ASYNC_THREADS = 2;
 
+    /** Workers the operator sizes the pool with; {@link DrainAgent} blocks every one of them. */
+    private static final int WORKERS =
+            ParallelExecutionCoordinator.workerCeiling(NUM_ASYNC_THREADS);
+
     /** Bound for every phase that must happen for the timeline to be set up. */
     private static final long SETUP_TIMEOUT_SECONDS = 10;
 
@@ -90,6 +99,9 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
     void drainQuiesceCompletesWhenQueuedPermitIsRedeemedDuringDrain() throws Exception {
         assumeThat(ContinuationActionExecutor.isContinuationSupported()).isFalse();
         DrainAgent.reset();
+        assertThat(DrainAgent.BLOCKING)
+                .as("one blocking action per worker, so no worker is free for the queued permit")
+                .hasSize(WORKERS);
 
         AgentConfiguration config = new AgentConfiguration();
         config.set(AgentExecutionOptions.NUM_ASYNC_THREADS, NUM_ASYNC_THREADS);
@@ -108,20 +120,24 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
             ActionExecutionOperator<Long, Object> operator =
                     (ActionExecutionOperator<Long, Object>) testHarness.getOperator();
 
-            // Step 1: workers block inside A's and B's async sections; C's permit stays queued.
+            // Step 1: every worker blocks in a blocking action's async section, so the queued
+            // action's permit has no worker left to redeem it.
             testHarness.processElement(new StreamRecord<>(0L));
-            assertThat(DrainAgent.A_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
-                    .as("action A must reach its async section")
-                    .isTrue();
-            assertThat(DrainAgent.B_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
-                    .as("action B must reach its async section")
+            assertThat(DrainAgent.BLOCKING_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
+                    .as("every blocking action must reach its async section")
                     .isTrue();
-            assertThat(DrainAgent.C_STARTED.getCount())
-                    .as("action C must not have started: its permit is queued behind the workers")
+            assertThat(DrainAgent.QUEUED_STARTED.getCount())
+                    .as("the queued action must not have started: no worker is free for its permit")
                     .isEqualTo(1);
 
             controller =
-                    new Thread(() -> driveTimeline(observations, drainReturned, mailboxThread));
+                    new Thread(
+                            () ->
+                                    driveTimeline(
+                                            observations,
+                                            drainReturned,
+                                            mailboxThread,
+                                            operator.getExecutionCoordinator()));
             controller.setName("drain-timeline-controller");
             controller.setDaemon(true);
             controller.start();
@@ -139,8 +155,8 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
             assertThat(observations.drainEngaged)
                     .as("the mailbox thread must have entered the drain quiesce loop")
                     .isTrue();
-            assertThat(observations.workerParkedOnQueuedPermit)
-                    .as("a worker must have redeemed C's queued permit and parked during the drain")
+            assertThat(observations.workerForfeitedQueuedPermit)
+                    .as("a worker must have redeemed C's queued permit and forfeited it on drain")
                     .isTrue();
             assertThat(observations.deadlockDetected)
                     .as(
@@ -150,8 +166,8 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                     .isFalse();
             assertThat(drainFailure).as("prepareSnapshotPreBarrier must not fail").isNull();
 
-            // The drain quiesced; the snapshot resumes dispatch, which lets the parked worker
-            // run C.
+            // The drain quiesced; the snapshot resumes dispatch, which re-submits the forfeited
+            // permit and lets C run.
             testHarness.snapshot(1L, 1L);
             operator.waitInFlightEventsFinished();
 
@@ -161,8 +177,7 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
             }
             assertThat(outputs)
                     .as("every action must complete exactly once across the checkpoint")
-                    .containsExactlyInAnyOrder(
-                            "drain-action-A", "drain-action-B", "drain-action-C");
+                    .containsExactlyInAnyOrderElementsOf(DrainAgent.expectedOutputs());
         } finally {
             DrainAgent.releaseAll();
             if (controller != null) {
@@ -174,9 +189,12 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
 
     @Test
     @Timeout(120)
-    void oldCheckpointAbortDoesNotResumeCurrentCheckpointDrain() throws Exception {
+    void oldCheckpointAbortDoesNotEndCurrentCheckpointDrain() throws Exception {
         assumeThat(ContinuationActionExecutor.isContinuationSupported()).isFalse();
         DrainAgent.reset();
+        assertThat(DrainAgent.BLOCKING)
+                .as("one blocking action per worker, so no worker is free for the queued permit")
+                .hasSize(WORKERS);
 
         AgentConfiguration config = new AgentConfiguration();
         config.set(AgentExecutionOptions.NUM_ASYNC_THREADS, NUM_ASYNC_THREADS);
@@ -197,11 +215,9 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                     (ActionExecutionOperator<Long, Object>) testHarness.getOperator();
 
             testHarness.processElement(new StreamRecord<>(0L));
-            assertThat(DrainAgent.A_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
-                    .isTrue();
-            assertThat(DrainAgent.B_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
+            assertThat(DrainAgent.BLOCKING_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
                     .isTrue();
-            assertThat(DrainAgent.C_STARTED.getCount()).isEqualTo(1);
+            assertThat(DrainAgent.QUEUED_STARTED.getCount()).isEqualTo(1);
 
             testHarness
                     .getTaskMailbox()
@@ -220,7 +236,8 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                                             abortExecuted,
                                             observations,
                                             drainReturned,
-                                            mailboxThread));
+                                            mailboxThread,
+                                            operator.getExecutionCoordinator()));
             controller.setName("abort-during-drain-controller");
             controller.setDaemon(true);
             controller.start();
@@ -234,18 +251,20 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                     .as("controller could not establish the abort-during-drain timeline")
                     .isNull();
             assertThat(observations.queuedActionAdvancedAfterAbort)
-                    .as("the queued action's worker must either park on drain or start")
+                    .as("the queued action's worker must either forfeit its permit or start")
                     .isTrue();
             assertThat(observations.queuedActionStartedBeforeSnapshot)
-                    .as("an older checkpoint abort must not resume the current checkpoint drain")
+                    .as("an older checkpoint's abort must not end the current checkpoint's drain")
                     .isFalse();
-            assertThat(DrainAgent.C_STARTED.getCount())
-                    .as("action C must stay queued until the current checkpoint snapshot resumes")
+            assertThat(DrainAgent.QUEUED_STARTED.getCount())
+                    .as("the queued action must stay queued until the current snapshot resumes")
                     .isEqualTo(1);
             assertThat(observations.deadlockDetected)
                     .as("the current checkpoint drain must still quiesce")
                     .isFalse();
-            assertThat(drainFailure).as("prepareSnapshotPreBarrier must not fail").isNull();
+            assertThat(drainFailure)
+                    .as("an older checkpoint's abort must not fail the current drain")
+                    .isNull();
 
             testHarness.snapshot(2L, 2L);
             operator.waitInFlightEventsFinished();
@@ -256,8 +275,7 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
             }
             assertThat(outputs)
                     .as("every action must complete exactly once across the checkpoint")
-                    .containsExactlyInAnyOrder(
-                            "drain-action-A", "drain-action-B", "drain-action-C");
+                    .containsExactlyInAnyOrderElementsOf(DrainAgent.expectedOutputs());
         } finally {
             DrainAgent.releaseAll();
             if (controller != null) {
@@ -267,11 +285,70 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
         }
     }
 
+    @Test
+    @Timeout(120)
+    void abortOfTheDrainedCheckpointEndsTheQuiesceWait() throws Exception {
+        assumeThat(ContinuationActionExecutor.isContinuationSupported()).isFalse();
+        DrainAgent.reset();
+
+        AgentConfiguration config = new AgentConfiguration();
+        config.set(AgentExecutionOptions.NUM_ASYNC_THREADS, NUM_ASYNC_THREADS);
+
+        try (KeyedOneInputStreamOperatorTestHarness<Long, Long, Object> testHarness =
+                new KeyedOneInputStreamOperatorTestHarness<>(
+                        new ActionExecutionOperatorFactory<>(DrainAgent.getAgentPlan(config), true),
+                        (KeySelector<Long, Long>) value -> value,
+                        TypeInformation.of(Long.class))) {
+            testHarness.open();
+            ActionExecutionOperator<Long, Object> operator =
+                    (ActionExecutionOperator<Long, Object>) testHarness.getOperator();
+
+            testHarness.processElement(new StreamRecord<>(0L));
+            assertThat(DrainAgent.BLOCKING_IN_ASYNC.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS))
+                    .as("every worker must be blocked, so the drain cannot quiesce on its own")
+                    .isTrue();
+
+            // Nothing releases the blocked actions, so only this abort can end the wait. Flink
+            // delivers it as a mail, which is what the quiesce loop yields.
+            testHarness
+                    .getTaskMailbox()
+                    .put(
+                            new Mail(
+                                    () -> operator.notifyCheckpointAborted(2L),
+                                    TaskMailbox.MAX_PRIORITY,
+                                    "abort the checkpoint being drained"));
+
+            Throwable drainFailure = catchThrowable(() -> operator.prepareSnapshotPreBarrier(2L));
+
+            assertThat(drainFailure)
+                    .as("the drain of an aborted checkpoint must fail instead of waiting forever")
+                    .isInstanceOf(IllegalStateException.class)
+                    .hasMessageContaining("Checkpoint 2 was aborted")
+                    .hasMessageContaining("Pool state: workers=");
+
+            // The failure path resumed dispatch, so the operator still completes the record instead
+            // of staying wedged in a drain for a checkpoint that will never be taken.
+            DrainAgent.releaseAll();
+            operator.waitInFlightEventsFinished();
+
+            List<Object> outputs = new ArrayList<>();
+            for (StreamRecord<Object> record : testHarness.getRecordOutput()) {
+                outputs.add(record.getValue());
+            }
+            assertThat(outputs)
+                    .as("every action must still complete exactly once after the aborted drain")
+                    .containsExactlyInAnyOrderElementsOf(DrainAgent.expectedOutputs());
+        } finally {
+            DrainAgent.releaseAll();
+        }
+    }
+
     private void driveAbortTimeline(
             CountDownLatch abortExecuted,
             TimelineObservations observations,
             CountDownLatch drainReturned,
-            Thread mailboxThread) {
+            Thread mailboxThread,
+            ParallelExecutionCoordinator coordinator) {
         try {
             if (!abortExecuted.await(SETUP_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
                 observations.setupFailure =
@@ -279,13 +356,16 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                 return;
             }
 
-            DrainAgent.RELEASE_A.countDown();
+            DrainAgent.RELEASE_FIRST.countDown();
             observations.queuedActionAdvancedAfterAbort =
                     awaitCondition(
-                            () -> DrainAgent.C_STARTED.getCount() == 0 || workerParkedInDrain());
-            observations.queuedActionStartedBeforeSnapshot = DrainAgent.C_STARTED.getCount() == 0;
+                            () ->
+                                    DrainAgent.QUEUED_STARTED.getCount() == 0
+                                            || coordinator.getForfeitedPermitsForTesting() > 0);
+            observations.queuedActionStartedBeforeSnapshot =
+                    DrainAgent.QUEUED_STARTED.getCount() == 0;
 
-            DrainAgent.RELEASE_B.countDown();
+            DrainAgent.RELEASE_REST.countDown();
             if (!drainReturned.await(DRAIN_COMPLETION_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
                 observations.deadlockDetected = true;
                 mailboxThread.interrupt();
@@ -299,7 +379,10 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
 
     /** Drives the post-barrier timeline off the mailbox thread and records what happened. */
     private void driveTimeline(
-            TimelineObservations observations, CountDownLatch drainReturned, Thread mailboxThread) {
+            TimelineObservations observations,
+            CountDownLatch drainReturned,
+            Thread mailboxThread,
+            ParallelExecutionCoordinator coordinator) {
         try {
             // Step 2: wait until the mailbox thread is actually parked in the quiesce loop.
             observations.drainEngaged =
@@ -310,18 +393,16 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                 return;
             }
 
-            // Step 3: free one worker; it must pick up C's queued permit and park on the drain.
-            DrainAgent.RELEASE_A.countDown();
-            observations.workerParkedOnQueuedPermit =
-                    awaitCondition(
-                            ActionExecutionOperatorDrainDeadlockIntegrationTest
-                                    ::workerParkedInDrain);
-            if (!observations.workerParkedOnQueuedPermit) {
+            // Step 3: free one worker; it must pick up the queued permit and hand it back.
+            DrainAgent.RELEASE_FIRST.countDown();
+            observations.workerForfeitedQueuedPermit =
+                    awaitCondition(() -> coordinator.getForfeitedPermitsForTesting() > 0);
+            if (!observations.workerForfeitedQueuedPermit) {
                 return;
             }
 
-            // Step 4: release the still-in-flight action; its async resume must get the lock back.
-            DrainAgent.RELEASE_B.countDown();
+            // Step 4: release the rest; the last async resume must get the lock back.
+            DrainAgent.RELEASE_REST.countDown();
             if (!drainReturned.await(DRAIN_COMPLETION_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
                 observations.deadlockDetected = true;
                 // Break the mailbox out of its blocking yield so the test reports instead of
@@ -338,7 +419,7 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
     /** Records what the controller observed; read by the mailbox thread after the drain call. */
     private static final class TimelineObservations {
         private volatile boolean drainEngaged;
-        private volatile boolean workerParkedOnQueuedPermit;
+        private volatile boolean workerForfeitedQueuedPermit;
         private volatile boolean queuedActionAdvancedAfterAbort;
         private volatile boolean queuedActionStartedBeforeSnapshot;
         private volatile boolean deadlockDetected;
@@ -367,17 +448,6 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                                 && hasFrameMethod(stack, "yield"));
     }
 
-    /**
-     * Whether some worker thread has redeemed a dispatch permit during the drain and parked on the
-     * drain monitor.
-     */
-    private static boolean workerParkedInDrain() {
-        return anyThreadMatches(
-                stack ->
-                        hasFrame(stack, ParallelExecutionCoordinator.class.getName(), "runOneTask")
-                                && hasFrame(stack, "java.lang.Object", "wait"));
-    }
-
     private static boolean anyThreadMatches(Predicate<StackTraceElement[]> test) {
         for (ThreadInfo info : ManagementFactory.getThreadMXBean().dumpAllThreads(false, false)) {
             if (info != null && test.test(info.getStackTrace())) {
@@ -401,51 +471,119 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
     }
 
     /**
-     * Three actions on one input event: A and B block in their async sections until released; C is
-     * an instant no-op.
+     * One blocking action per worker, each parking in its async section until released, plus one
+     * instant action declared last so its dispatch permit has no worker left to redeem it. The
+     * first blocking action is released on its own, so exactly one worker becomes free.
      */
     public static class DrainAgent {
 
-        private static volatile CountDownLatch A_IN_ASYNC = new CountDownLatch(0);
-        private static volatile CountDownLatch B_IN_ASYNC = new CountDownLatch(0);
-        private static volatile CountDownLatch C_STARTED = new CountDownLatch(0);
-        private static volatile CountDownLatch RELEASE_A = new CountDownLatch(0);
-        private static volatile CountDownLatch RELEASE_B = new CountDownLatch(0);
+        private static final String[] BLOCKING = {
+            "drainAction0",
+            "drainAction1",
+            "drainAction2",
+            "drainAction3",
+            "drainAction4",
+            "drainAction5",
+            "drainAction6",
+            "drainAction7",
+            "drainAction8",
+            "drainAction9"
+        };
+
+        private static final String QUEUED = "drainActionQueued";
+
+        private static volatile CountDownLatch BLOCKING_IN_ASYNC = new CountDownLatch(0);
+        private static volatile CountDownLatch QUEUED_STARTED = new CountDownLatch(0);
+        private static volatile CountDownLatch RELEASE_FIRST = new CountDownLatch(0);
+        private static volatile CountDownLatch RELEASE_REST = new CountDownLatch(0);
 
         private static void reset() {
-            A_IN_ASYNC = new CountDownLatch(1);
-            B_IN_ASYNC = new CountDownLatch(1);
-            C_STARTED = new CountDownLatch(1);
-            RELEASE_A = new CountDownLatch(1);
-            RELEASE_B = new CountDownLatch(1);
+            BLOCKING_IN_ASYNC = new CountDownLatch(BLOCKING.length);
+            QUEUED_STARTED = new CountDownLatch(1);
+            RELEASE_FIRST = new CountDownLatch(1);
+            RELEASE_REST = new CountDownLatch(1);
         }
 
         private static void releaseAll() {
-            RELEASE_A.countDown();
-            RELEASE_B.countDown();
+            RELEASE_FIRST.countDown();
+            RELEASE_REST.countDown();
+        }
+
+        private static List<String> expectedOutputs() {
+            List<String> outputs = new ArrayList<>();
+            for (int index = 0; index < BLOCKING.length; index++) {
+                outputs.add(blockingActionId(index));
+            }
+            outputs.add("drain-action-queued");
+            return outputs;
+        }
+
+        private static String blockingActionId(int index) {
+            return "drain-action-" + index;
+        }
+
+        public static void drainAction0(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 0);
+        }
+
+        public static void drainAction1(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 1);
+        }
+
+        public static void drainAction2(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 2);
+        }
+
+        public static void drainAction3(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 3);
+        }
+
+        public static void drainAction4(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 4);
         }
 
-        public static void drainActionA(Event event, RunnerContext context) throws Exception {
-            runAction(event, context, "A", A_IN_ASYNC, RELEASE_A);
+        public static void drainAction5(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 5);
         }
 
-        public static void drainActionB(Event event, RunnerContext context) throws Exception {
-            runAction(event, context, "B", B_IN_ASYNC, RELEASE_B);
+        public static void drainAction6(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 6);
         }
 
-        public static void drainActionC(Event event, RunnerContext context) throws Exception {
-            runAction(event, context, "C", C_STARTED, null);
+        public static void drainAction7(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 7);
+        }
+
+        public static void drainAction8(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 8);
+        }
+
+        public static void drainAction9(Event event, RunnerContext context) throws Exception {
+            blockWorker(event, context, 9);
+        }
+
+        public static void drainActionQueued(Event event, RunnerContext context) throws Exception {
+            runAction(event, context, "drain-action-queued", QUEUED_STARTED, null);
+        }
+
+        private static void blockWorker(Event event, RunnerContext context, int index)
+                throws Exception {
+            runAction(
+                    event,
+                    context,
+                    blockingActionId(index),
+                    BLOCKING_IN_ASYNC,
+                    index == 0 ? RELEASE_FIRST : RELEASE_REST);
         }
 
         private static void runAction(
                 Event event,
                 RunnerContext context,
-                String name,
+                String actionId,
                 CountDownLatch started,
                 CountDownLatch release)
                 throws Exception {
             Long input = (Long) InputEvent.fromEvent(event).getInput();
-            String actionId = "drain-action-" + name;
             context.durableExecuteAsync(
                             new DurableCallable<String>() {
                                 @Override
@@ -465,8 +603,7 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
                                             && !release.await(
                                                     SETUP_TIMEOUT_SECONDS * 6, TimeUnit.SECONDS)) {
                                         throw new IllegalStateException(
-                                                "Timed out waiting for the release of action "
-                                                        + name);
+                                                "Timed out waiting for the release of " + actionId);
                                     }
                                     return actionId;
                                 }
@@ -477,19 +614,21 @@ class ActionExecutionOperatorDrainDeadlockIntegrationTest {
 
         private static AgentPlan getAgentPlan(AgentConfiguration config) throws Exception {
             Map<String, Action> actions = new LinkedHashMap<>();
-            for (String name : new String[] {"A", "B", "C"}) {
-                String actionName = "drainAction" + name;
-                Action action =
-                        new Action(
-                                actionName,
-                                new JavaFunction(
-                                        DrainAgent.class,
-                                        actionName,
-                                        new Class<?>[] {Event.class, RunnerContext.class}),
-                                Collections.singletonList(InputEvent.EVENT_TYPE));
-                actions.put(actionName, action);
+            for (String actionName : BLOCKING) {
+                actions.put(actionName, action(actionName));
             }
+            actions.put(QUEUED, action(QUEUED));
             return new AgentPlan(actions, new LinkedHashMap<>(), config);
         }
+
+        private static Action action(String actionName) throws Exception {
+            return new Action(
+                    actionName,
+                    new JavaFunction(
+                            DrainAgent.class,
+                            actionName,
+                            new Class<?>[] {Event.class, RunnerContext.class}),
+                    Collections.singletonList(InputEvent.EVENT_TYPE));
+        }
     }
 }
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorTest.java
index abe0196a1..1a89374f8 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperatorTest.java
@@ -56,6 +56,7 @@ import org.apache.flink.agents.plan.actions.ToolCallAction;
 import org.apache.flink.agents.plan.actions.Utils;
 import org.apache.flink.agents.plan.resourceprovider.JavaSerializableResourceProvider;
 import org.apache.flink.agents.plan.resourceprovider.PythonResourceProvider;
+import org.apache.flink.agents.plan.resourceprovider.PythonSerializableResourceProvider;
 import org.apache.flink.agents.plan.resourceprovider.ResourceProvider;
 import org.apache.flink.agents.plan.tools.FunctionTool;
 import org.apache.flink.agents.runtime.ResourceCache;
@@ -72,6 +73,7 @@ import org.apache.flink.agents.runtime.async.ContinuationContext;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl;
 import org.apache.flink.agents.runtime.memory.Mem0LongTermMemory;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionContextLifecycle;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionCoordinator;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionLock;
 import org.apache.flink.agents.runtime.operator.parallel.ParallelExecutionTask;
@@ -353,6 +355,40 @@ public class ActionExecutionOperatorTest {
         }
     }
 
+    /** A Python tool arrives as a serializable provider, which the screen must catch too. */
+    @Test
+    void pythonSerializableResourcesAlsoRequireAsyncCompatibleFlinkForParallelExecution()
+            throws Exception {
+        AgentPlan allJava = TestAgent.getAgentPlan(false);
+        PythonSerializableResourceProvider pythonTool =
+                new PythonSerializableResourceProvider(
+                        "python-tool",
+                        ResourceType.TOOL,
+                        "test.module",
+                        "FunctionTool",
+                        new HashMap<>());
+        Map<String, ResourceProvider> tools = new HashMap<>();
+        tools.put("python-tool", pythonTool);
+        Map<ResourceType, Map<String, ResourceProvider>> resourceProviders = new HashMap<>();
+        resourceProviders.put(ResourceType.TOOL, tools);
+        AgentPlan planWithPythonSerializableResource =
+                new AgentPlan(allJava.getActions(), resourceProviders, allJava.getConfig());
+
+        try (MockedStatic<Utils> utils = mockStatic(Utils.class)) {
+            utils.when(Utils::supportAsync).thenReturn(false);
+            assertThat(
+                            ActionExecutionOperator.shouldEnableParallelExecutionWithoutCoroutine(
+                                    planWithPythonSerializableResource, false))
+                    .isFalse();
+
+            utils.when(Utils::supportAsync).thenReturn(true);
+            assertThat(
+                            ActionExecutionOperator.shouldEnableParallelExecutionWithoutCoroutine(
+                                    planWithPythonSerializableResource, false))
+                    .isTrue();
+        }
+    }
+
     @Test
     void pythonChromaResourceCanUseParallelExecutionWithAsyncCompatibleFlink() throws Exception {
         AgentPlan allJava = TestAgent.getAgentPlan(false);
@@ -732,13 +768,21 @@ public class ActionExecutionOperatorTest {
     @Timeout(30)
     void restoreRebuildsInFlightBudgetFromProcessingKeysAndPendingEvents() throws Exception {
         assumeFalse(ContinuationActionExecutor.isContinuationSupported());
-        TestAgent.resetSingleAsyncFixture();
+        int numAsyncThreads = 1;
+        // Every worker has to be parked before the key under test queues its task, or a free
+        // worker pulls that task and it retires during the drain -- and retiring polls the key's
+        // pending event into a new round, which is exactly the unit phase 2 has to see rebuilt.
+        // Derived from the ceiling rather than hard-coded, so this tracks the pool it must fill.
+        int workers = ParallelExecutionCoordinator.workerCeiling(numAsyncThreads);
+        long queuedKey = workers + 1L;
+        TestAgent.resetSingleAsyncFixture(workers);
         AgentConfiguration config = new AgentConfiguration();
-        config.set(AgentExecutionOptions.NUM_ASYNC_THREADS, 1);
-        config.set(AgentExecutionOptions.MAX_IN_FLIGHT_INPUT_RECORDS, 3);
+        config.set(AgentExecutionOptions.NUM_ASYNC_THREADS, numAsyncThreads);
+        config.set(AgentExecutionOptions.MAX_IN_FLIGHT_INPUT_RECORDS, workers + 3);
 
-        // Phase 1: key 1 is pulled and parks in async; key 2 queues one task (single worker is
-        // busy) plus one pending input event (busy key). The drain retires key 1, so the snapshot
+        // Phase 1: `workers` keys are pulled and park in async, filling the pool; queuedKey then
+        // queues one task no worker is left to pull, plus one pending input event (busy key). The
+        // drain retires the saturating keys and forfeits queuedKey's permit, so the snapshot
         // captures exactly one processing key and one pending event.
         OperatorSubtaskState snapshot;
         Thread releaser = null;
@@ -752,10 +796,12 @@ public class ActionExecutionOperatorTest {
             ActionExecutionOperator<Long, Object> operator =
                     (ActionExecutionOperator<Long, Object>) testHarness.getOperator();
 
-            testHarness.processElement(new StreamRecord<>(1L));
+            for (long key = 1; key <= workers; key++) {
+                testHarness.processElement(new StreamRecord<>(key));
+            }
             assertThat(TestAgent.SINGLE_ASYNC_STARTED.await(5, TimeUnit.SECONDS)).isTrue();
-            testHarness.processElement(new StreamRecord<>(2L));
-            testHarness.processElement(new StreamRecord<>(2L));
+            testHarness.processElement(new StreamRecord<>(queuedKey));
+            testHarness.processElement(new StreamRecord<>(queuedKey));
 
             releaser =
                     new Thread(
@@ -770,7 +816,8 @@ public class ActionExecutionOperatorTest {
             releaser.setDaemon(true);
             releaser.start();
             operator.prepareSnapshotPreBarrier(1L);
-            assertThat(operator.getOperatorStateManager().getProcessingKeys()).containsExactly(2L);
+            assertThat(operator.getOperatorStateManager().getProcessingKeys())
+                    .containsExactly(queuedKey);
             snapshot = testHarness.snapshot(1L, 1L);
         } finally {
             TestAgent.SINGLE_ASYNC_ALLOW.countDown();
@@ -784,7 +831,7 @@ public class ActionExecutionOperatorTest {
         // either unit were dropped, admission would pass immediately and the assertion fails.
         TestAgent.resetSingleAsyncFixture();
         AgentConfiguration restoredConfig = new AgentConfiguration();
-        restoredConfig.set(AgentExecutionOptions.NUM_ASYNC_THREADS, 1);
+        restoredConfig.set(AgentExecutionOptions.NUM_ASYNC_THREADS, numAsyncThreads);
         restoredConfig.set(AgentExecutionOptions.MAX_IN_FLIGHT_INPUT_RECORDS, 2);
         Thread budgetReleaser = null;
         try (KeyedOneInputStreamOperatorTestHarness<Long, Long, Object> restored =
@@ -815,15 +862,19 @@ public class ActionExecutionOperatorTest {
             budgetReleaser.setDaemon(true);
             budgetReleaser.start();
 
-            restored.processElement(new StreamRecord<>(3L));
+            long admittedAfterRestore = queuedKey + 1L;
+            restored.processElement(new StreamRecord<>(admittedAfterRestore));
             assertThat(budgetFreed.get()).isTrue();
 
             operator.waitInFlightEventsFinished();
             List<StreamRecord<Object>> output =
                     (List<StreamRecord<Object>>) restored.getRecordOutput();
+            // queuedKey's restored task and the pending event behind it each emit queuedKey's
+            // double, and the record admitted once the budget freed emits its own.
             assertThat(output)
                     .extracting(StreamRecord::getValue)
-                    .containsExactlyInAnyOrder(4L, 4L, 6L);
+                    .containsExactlyInAnyOrder(
+                            queuedKey * 2, queuedKey * 2, admittedAfterRestore * 2);
         } finally {
             TestAgent.SINGLE_ASYNC_ALLOW.countDown();
             if (budgetReleaser != null) {
@@ -1609,7 +1660,16 @@ public class ActionExecutionOperatorTest {
         ParallelExecutionLock lock = new ParallelExecutionLock();
         ContinuationActionExecutor batch =
                 new ContinuationActionExecutor(
-                        1, interpreters::releaseCurrentThreadInterpreter, lock, (key, task) -> {});
+                        1,
+                        interpreters::releaseCurrentThreadInterpreter,
+                        lock,
+                        new ParallelExecutionContextLifecycle() {
+                            @Override
+                            public void suspend(Object key, ActionTask task) {}
+
+                            @Override
+                            public void resume(Object key, ActionTask task) {}
+                        });
         Callable<String> pythonCall =
                 () ->
                         interpreters.withInterpreter(
@@ -1629,9 +1689,6 @@ public class ActionExecutionOperatorTest {
                     @Override
                     public void setup(Object key, long recordIndex, long taskIndex) {}
 
-                    @Override
-                    public void restoreContext() {}
-
                     @Override
                     public void execute() {
                         try {
@@ -4264,7 +4321,17 @@ public class ActionExecutionOperatorTest {
         }
 
         public static void resetSingleAsyncFixture() {
-            SINGLE_ASYNC_STARTED = new CountDownLatch(1);
+            resetSingleAsyncFixture(1);
+        }
+
+        /**
+         * Same fixture, but {@code SINGLE_ASYNC_STARTED} opens only after {@code startedCount}
+         * actions have reached the async stage. A test that has to know the whole worker pool is
+         * parked -- because what it is arranging is a task no worker is left to pull -- sizes this
+         * to the pool; awaiting the latch is then the proof of saturation rather than a guess.
+         */
+        public static void resetSingleAsyncFixture(int startedCount) {
+            SINGLE_ASYNC_STARTED = new CountDownLatch(startedCount);
             SINGLE_ASYNC_ALLOW = new CountDownLatch(1);
         }
 
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManagerTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManagerTest.java
index bfcccc348..b12bd5718 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManagerTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ActionTaskContextManagerTest.java
@@ -32,14 +32,19 @@ import org.apache.flink.agents.runtime.actionstate.ActionState;
 import org.apache.flink.agents.runtime.actionstate.InMemoryActionStateStore;
 import org.apache.flink.agents.runtime.async.ContinuationActionExecutor;
 import org.apache.flink.agents.runtime.async.ContinuationContext;
-import org.apache.flink.agents.runtime.chat.ChatContext;
 import org.apache.flink.agents.runtime.context.JavaRunnerContextImpl;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl;
 import org.apache.flink.agents.runtime.context.RunnerContextImpl.ExecutionReportingContext;
 import org.apache.flink.agents.runtime.lifecycle.ComponentExecutionListener;
 import org.apache.flink.agents.runtime.memory.InteranlBaseLongTermMemory;
+import org.apache.flink.agents.runtime.memory.IsolatedCachedMemoryStore;
 import org.apache.flink.agents.runtime.memory.MemoryObjectImpl;
+import org.apache.flink.agents.runtime.memory.MemoryScope;
 import org.apache.flink.agents.runtime.metrics.FlinkAgentsMetricGroupImpl;
+import org.apache.flink.agents.runtime.subgraph.SubgraphDefinition;
+import org.apache.flink.agents.runtime.subgraph.SubgraphEvent;
+import org.apache.flink.agents.runtime.subgraph.SubgraphInvocation;
+import org.apache.flink.agents.runtime.utils.IdAllocatorSource;
 import org.apache.flink.api.common.serialization.SerializerConfigImpl;
 import org.apache.flink.api.common.state.MapState;
 import org.apache.flink.api.common.typeinfo.TypeInformation;
@@ -181,6 +186,77 @@ class ActionTaskContextManagerTest {
         }
     }
 
+    @Test
+    void createAndSetRunnerContextBuildsFreshMemoryContextOnFirstCall() throws Exception {
+        try (ActionTaskContextManager mgr = newManager()) {
+            ActionTask t =
+                    new JavaActionTask("k", new InputEvent(1L), TestActions.noopAction(), 1L);
+            invokeCreateAndSetRunnerContext(mgr, t);
+
+            // Production path: createAndSetRunnerContext pins the freshly created MemoryContext.
+            assertThat(t.getRunnerContext()).isInstanceOf(JavaRunnerContextImpl.class);
+            assertThat(t.getRunnerContext().getMemoryContext()).isNotNull();
+        }
+    }
+
+    @Test
+    void subgraphCallSharesItsMemoryScopeStoresButNotThePerActionJournal() throws Exception {
+        try (ActionTaskContextManager mgr = newManager()) {
+            MemoryScope scope = MemoryScope.isolated();
+            mgr.getSubgraphCalls()
+                    .register(
+                            new SubgraphInvocation<>(
+                                    "scoped", "k", mock(SubgraphDefinition.class), scope, null));
+
+            Action action = TestActions.noopAction();
+            ActionTask first =
+                    new JavaActionTask(
+                            "a", new SubgraphEvent("scoped", new InputEvent(1L), true), action, 1L);
+            ActionTask second =
+                    new JavaActionTask(
+                            "b", new SubgraphEvent("scoped", new InputEvent(2L), true), action, 2L);
+            // The runner context is shared and switched per task, so each memory context has to be
+            // read right after its own task is prepared.
+            invokeCreateAndSetRunnerContext(mgr, first);
+            RunnerContextImpl.MemoryContext memoryA = first.getRunnerContext().getMemoryContext();
+            invokeCreateAndSetRunnerContext(mgr, second);
+            RunnerContextImpl.MemoryContext memoryB = second.getRunnerContext().getMemoryContext();
+
+            // The update/observation journal belongs to the action ...
+            assertThat(memoryB).isNotSameAs(memoryA);
+            // ... while the stores belong to the call, so one action's writes stay readable.
+            assertThat(memoryB.getSensoryMemStore()).isSameAs(scope.getSensoryMemStore());
+            assertThat(memoryB.getShortTermMemStore()).isSameAs(scope.getShortTermMemStore());
+            assertThat(memoryA.getSensoryMemStore()).isInstanceOf(IsolatedCachedMemoryStore.class);
+        }
+    }
+
+    @Test
+    void subgraphCallWithoutMemoryScopeInheritsRootStoresInsteadOfIsolating() throws Exception {
+        try (ActionTaskContextManager mgr = newManager()) {
+            mgr.getSubgraphCalls()
+                    .register(
+                            new SubgraphInvocation<>(
+                                    "plain", "k", mock(SubgraphDefinition.class), null));
+
+            ActionTask task =
+                    new JavaActionTask(
+                            "a",
+                            new SubgraphEvent("plain", new InputEvent(1L), true),
+                            TestActions.noopAction(),
+                            1L);
+            invokeCreateAndSetRunnerContext(mgr, task);
+
+            // A call that declares no memory policy gets no isolation: the root branch supplies
+            // stores over the keyed memory state.
+            RunnerContextImpl.MemoryContext memory = task.getRunnerContext().getMemoryContext();
+            assertThat(memory.getSensoryMemStore())
+                    .isNotInstanceOf(IsolatedCachedMemoryStore.class);
+            assertThat(memory.getShortTermMemStore())
+                    .isNotInstanceOf(IsolatedCachedMemoryStore.class);
+        }
+    }
+
     @Test
     void createAndSetRunnerContextPinsFreshContextsAndRestoresTaskSpecificContexts()
             throws Exception {
@@ -192,75 +268,68 @@ class ActionTaskContextManagerTest {
             invokeCreateAndSetRunnerContext(mgr, taskA);
             RunnerContextImpl.MemoryContext memoryA = taskA.getRunnerContext().getMemoryContext();
             assertThat(memoryA).isNotNull();
-            ChatContext chatA = taskA.getRunnerContext().getChatContext();
+            IdAllocatorSource idsA = taskA.getRunnerContext().getIdAllocatorSource();
             ContinuationContext continuationA =
                     ((JavaRunnerContextImpl) taskA.getRunnerContext()).getContinuationContext();
 
             invokeCreateAndSetRunnerContext(mgr, taskB);
             RunnerContextImpl.MemoryContext memoryB = taskB.getRunnerContext().getMemoryContext();
             assertThat(memoryB).isNotNull().isNotSameAs(memoryA);
-            ChatContext chatB = taskB.getRunnerContext().getChatContext();
-            assertThat(chatB).isNotSameAs(chatA);
-            assertThat(chatB.getOwner()).isNotSameAs(chatA.getOwner());
-            assertThat(chatB.getManager()).isSameAs(chatA.getManager());
+            IdAllocatorSource idsB = taskB.getRunnerContext().getIdAllocatorSource();
+            assertThat(idsB).isNotSameAs(idsA);
             ContinuationContext continuationB =
                     ((JavaRunnerContextImpl) taskB.getRunnerContext()).getContinuationContext();
 
             mgr.restore("a", taskA);
             assertThat(taskA.getRunnerContext().getMemoryContext()).isSameAs(memoryA);
-            assertThat(taskA.getRunnerContext().getChatContext()).isSameAs(chatA);
+            assertThat(taskA.getRunnerContext().getIdAllocatorSource()).isSameAs(idsA);
             assertThat(((JavaRunnerContextImpl) taskA.getRunnerContext()).getContinuationContext())
                     .isSameAs(continuationA);
 
             mgr.restore("b", taskB);
             assertThat(taskB.getRunnerContext().getMemoryContext()).isSameAs(memoryB);
-            assertThat(taskB.getRunnerContext().getChatContext()).isSameAs(chatB);
+            assertThat(taskB.getRunnerContext().getIdAllocatorSource()).isSameAs(idsB);
             assertThat(((JavaRunnerContextImpl) taskB.getRunnerContext()).getContinuationContext())
                     .isSameAs(continuationB);
         }
     }
 
     @Test
-    void chatContextRestoresActiveCallAndSurvivesContinuationTransfer() throws Exception {
+    void idCountersRestoreActiveCallAndSurviveContinuationTransfer() throws Exception {
         try (ActionTaskContextManager mgr = newManager()) {
             Action action = TestActions.noopAction();
             ActionTask caller = new JavaActionTask("k", new InputEvent(1L), action, 1L);
             invokeCreateAndSetRunnerContext(mgr, caller);
             RunnerContextImpl context = caller.getRunnerContext();
-            ChatContext callerChat = context.getChatContext();
+            IdAllocatorSource callerIds = context.getIdAllocatorSource();
             String callId =
-                    callerChat
-                            .getManager()
-                            .prepareCall(
-                                    context,
-                                    new ObjectMapper()
-                                            .writeValueAsString(
-                                                    new ChatRequestEvent("model", List.of())));
+                    context.prepareChatCall(
+                            new ObjectMapper()
+                                    .writeValueAsString(new ChatRequestEvent("model", List.of())));
             ActionTask chatTask =
                     new JavaActionTask("k", context.getPendingEvents().get(0), action, 2L);
             invokeCreateAndSetRunnerContext(mgr, chatTask);
-            ChatContext activeChat = context.getChatContext();
-            assertThat(activeChat.getManager()).isSameAs(callerChat.getManager());
-            assertThat(activeChat.getOwner()).isNotSameAs(callerChat.getOwner());
+            IdAllocatorSource activeIds = context.getIdAllocatorSource();
+            assertThat(activeIds).isNotSameAs(callerIds);
             assertThat(context.getSubgraphInvocation())
-                    .isSameAs(mgr.getChatCallManager().get(callId));
+                    .isSameAs(mgr.getSubgraphCalls().get(callId));
 
             mgr.restore("k", caller);
-            assertThat(context.getChatContext()).isSameAs(callerChat);
+            assertThat(context.getIdAllocatorSource()).isSameAs(callerIds);
             assertThat(context.getSubgraphInvocation()).isNull();
             mgr.restore("k", chatTask);
-            assertThat(context.getChatContext()).isSameAs(activeChat);
+            assertThat(context.getIdAllocatorSource()).isSameAs(activeIds);
 
             // A generated task may no longer carry the bootstrap event; keep the whole context.
             ActionTask continuation = new JavaActionTask("k", new Event("resume"), action, 2L);
             mgr.removeContexts(chatTask);
             mgr.transferContexts(chatTask, continuation, new DurableExecutionManager(null));
             invokeCreateAndSetRunnerContext(mgr, continuation);
-            assertThat(context.getChatContext()).isSameAs(activeChat);
+            assertThat(context.getIdAllocatorSource()).isSameAs(activeIds);
             assertThat(context.getSubgraphInvocation())
-                    .isSameAs(mgr.getChatCallManager().get(callId));
+                    .isSameAs(mgr.getSubgraphCalls().get(callId));
             mgr.restore("k", caller);
-            assertThat(context.getChatContext()).isSameAs(callerChat);
+            assertThat(context.getIdAllocatorSource()).isSameAs(callerIds);
         }
     }
 
@@ -719,7 +788,6 @@ class ActionTaskContextManagerTest {
                 shortTermMem,
                 /* pythonRunnerContext */ null,
                 longTermMemory,
-                /* resourceScope */ null,
                 executionReportingContextFactory);
     }
 
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ChatCallTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ChatCallTest.java
index d4f84a651..6763934c8 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ChatCallTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/ChatCallTest.java
@@ -237,7 +237,8 @@ public class ChatCallTest {
                 },
                 ChatCallTest.class.getMethod("leaked", Event.class, RunnerContext.class));
         AgentPlan plan = new AgentPlan(agent);
-        // One worker waits for the response, another executes asynchronous model/tool work.
+        // Awaiting a response yields the caller's continuation instead of holding a worker, so both
+        // workers stay free for the chat subgraph's asynchronous model/tool work.
         plan.getConfig().set(AgentExecutionOptions.NUM_ASYNC_THREADS, 2);
         return plan;
     }
@@ -256,7 +257,7 @@ public class ChatCallTest {
     }
 
     @Test
-    void fullChatToolChatLoopWithAsyncWorkerWait(@TempDir Path logDir) throws Exception {
+    void fullChatToolChatLoopWithAsyncModelAndToolExecution(@TempDir Path logDir) throws Exception {
         AgentPlan plan = plan();
         plan.getConfig().set(AgentConfigOptions.TRACE_LOG_OUTPUT_TYPE, LoggerType.FILE);
         plan.getConfig().set(AgentConfigOptions.TRACE_LOG_OUTPUT_BASE_DIR, logDir.toString());
@@ -301,8 +302,14 @@ public class ChatCallTest {
         }
     }
 
+    /**
+     * The synchronous invoker branch: with {@code chat.async} and {@code tool-call.async} off, the
+     * built-in model and tool actions run through {@code durableExecute} and claim no worker at
+     * all, so a single-worker pool carries the whole loop. Awaiting the response does not claim one
+     * either — it yields the caller's continuation.
+     */
     @Test
-    void oneWaitWorkerSupportsSynchronousModelAndToolExecution() throws Exception {
+    void singleWorkerSupportsSynchronousModelAndToolExecution() throws Exception {
         AgentPlan plan = plan();
         plan.getConfig().set(AgentExecutionOptions.NUM_ASYNC_THREADS, 1);
         plan.getConfig().set(AgentExecutionOptions.CHAT_ASYNC, false);
diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/JavaActionTaskTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/JavaActionTaskTest.java
index 466f90a4f..aacf402b5 100644
--- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/JavaActionTaskTest.java
+++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/JavaActionTaskTest.java
@@ -137,6 +137,7 @@ public class JavaActionTaskTest {
                         new CachedMemoryStore(new ForTestMemoryMapState<>()),
                         new CachedMemoryStore(new ForTestMemoryMapState<>())),
                 new ArrayList<>(),
+                null,
                 KEY,
                 "observation",
                 false,
... 1971 lines suppressed ...