Merge branch 'worktree-agent-ae57d5ca18be911ad'

This commit is contained in:
2026-12-03 00:51:08 +00:00
31 changed files with 989 additions and 90 deletions
+9 -1
View File
@@ -152,7 +152,15 @@ func newRunnerReattaching(ctx context.Context, s *pipeline.Store, artifactsRoot
cancel()
}
if err != nil {
return nil, fmt.Errorf("cannot interrupt previously active agent %s: %w", owner.ID, err)
// One session that cannot be confirmed stopped must not disable
// every run: interrupt only its run, saying why, and go on.
reason := fmt.Sprintf("its previous %s stage agent (session %s) could not be confirmed stopped (%v); check for a leftover agent process before reusing the workspace", owner.Backend, owner.ID, err)
if prior := reasons[owner.RunID]; prior != "" {
reason = prior + "; " + reason
}
reasons[owner.RunID] = reason
log.Printf("run %d: cannot interrupt previously active agent %s: %v; the run is marked interrupted", owner.RunID, owner.ID, err)
continue
}
if err := s.ConfirmRecoveredSession(ctx, owner); err != nil {
return nil, err