Skip to content

Commit a8dfea0

Browse files
fix: check if sub graph has enabled state before save checkpoint (#264)
1 parent 2480c56 commit a8dfea0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compose/graph_run.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,13 @@ func (r *runner) handleInterruptWithSubGraphAndRerunNodes(
531531
ToolsNodeExecutedTools: tempInfo.interruptExecutedTools,
532532
SubGraphs: make(map[string]*checkpoint),
533533
}
534-
if state, ok := ctx.Value(stateKey{}).(*internalState); ok {
535-
cp.State = state.state
534+
if r.runCtx != nil {
535+
// current graph has enable state
536+
if state, ok := ctx.Value(stateKey{}).(*internalState); ok {
537+
cp.State = state.state
538+
}
536539
}
540+
537541
intInfo := &InterruptInfo{
538542
State: cp.State,
539543
BeforeNodes: tempInfo.interruptBeforeNodes,

0 commit comments

Comments
 (0)