#15480·langflow

[Graph checkpoint / HITL] Approving a human-input step fails with "ComponentStructuredTool … Input should be callable" when the paused flow contains agent tools

Author: kartikgajjarCreated Sep 30, 2026Updated Sep 30, 2026
Labelsbug

Bug Description

Resuming a paused run (human-in-the-loop approval) fails immediately whenever any vertex in the checkpoint holds a ComponentStructuredTool, which includes an Agent's own component_as_tool output or any component in Tool Mode. serialize_value() in lfx/graph/checkpoint/schema.py drops a pydantic model only when model_dump(mode="json") raises. A ComponentStructuredTool dumps without raising, because pydantic's JSON mode converts its func/coroutine callables to repr strings. The checkpoint is persisted with '<function …>' strings, and _restore_model() → model_validate() rejects them on resume.

Reproduction

  1. Create a flow: Chat Input → Agent → Chat Output. Connect any component in Tool Mode to the Agent's Tools.
  2. Set the Agent step to require human approval.
  3. Run the flow and wait for "Awaiting human approval".
  4. Click Approve.

Minimal reproduction without the UI (lfx 1.11.1):

python
from pydantic import BaseModel
from lfx.base.tools.component_tool import ComponentStructuredTool
from lfx.graph.checkpoint.schema import serialize_value,
deserialize_value, wire_has_opaque_drop

class Args(BaseModel):
    q: str = ""

async def run(q: str = "") -> str:
    return q

tool = ComponentStructuredTool(name="t", description="d",
args_schema=Args, coroutine=run)
wire = serialize_value({"component_as_tool": [tool]})
print(wire_has_opaque_drop(wire))   # False — expected True
deserialize_value(wire)             # raises pydantic ValidationError

Expected behavior

The run resumes after approval. A tool can't be checkpointed faithfully, so it should be dropped like other opaque values: wire_has_opaque_drop() → True. The producer is then rebuilt on resume via _unbuild_needed_dropped_producers, whose docstring already names "Tool/model client".

Actual Behavior

The run fails as soon as the step is approved; the job ends FAILED.

Who can help?

Frequency

Always (100%) for any paused flow that holds agent tools.

Impact

Human-in-the-loop approval is unusable in agent flows with tools: every approve fails.

Error Details

ValidationError: 1 validation error for ComponentStructuredTool
coroutine
  Input should be callable [type=callable_type, input_value='<function
_patch_send_me... at 0x000001DCCE702980>', input_type=str]
  File "lfx/graph/checkpoint/schema.py", line 150, in _restore_model
    return obj.model_validate(payload)
RuntimeError: Background job emitted a terminal error event

(For sync tools the failing field is func instead of coroutine.)

Supporting Evidence

The checkpoint for the Agent vertex stores results.component_as_tool as serialized ComponentStructuredTool models whose callables are strings. The minimal reproduction above fails on stock lfx 1.11.1 and passes with the fix below.

Workaround

Local patch in serialize_value(): after a successful model_dump(mode="json"), check that the dump validates back into its model, and drop the value if it doesn't:

python
        try:
            type(value).model_validate(dumped)
        try:
            type(value).model_validate(dumped)
        except Exception:  # noqa: BLE001
            logger.debug("checkpoint: dropping non-round-trippable
model %s", type(value).__qualname__)
            return None

Round-trippable models (Message, Data) are unaffected. An alternative upstream fix is to exclude func/coroutine or special-case BaseTool in serialize_value. A run already paused with a broken checkpoint still fails on approve and must be restarted.

Additional Context

Related to HITL graph suspend/resume (LE-1440). Suggested labels: bug, graph-checkpoint, human-in-the-loop, severity:high.

Triage: Severity high · Scope: all users of approval steps in flows with tools · Regression: unknown (checkpointing is new) · First observed: lfx 1.11.1, 2026-09-30 · Component: lfx.graph.checkpoint

Operating System

Windows 11

Langflow Version

m- langflow 1.11.1, lfx 1.11.1 (pinned together) - Python 3.12.13, pydantic 2.13.5, langchain-core 1.6.5 - Windows 11 Enterprise; Loop24 UI in browser; local langflow run - Date observed: 2026-09-30

Python Version

3.12

Screenshot

No response

Flow File

No response