From fb88318c54ac7ab987581b00c07b5e4e15a8af5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Sibiril?= <81782+aureliensibiril@users.noreply.github.com> Date: Mon, 13 Apr 2026 23:13:06 +0200 Subject: [PATCH] Fix suspension checkpoint fallback in nested and parallel execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit executeParallel ignored SuspendedError when checkpoint was nil, treating it as a normal tool error. Nested suspension propagation also dropped the in-memory checkpoint when persistence failed, making runs non-resumable. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com> --- pkg/agent/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/agent/run.go b/pkg/agent/run.go index 00d028793..a97fcb0fb 100644 --- a/pkg/agent/run.go +++ b/pkg/agent/run.go @@ -562,7 +562,7 @@ func coreLoop(ctx context.Context, startAgent *Agent, inputMessages []llm.Messag s.logger.ErrorCtx(ctx, "cannot save checkpoint", log.Error(saveErr)) } } - return s.finishRun(ctx, nil, &SuspendedError{RunID: s.opts.runID}) + return s.finishRun(ctx, nil, &SuspendedError{RunID: s.opts.runID, Checkpoint: outerCP}) } if nae, ok := errors.AsType[*needsApprovalError](err); ok { @@ -967,7 +967,7 @@ func executeParallel( continue } se, ok := errors.AsType[*SuspendedError](entry.err) - if ok && se.Checkpoint != nil { + if ok { innerCheckpoints := make(map[string]*Checkpoint) var completed []CompletedCall