ag-ui-protocol/ag-ui
prepareRegenerateStream missing context parameter in payload
已關閉
#900 建立於 2026年1月6日
Integrationbuggood first issue
倉庫指標
- 星標
- (14,090 顆星)
- PR 合併指標
- (平均合併 9天 15小時) (30 天內合併 97 個 PR)
描述
When regenerating/editing messages, the context parameter is not included in the LangGraph run payload, causing agent context to be undefined on the backend.
File
integrations/langgraph/typescript/src/agent.ts
Root Cause
prepareStream (line 344-354) includes context:
const payload = {
...restProps,
command,
streamMode,
input: payloadInput,
config: payloadConfig,
context: {
...context,
...(payloadConfig?.configurable ?? {}),
}
};
prepareRegenerateStream (line 216-226) does NOT include context:
const payload = {
...(input.forwardedProps ?? {}),
input: this.langGraphDefaultMergeState(
timeTravelCheckpoint.values,
[messageCheckpoint],
input,
),
checkpointId: fork.checkpoint.checkpoint_id!,
streamMode,
};
Expected Behavior
Both methods should pass context to LangGraph so agent context is available regardless of whether it's a new message or a regeneration.
Reproduction:
- Use useAgentContext to provide context (e.g., model settings)
- Send a new message → context works ✅
- Edit the message and resend → context is undefined ❌
Suggested Fix: Add context to the payload in prepareRegenerateStream:
const payload = {
...(input.forwardedProps ?? {}),
input: this.langGraphDefaultMergeState(
timeTravelCheckpoint.values,
[messageCheckpoint],
input,
),
checkpointId: fork.checkpoint.checkpoint_id!,
streamMode,
context: input.context, // Add this line
};