Skip to content

AgentCoreMemorySaver: Exception when using get_state(subgraphs=True) with nested graphs #733

Description

When using AgentCoreMemorySaver and calling get_state(config, subgraphs=True) on a graph that has nested graphs, I get the following error. Note that without subgraphs=True it works as expected.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".venv/lib/python3.12/site-packages/langgraph/pregel/main.py", line 1264, in get_state
    return self._prepare_state_snapshot(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/langgraph/pregel/main.py", line 1066, in _prepare_state_snapshot
    task_states[task.id] = subgraphs[task.name].get_state(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/langgraph/pregel/main.py", line 1263, in get_state
    saved = checkpointer.get_tuple(config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/langgraph_checkpoint_aws/agentcore/saver.py", line 75, in get_tuple
    checkpoint_config = CheckpointerConfig.from_runnable_config(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/langgraph_checkpoint_aws/agentcore/models.py", line 40, in from_runnable_config
    raise InvalidConfigError(
langgraph_checkpoint_aws.agentcore.constants.InvalidConfigError: RunnableConfig must contain 'actor_id' for AgentCore Checkpointer

Config:

RunnableConfig(
    configurable={
        "thread_id": thread_id,
        "actor_id": ACTOR_ID,
    },
    recursion_limit=RECURSION_LIMIT,
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions