fix(prompt-retry): preserve async holds without blocking validation fallbacks

This commit is contained in:
YeonGyu-Kim
2026-05-19 13:48:33 +09:00
parent 5f733f471c
commit e57bac3b6b
9 changed files with 168 additions and 6 deletions
@@ -6,7 +6,7 @@ import {
clearAllDelegatedChildSessionBootstrap,
getDelegatedChildSessionBootstrap,
} from "../../shared/delegated-child-session-bootstrap"
import { dispatchInternalPrompt } from "../../shared/prompt-async-gate"
import { dispatchInternalPrompt, releaseAllPromptAsyncReservationsForTesting } from "../../shared/prompt-async-gate"
import { clearSessionPromptParams, getSessionPromptParams } from "../../shared/session-prompt-params-state"
import {
getSessionAgent,
@@ -26,6 +26,7 @@ afterAll(() => { mock.restore() })
afterEach(() => {
clearBackgroundTaskRegistryForTesting()
releaseAllPromptAsyncReservationsForTesting()
})
const TASK_TTL_MS = 30 * 60 * 1000
@@ -3,12 +3,14 @@ import {
clearSessionPromptParams,
getSessionPromptParams,
} from "../../shared/session-prompt-params-state"
import { releaseAllPromptAsyncReservationsForTesting } from "../../shared/prompt-async-gate"
import { createTask, startTask } from "./spawner"
import type { BackgroundTask } from "./types"
describe("background-agent spawner agent-not-found fallback", () => {
afterEach(() => {
clearSessionPromptParams("session-fallback")
releaseAllPromptAsyncReservationsForTesting()
})
test("retries with 'general' agent when promptAsync fails with Agent not found", async () => {