From da709770f0aaa0831a99c68839c626accda265b3 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 16 Apr 2026 15:40:13 +0000 Subject: [PATCH] fix: call onSpawn after pod enters Running state to prevent UI desync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The k8s adapter never called ctx.onSpawn(), so the Paperclip server had no processStartedAt timestamp for the run. The stale-run reaper (reapOrphanedRuns) would then mark live k8s runs as failed/orphaned, causing the UI to show no active runs and triggering duplicate run attempts that hit the concurrency guard. Uses pid=-1 as a sentinel since there is no local process — the server's isProcessAlive check safely returns false for pid <= 0. Co-Authored-By: Paperclip --- src/server/execute.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/server/execute.ts b/src/server/execute.ts index 1f6ed60..ede60dd 100644 --- a/src/server/execute.ts +++ b/src/server/execute.ts @@ -387,6 +387,19 @@ export async function execute(ctx: AdapterExecutionContext): Promise