Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions apps/server/scripts/record-codex-app-server-replay-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import {
SUBAGENT_CONTINUE_PARENT_PROMPT,
SUBAGENT_CONTINUE_PROMPT,
SUBAGENT_PROMPT,
SUBAGENT_REUSE_AFTER_IDLE_PROMPT,
SUBAGENT_REUSE_AFTER_IDLE_RESUME_PROMPT,
SUBAGENT_REUSE_AFTER_INTERRUPT_PROMPT,
SUBAGENT_REUSE_AFTER_INTERRUPT_RESUME_PROMPT,
THREAD_ROLLBACK_AFTER_PROMPT,
THREAD_ROLLBACK_FIRST_PROMPT,
THREAD_ROLLBACK_SECOND_PROMPT,
Expand Down Expand Up @@ -73,6 +77,8 @@ const SCENARIO_NAMES = [
"tool_call_restricted_granular",
"subagent",
"subagent_continue",
"subagent_reuse_after_interrupt",
"subagent_reuse_after_idle",
"multi_turn",
"provider_thread_resume",
"todo_list",
Expand Down Expand Up @@ -445,6 +451,61 @@ function scenarios(): ReadonlyArray<ReplayScenario> {
},
],
},
{
name: "subagent_reuse_after_interrupt",
fileName: "subagent_reuse_after_interrupt.ndjson",
description:
"A root turn spawns a native Codex subagent and is interrupted while it works, then a later root turn re-activates the same child thread.",
runs: [
{
name: "reuse-after-interrupt",
description:
"Interrupt the spawning turn mid-subagent, then message the same subagent from a new root turn.",
turnDefaults: {
approvalPolicy: "never",
sandboxPolicy: workspaceWriteSandbox(),
},
steps: [
{
type: "interruptedTurn",
label: "spawn-subagent-then-interrupt",
prompt: SUBAGENT_REUSE_AFTER_INTERRUPT_PROMPT,
interruptAfterCommandExecutionStarted: true,
},
{
type: "turn",
label: "reuse-interrupted-subagent",
prompt: SUBAGENT_REUSE_AFTER_INTERRUPT_RESUME_PROMPT,
},
],
},
],
},
{
name: "subagent_reuse_after_idle",
fileName: "subagent_reuse_after_idle.ndjson",
description:
"A root turn spawns a native Codex subagent, then a later root turn re-activates it. Replay advances past the session idle timeout between turns so the adapter registry is empty on reuse.",
runs: [
{
name: "reuse-after-idle",
description:
"Second root turn messages the same subagent after the session would have been reaped.",
steps: [
{
type: "turn",
label: "spawn-subagent",
prompt: SUBAGENT_REUSE_AFTER_IDLE_PROMPT,
},
{
type: "turn",
label: "reuse-subagent-after-idle",
prompt: SUBAGENT_REUSE_AFTER_IDLE_RESUME_PROMPT,
},
],
},
],
},
{
name: "multi_turn",
fileName: "multi_turn.ndjson",
Expand Down
Loading
Loading