1import type { OrchestratorFixtureInput } from "../shared.ts";
2
3export const CLAUDE_IDLE_RESUME_PROMPT_1 = "Respond with exactly: idle resume first turn complete";
4export const CLAUDE_IDLE_RESUME_PROMPT_2 = "Respond with exactly: idle resume second turn complete";
5
6/**
7 * Regression for the stale-session first-message failure (threads 47763f5e
8 * run 10 and d0fe9018 runs 7/8, 2026-07-01/02): the provider session manager
9 * idle-releases the session runtime between turns, wiping the adapter's
10 * in-memory openedNativeThreads set. The next turn must reopen the SDK query
11 * with `resume` (the persisted provider thread proves the native session
12 * exists) — a create-style `sessionId` open fails against an existing
13 * session and burned the user's first message after every idle gap.
14 */
15export function claudeIdleResumeInput(): OrchestratorFixtureInput {
16 return {
17 steps: [
18 { type: "message", text: CLAUDE_IDLE_RESUME_PROMPT_1 },
19 // Past ProviderSessionManager's 30-minute idle timeout: the reaper
20 // releases the live session entry and closes the SDK query.
21 { type: "advance_clock", duration: "31 minutes" },
22 { type: "message", text: CLAUDE_IDLE_RESUME_PROMPT_2 },
23 ],
24 };
25}