-
Notifications
You must be signed in to change notification settings - Fork 404
Open
Description
Problem
Python LangGraph fixed RemoteGraph in PR #6497 to allow using context with stateful runs. The JS version lacks this fix.
From the Python PR:
Otherwise, you cannot use
contextwith stateful runs, because the server throws if you provide both configurable and context in a single call (due to ambiguous parameters)
Current JS Behavior (v1.1.2)
RemoteGraph only passes config to client.runs.stream(), not context:
// pregel/remote.js _streamIterator method
for await (const chunk of this.client.runs.stream(
sanitizedConfig.configurable.thread_id,
this.graphId,
{
config: sanitizedConfig, // Only config, no context parameter
...
}
))The SDK client already supports context, but RemoteGraph doesn't expose/use it.
Expected Behavior
Port the Python fix:
- Pop
thread_idfrom configurable - Pass
contextparameter toclient.runs.stream() - Allow using context with stateful (checkpointed) runs
Use Case
When using RemoteGraph to call sub-agents, we need to propagate user context (userId, tenantId, featureFlags) via context to sub-agent middleware that uses contextSchema. Currently this fails with 400 error when combined with thread_id for checkpointing.
Related
- Python fix: chore: pop thread ID from configurable fields in remote graph langgraph#6497
- Original issue: [Major BUG] - RemoteGraph in LangGraph 1.0: Cannot use
contextandconfigtogether - Forces choice between checkpointing OR middleware langgraph#6342 - Context API PR: feat(langgraph): new context api (replacing
config['configurable']andconfig_schema) langgraph#5243
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels