From 0f8fc548f1907f8d68cc1bbc08a7f10e8b9f9c2e Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 18 May 2026 13:12:49 +0900 Subject: [PATCH] fix(runtime-fallback): consume delegated bootstrap retry payload Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/hooks/runtime-fallback/index.test.ts | 1 + src/hooks/runtime-fallback/last-user-retry-parts.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hooks/runtime-fallback/index.test.ts b/src/hooks/runtime-fallback/index.test.ts index 2f1949781..8e338bdbb 100644 --- a/src/hooks/runtime-fallback/index.test.ts +++ b/src/hooks/runtime-fallback/index.test.ts @@ -551,6 +551,7 @@ describe("runtime-fallback", () => { expect(promptBody?.tools?.question).toBe(false) expect(promptBody?.tools?.call_omo_agent).toBe(true) expect(promptBody?.parts?.[0]?.text).toContain("inspect src/tools/delegate-task") + expect(getDelegatedChildSessionBootstrap(sessionID)).toBeUndefined() }) test("should use persisted user prompt while preserving delegated bootstrap launch context", async () => { diff --git a/src/hooks/runtime-fallback/last-user-retry-parts.ts b/src/hooks/runtime-fallback/last-user-retry-parts.ts index 38a73eeec..c0cbf5657 100644 --- a/src/hooks/runtime-fallback/last-user-retry-parts.ts +++ b/src/hooks/runtime-fallback/last-user-retry-parts.ts @@ -54,8 +54,13 @@ export function getLastUserRetryPayload( return { retryParts } } + const bootstrapRetryParts = bootstrap?.retryParts ?? [] + if (bootstrapRetryParts.length > 0) { + clearDelegatedChildSessionBootstrap(sessionID) + } + return { - retryParts: bootstrap?.retryParts ?? [], + retryParts: bootstrapRetryParts, ...(bootstrap?.system ? { system: bootstrap.system } : {}), ...(bootstrap?.tools ? { tools: bootstrap.tools } : {}), }