Skip to content

Commit 3a5d00b

Browse files
Python: add checkpointing support to AgentFrameworkWorkflow.run() in agent-framework-ag-ui (#6646)
* Python: add checkpointing support to AgentFrameworkWorkflow.run() in ag-ui The ag-ui AgentFrameworkWorkflow.run() previously accepted only a RunAgentInput payload and exposed no way to use the core workflow's checkpointing/state-persistence, unlike the core agent-framework workflow implementations. This left ag-ui workflows without resumable execution. Add optional checkpoint_storage and checkpoint_id keyword arguments to run(), threaded through run_workflow_stream() into the core Workflow.run(). This delegates to the existing core capability instead of reinventing it and keeps the public surface consistent with Workflow.run(): - checkpoint_storage enables checkpoint creation at each superstep boundary. - checkpoint_id resumes a run from a persisted checkpoint; incoming messages are forwarded only as request-info responses (never as a new start-executor message) to honor the core's message/checkpoint_id mutual exclusivity, and responses + checkpoint_id performs a restore-then-send in one call. Both can also be supplied via the input_data keys __ag_ui_checkpoint_storage and __ag_ui_checkpoint_id so the FastAPI endpoint (which calls run(input_data) positionally) can opt in without changing its call site; explicit keyword arguments take precedence. Checkpoint resume bypasses the AG-UI thread snapshot hydration early-returns so it always reaches the core restore path. Backward compatible: run(input_data) keeps working unchanged, and the non-checkpoint path still calls run_workflow_stream(input_data, workflow) with its original two-argument convention. Adds focused tests covering checkpoint creation, resume-from-checkpoint, input-data-keyed params, and the unchanged default path. Fixes #6632. * Import Executor from the public agent_framework API in ag-ui workflow test * Fix ag-ui checkpoint resume: preserve thread snapshot, coerce resume responses; fix CI lint/typing A checkpoint-only resume no longer clobbers the stored AG-UI thread snapshot: the snapshot builder is seeded with the prior stored history so the saved snapshot keeps the earlier replayable transcript plus the newly produced output. Resume responses are now coerced against the post-restore pending requests on a checkpoint restore, so a JSON function_approval_response resumes through AG-UI after a cold restore instead of failing with a response-type mismatch. Also update the test-double workflow run() overrides to match the new keyword-only parent signature and re-sort the workflow test imports so ruff and the typing checkers pass. * Coerce ag-ui resume responses without a second checkpoint restore Reading pending request_info events for resume-response coercion previously restored the checkpoint into the live workflow, which invoked every executor's on_checkpoint_restore hook. workflow.run(checkpoint_id=...) then restored again, running those hooks a second time. Custom restore hooks are not required to be idempotent, so this could duplicate restoration work or break workflows that expect exactly one restore per resume. Load the persisted WorkflowCheckpoint directly from storage (runtime override or the workflow's build-time context storage) and read its pending_request_info_events instead. This exposes the same post-restore pending set for the resume contract and response coercion without mutating workflow state or running any restore hook, leaving workflow.run(checkpoint_id=...) as the single restore per resume. Add a regression test asserting on_checkpoint_restore runs exactly once on a checkpointed ag-ui resume. * Python: rework AG-UI workflow checkpointing onto public configuration surfaces Checkpoint storage is now configured on AgentFrameworkWorkflow (or the FastAPI endpoint) instead of being smuggled through input_data keys, and a run resumes by supplying its checkpoint id in the AG-UI forwarded props. With storage always in hand, resume-response coercion reads the pending request set straight from the persisted checkpoint via the public CheckpointStorage.load(), replacing the private runner-context fallback, and the core run call forwards checkpoint arguments directly, relying on core validation for conflicting parameters. Requesting a resume without configured storage now fails with a clear error. * Assign endpoint checkpoint storage in a single place The raw-workflow branch assigned checkpoint_storage at construction and the wiring block assigned it again. Construct the wrapper bare and let the wiring block own the assignment; the existing-storage guard keeps allowing a pre-wrapped runner without storage to adopt the endpoint's. --------- Co-authored-by: Evan Mattson <[email protected]> Co-authored-by: Evan Mattson <[email protected]>
1 parent 56d13bc commit 3a5d00b

7 files changed

Lines changed: 5770 additions & 5157 deletions

File tree

‎python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ag_ui.core import RunErrorEvent
1414
from ag_ui.encoder import EventEncoder
15-
from agent_framework import SupportsAgentRun, Workflow
15+
from agent_framework import CheckpointStorage, SupportsAgentRun, Workflow
1616
from fastapi import FastAPI, HTTPException
1717
from fastapi.params import Depends
1818
from fastapi.responses import Response, StreamingResponse
@@ -90,6 +90,7 @@ def add_agent_framework_fastapi_endpoint(
9090
dependencies: Sequence[Depends] | None = None,
9191
snapshot_store: AGUIThreadSnapshotStore | None = None,
9292
snapshot_scope_resolver: SnapshotScopeResolver | None = None,
93+
checkpoint_storage: CheckpointStorage | None = None,
9394
keepalive_seconds: float | None = 15,
9495
) -> None:
9596
"""Add an AG-UI endpoint to a FastAPI app.
@@ -113,6 +114,10 @@ def add_agent_framework_fastapi_endpoint(
113114
snapshot_scope_resolver: Optional resolver for the application-defined Snapshot Scope. Required whenever
114115
a snapshot store is configured because an AG-UI Thread id is not an authorization boundary. Also scopes
115116
in-memory workflow_factory instances when provided without a snapshot store.
117+
checkpoint_storage: Optional workflow checkpoint storage, applied when the endpoint exposes a workflow.
118+
When provided, each run creates a checkpoint at the end of every superstep, and a run may resume from
119+
a persisted checkpoint by supplying its id in the AG-UI forwarded props
120+
(``forwarded_props: {"checkpoint_id": ...}``).
116121
keepalive_seconds: Endpoint SSE keepalive interval in seconds. Defaults to 15. Positive values emit fixed
117122
SSE comments while the stream is open. None disables keepalive and preserves the non-keepalive response
118123
path. Keepalive comments are transport traffic and do not change AG-UI events.
@@ -136,6 +141,18 @@ def add_agent_framework_fastapi_endpoint(
136141
else:
137142
raise TypeError("agent must be SupportsAgentRun, Workflow, AgentFrameworkAgent, or AgentFrameworkWorkflow.")
138143

144+
if checkpoint_storage is not None:
145+
if not isinstance(protocol_runner, AgentFrameworkWorkflow):
146+
raise ValueError("checkpoint_storage is only supported when the endpoint exposes a workflow.")
147+
# A pre-wrapped runner without storage adopts the endpoint's; a runner that
148+
# already carries a different storage is a configuration conflict.
149+
if (
150+
protocol_runner.checkpoint_storage is not None
151+
and protocol_runner.checkpoint_storage is not checkpoint_storage
152+
):
153+
raise ValueError("checkpoint_storage is already configured on the AG-UI workflow runner.")
154+
protocol_runner.checkpoint_storage = checkpoint_storage
155+
139156
_configure_snapshot_persistence(
140157
protocol_runner,
141158
snapshot_store=snapshot_store,

‎python/packages/ag-ui/agent_framework_ag_ui/_workflow.py‎

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
ToolCallResultEvent,
2323
ToolCallStartEvent,
2424
)
25-
from agent_framework import Workflow
25+
from agent_framework import CheckpointStorage, Workflow
2626
from agent_framework._telemetry import mark_feature_used
2727

2828
from ._feature_usage import FeatureIndex
@@ -47,6 +47,17 @@
4747
WorkflowFactory = Callable[[str], Workflow]
4848

4949

50+
def _checkpoint_id_from_input(input_data: dict[str, Any]) -> str | None:
51+
"""Read an optional checkpoint id to resume from out of the AG-UI forwarded props."""
52+
forwarded_props = input_data.get("forwarded_props") or input_data.get("forwardedProps")
53+
if not isinstance(forwarded_props, dict):
54+
return None
55+
checkpoint_id = forwarded_props.get("checkpoint_id") or forwarded_props.get("checkpointId")
56+
if checkpoint_id is None:
57+
return None
58+
return str(checkpoint_id)
59+
60+
5061
class _WorkflowSnapshotBuilder:
5162
"""Capture replayable workflow protocol output without retaining raw events."""
5263

@@ -192,6 +203,7 @@ def __init__(
192203
name: str | None = None,
193204
description: str | None = None,
194205
snapshot_store: AGUIThreadSnapshotStore | None = None,
206+
checkpoint_storage: CheckpointStorage | None = None,
195207
) -> None:
196208
"""Initialize the AG-UI workflow wrapper.
197209
@@ -202,6 +214,11 @@ def __init__(
202214
description: Optional workflow description.
203215
snapshot_store: Optional AG-UI Thread Snapshot store. Snapshot persistence remains inactive unless
204216
endpoint setup also provides an explicit Snapshot Scope resolver.
217+
checkpoint_storage: Optional workflow checkpoint storage. When provided, each run
218+
creates a checkpoint at the end of every superstep (matching
219+
``agent_framework.Workflow.run(checkpoint_storage=...)``), and a run may resume
220+
from a persisted checkpoint by supplying its id in the AG-UI forwarded props
221+
(``forwarded_props: {"checkpoint_id": ...}``). Required for checkpoint resume.
205222
"""
206223
if workflow is not None and workflow_factory is not None:
207224
raise ValueError("Pass either workflow= or workflow_factory=, not both.")
@@ -216,6 +233,7 @@ def __init__(
216233
self.name = name if name is not None else getattr(workflow, "name", "workflow")
217234
self.description = description if description is not None else getattr(workflow, "description", "")
218235
self.snapshot_store = snapshot_store
236+
self.checkpoint_storage = checkpoint_storage
219237

220238
@staticmethod
221239
def _thread_id_from_input(input_data: dict[str, Any]) -> str:
@@ -258,6 +276,19 @@ async def run(self, input_data: dict[str, Any]) -> AsyncGenerator[BaseEvent]:
258276
"""Run the wrapped workflow and yield AG-UI events.
259277
260278
Subclasses may override this to provide custom AG-UI streams.
279+
280+
When ``checkpoint_storage`` is configured on this wrapper, the underlying core
281+
workflow creates a checkpoint at the end of each superstep, and a run may resume
282+
from a persisted checkpoint by supplying its id in the AG-UI forwarded props
283+
(``forwarded_props: {"checkpoint_id": ...}``), which restores the persisted
284+
workflow state instead of starting a fresh turn.
285+
286+
Note:
287+
Checkpointing (the ``agent_framework`` workflow checkpoint mechanism) is
288+
independent from AG-UI Thread Snapshot persistence (``snapshot_store``).
289+
The two can be used together, but they persist different things: snapshots
290+
capture replayable protocol output for a thread, while checkpoints capture
291+
executor/runtime state for resumable execution.
261292
"""
262293
mark_feature_used(FeatureIndex.AG_UI)
263294
thread_id = self._thread_id_from_input(input_data)
@@ -271,7 +302,17 @@ async def run(self, input_data: dict[str, Any]) -> AsyncGenerator[BaseEvent]:
271302
thread_id=thread_id,
272303
)
273304

274-
if snapshot_session.enabled and not raw_messages and resume_payload is None:
305+
checkpoint_storage = self.checkpoint_storage
306+
checkpoint_id = _checkpoint_id_from_input(input_data)
307+
if checkpoint_id is not None and checkpoint_storage is None:
308+
raise ValueError(
309+
"Resuming from a checkpoint requires checkpoint_storage to be configured on "
310+
"AgentFrameworkWorkflow (or the AG-UI endpoint)."
311+
)
312+
313+
# A checkpoint resume legitimately carries no new messages; it must reach the
314+
# core workflow's restore path rather than replaying a stored thread snapshot.
315+
if checkpoint_id is None and snapshot_session.enabled and not raw_messages and resume_payload is None:
275316
async for event in snapshot_session.hydrate_events(run_id=run_id):
276317
yield event
277318
return
@@ -296,8 +337,9 @@ async def run(self, input_data: dict[str, Any]) -> AsyncGenerator[BaseEvent]:
296337

297338
workflow = self._resolve_workflow(thread_id, snapshot_scope)
298339
builder_seed_messages = raw_messages
299-
if resume_payload is not None:
300-
# Resume requests carry only the synthesized interrupt response, so seed
340+
if resume_payload is not None or (checkpoint_id is not None and not raw_messages):
341+
# Resume requests carry only the synthesized interrupt response, and a
342+
# checkpoint-only resume carries no new messages at all; in both cases seed
301343
# the builder with stored history to avoid persisting a truncated thread.
302344
builder_seed_messages = snapshot_session.resume_seeded_messages(builder_seed_messages)
303345
snapshot_builder = _WorkflowSnapshotBuilder(builder_seed_messages) if snapshot_session.enabled else None
@@ -308,7 +350,9 @@ async def run(self, input_data: dict[str, Any]) -> AsyncGenerator[BaseEvent]:
308350
if isinstance(state_snapshot, dict):
309351
snapshot_builder.state = cast(dict[str, Any], state_snapshot)
310352
run_error_emitted = False
311-
async for event in run_workflow_stream(input_data, workflow):
353+
async for event in run_workflow_stream(
354+
input_data, workflow, checkpoint_storage=checkpoint_storage, checkpoint_id=checkpoint_id
355+
):
312356
if snapshot_builder is not None:
313357
snapshot_builder.observe(event)
314358
if isinstance(event, RunErrorEvent):

‎python/packages/ag-ui/agent_framework_ag_ui/_workflow_run.py‎

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@
2525
ToolCallEndEvent,
2626
ToolCallStartEvent,
2727
)
28-
from agent_framework import AgentResponse, AgentResponseUpdate, Content, Message, Workflow, WorkflowRunState
28+
from agent_framework import (
29+
AgentResponse,
30+
AgentResponseUpdate,
31+
CheckpointStorage,
32+
Content,
33+
Message,
34+
Workflow,
35+
WorkflowRunState,
36+
)
2937
from agent_framework.observability import (
3038
_use_telemetry_conversation_id, # pyright: ignore[reportPrivateUsage]
3139
)
@@ -151,6 +159,31 @@ async def _pending_request_events(workflow: Workflow) -> dict[str, Any]:
151159
return {}
152160

153161

162+
async def _pending_request_events_from_checkpoint(
163+
checkpoint_id: str,
164+
checkpoint_storage: CheckpointStorage,
165+
) -> dict[str, Any]:
166+
"""Read pending request_info events from a persisted checkpoint without restoring it.
167+
168+
Resume responses are coerced against the requests that were pending when the
169+
checkpoint was written. On a cold checkpoint resume those requests are not yet live
170+
on the workflow instance, so the coercion cannot see them. Reading
171+
``pending_request_info_events`` straight from the persisted ``WorkflowCheckpoint``
172+
exposes them without running any executor ``on_checkpoint_restore`` hook; the single
173+
``workflow.run(checkpoint_id=...)`` then performs the one real restore, so the
174+
restore -- and every custom restore hook -- runs exactly once per resume.
175+
"""
176+
try:
177+
checkpoint = await checkpoint_storage.load(checkpoint_id)
178+
except Exception:
179+
logger.warning(
180+
"Could not load checkpoint for resume-response coercion; the core run will surface any error.",
181+
exc_info=True,
182+
)
183+
return {}
184+
return dict(checkpoint.pending_request_info_events)
185+
186+
154187
def _interrupt_entry_for_request_event(request_event: Any) -> dict[str, Any] | None:
155188
"""Build AG-UI interrupt payload from a workflow request_info event."""
156189
request_payload = _request_payload_from_request_event(request_event)
@@ -780,8 +813,24 @@ def _details_code(details: Any) -> str | None:
780813
async def run_workflow_stream(
781814
input_data: dict[str, Any],
782815
workflow: Workflow,
816+
*,
817+
checkpoint_storage: CheckpointStorage | None = None,
818+
checkpoint_id: str | None = None,
783819
) -> AsyncGenerator[BaseEvent]:
784-
"""Run a Workflow and emit AG-UI protocol events."""
820+
"""Run a Workflow and emit AG-UI protocol events.
821+
822+
Args:
823+
input_data: Normalized AG-UI request payload (a ``RunAgentInput`` dump).
824+
workflow: The core ``Workflow`` instance to execute.
825+
checkpoint_storage: Optional checkpoint storage forwarded to the core
826+
workflow. When provided, the workflow creates a checkpoint at the end
827+
of each superstep, mirroring ``Workflow.run(checkpoint_storage=...)``.
828+
checkpoint_id: Optional checkpoint id to resume from. When provided the run
829+
restores the persisted workflow state instead of starting a fresh turn,
830+
mirroring ``Workflow.run(checkpoint_id=...)``. Any incoming messages are
831+
treated as request-info responses (or ignored) rather than a new
832+
start-executor message, so resume stays consistent with the core API.
833+
"""
785834
supplied_thread_id = input_data.get("thread_id") or input_data.get("threadId")
786835
thread_id = supplied_thread_id or str(uuid.uuid4())
787836
run_id = input_data.get("run_id") or input_data.get("runId") or str(uuid.uuid4())
@@ -800,7 +849,19 @@ async def run_workflow_stream(
800849
last_assistant_text: str | None = None
801850

802851
resume_payload = _extract_resume_payload(input_data)
803-
pending_before_run = await _pending_request_events(workflow)
852+
853+
# A checkpoint resume that carries an explicit resume payload targets the requests
854+
# that were pending when the checkpoint was written; those only reappear on the live
855+
# instance once the checkpoint is restored, so coerce against the checkpoint's
856+
# persisted pending set instead. Only do so when a resume payload is present, so a
857+
# pure checkpoint restore still surfaces its pending interrupts instead of tripping
858+
# the "resume required" contract.
859+
if checkpoint_id is not None and resume_payload is not None:
860+
if checkpoint_storage is None:
861+
raise ValueError("Resuming a checkpoint with an AG-UI resume payload requires checkpoint_storage.")
862+
pending_before_run = await _pending_request_events_from_checkpoint(checkpoint_id, checkpoint_storage)
863+
else:
864+
pending_before_run = await _pending_request_events(workflow)
804865
pending_interrupt_ids = _pending_workflow_interrupt_ids(pending_before_run)
805866
resume_entries: list[dict[str, Any]] = []
806867
if pending_interrupt_ids:
@@ -842,7 +903,11 @@ async def run_workflow_stream(
842903
return
843904
pending_interrupts = _interrupts_from_pending_requests(pending_before_run)
844905

845-
if not responses and pending_before_run:
906+
# A checkpoint resume must always reach ``workflow.run(checkpoint_id=...)`` so the
907+
# core restores persisted state and re-emits any pending requests from the
908+
# checkpoint. ``pending_before_run`` reflects the live (pre-restore) instance, so
909+
# short-circuiting on it here would skip the restore entirely.
910+
if checkpoint_id is None and not responses and pending_before_run:
846911
yield RunStartedEvent(run_id=run_id, thread_id=thread_id)
847912
for request_event in pending_before_run.values():
848913
request_payload = _request_payload_from_request_event(request_event)
@@ -859,7 +924,7 @@ async def run_workflow_stream(
859924
yield _build_run_finished_event(run_id=run_id, thread_id=thread_id, interrupts=pending_interrupts)
860925
return
861926

862-
if not responses and not messages:
927+
if checkpoint_id is None and not responses and not messages:
863928
yield RunStartedEvent(run_id=run_id, thread_id=thread_id)
864929
yield _build_run_finished_event(run_id=run_id, thread_id=thread_id, interrupts=pending_interrupts)
865930
return
@@ -895,14 +960,24 @@ def _drain_open_message() -> list[TextMessageEndEvent]:
895960
logger.debug("workflow.run() does not accept function_invocation_kwargs; dropping forwarded_props")
896961
fwd_kwargs = {}
897962

963+
# When checkpointing is not in play, keep the exact legacy call shape so duck-typed
964+
# workflows with narrower ``run`` signatures keep working. Otherwise forward the
965+
# checkpoint arguments as-is (``None`` included) and let core validate conflicts.
966+
checkpoint_kwargs: dict[str, Any] = {}
967+
if checkpoint_storage is not None or checkpoint_id is not None:
968+
checkpoint_kwargs = {"checkpoint_storage": checkpoint_storage, "checkpoint_id": checkpoint_id}
969+
898970
try:
899971
telemetry_conversation_id = str(supplied_thread_id) if supplied_thread_id is not None else None
900972
telemetry_context = partial(_use_telemetry_conversation_id, telemetry_conversation_id)
901973
with telemetry_context():
902-
if responses:
903-
event_stream = workflow.run(responses=responses, stream=True, **fwd_kwargs)
974+
if responses or checkpoint_id is not None:
975+
# ``message`` is mutually exclusive with both ``responses`` and
976+
# ``checkpoint_id`` in the core API; ``responses`` + ``checkpoint_id``
977+
# restores the checkpoint and delivers the responses in a single call.
978+
event_stream = workflow.run(stream=True, responses=responses or None, **checkpoint_kwargs, **fwd_kwargs)
904979
else:
905-
event_stream = workflow.run(message=messages, stream=True, **fwd_kwargs)
980+
event_stream = workflow.run(message=messages, stream=True, **checkpoint_kwargs, **fwd_kwargs)
906981

907982
async for event in _iterate_with_context(event_stream, telemetry_context):
908983
event_type = getattr(event, "type", None)

‎python/packages/ag-ui/tests/ag_ui/test_endpoint.py‎

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
ContextProvider,
2424
Executor,
2525
FunctionTool,
26+
InMemoryCheckpointStorage,
2627
InMemoryHistoryProvider,
2728
Message,
2829
SessionContext,
@@ -151,6 +152,59 @@ async def start(message: Any, ctx: WorkflowContext[Any, Any]) -> None:
151152
assert "RUN_FINISHED" in event_types
152153

153154

155+
async def test_add_endpoint_workflow_checkpointing_over_the_wire():
156+
"""Endpoint checkpoint_storage creates checkpoints, and forwardedProps.checkpoint_id resumes."""
157+
158+
@executor(id="start")
159+
async def start(message: Any, ctx: WorkflowContext[str]) -> None:
160+
del message
161+
await ctx.send_message("hello", target_id="finish")
162+
163+
@executor(id="finish")
164+
async def finish(message: str, ctx: WorkflowContext[Any, str]) -> None:
165+
await ctx.yield_output(f"{message}-done")
166+
167+
def event_types_of(response: Any) -> list[str]:
168+
lines = [line for line in response.content.decode("utf-8").split("\n") if line.startswith("data: ")]
169+
return [json.loads(line[6:]).get("type") for line in lines]
170+
171+
app = FastAPI()
172+
storage = InMemoryCheckpointStorage()
173+
workflow = WorkflowBuilder(start_executor=start).add_edge(start, finish).build()
174+
175+
add_agent_framework_fastapi_endpoint(app, workflow, path="/workflow", checkpoint_storage=storage)
176+
177+
client = TestClient(app)
178+
response = client.post(
179+
"/workflow",
180+
json={"threadId": "thread-cp", "messages": [{"role": "user", "content": "go"}]},
181+
)
182+
assert response.status_code == 200
183+
assert "RUN_ERROR" not in event_types_of(response)
184+
185+
checkpoints = sorted(
186+
await storage.list_checkpoints(workflow_name=workflow.name),
187+
key=lambda checkpoint: checkpoint.timestamp,
188+
)
189+
assert checkpoints, "expected the run to create at least one checkpoint"
190+
191+
resume_response = client.post(
192+
"/workflow",
193+
json={
194+
"threadId": "thread-cp",
195+
"messages": [],
196+
"forwardedProps": {"checkpoint_id": checkpoints[0].checkpoint_id},
197+
},
198+
)
199+
assert resume_response.status_code == 200
200+
resumed_types = event_types_of(resume_response)
201+
assert "RUN_FINISHED" in resumed_types
202+
assert "RUN_ERROR" not in resumed_types
203+
# The restored run must replay the remaining superstep and re-produce the final
204+
# output; a run that silently ignored the checkpoint id would finish with no text.
205+
assert "TEXT_MESSAGE_CONTENT" in resumed_types
206+
207+
154208
async def test_add_endpoint_accepts_keepalive_option_for_supported_runners(build_chat_client):
155209
"""Keepalive configuration is accepted at the endpoint seam for every supported runner shape."""
156210

@@ -5001,8 +5055,8 @@ async def test_workflow_resume_preserves_persisted_history(monkeypatch):
50015055
),
50025056
)
50035057

5004-
async def fake_run_workflow_stream(input_data: Any, workflow: Any):
5005-
del input_data, workflow
5058+
async def fake_run_workflow_stream(input_data: Any, workflow: Any, **kwargs: Any):
5059+
del input_data, workflow, kwargs
50065060
yield RunStartedEvent(run_id="run-2", thread_id="workflow-thread")
50075061
yield TextMessageStartEvent(message_id="resume-msg", role="assistant")
50085062
yield TextMessageContentEvent(message_id="resume-msg", delta="Resumed reply")

0 commit comments

Comments
 (0)