diff --git a/tests/restart-chaos/config-wave.ts b/tests/restart-chaos/config-wave.ts index 712d0ea4182..43f22651d46 100644 --- a/tests/restart-chaos/config-wave.ts +++ b/tests/restart-chaos/config-wave.ts @@ -254,7 +254,7 @@ function time(value: unknown): number | null { return Number.isFinite(at) ? at : null; } -/** Use what the task offers: complete a pending connection card, then Retry, then the agent's setup Retry. */ +/** Use what the task offers: complete a pending connection card, then Retry (the task's, or a rejected model's marker), then the agent's setup Retry. */ async function offeredAction(api: ChaosApi, record: ConfigTaskRecord, resources: TaskResources, current: ConfigSnapshot): Promise { const card = current.cards.find(candidate => candidate.status === "pending" && candidate.kind === "connection_intent"); if (card && resources.connectionId) { @@ -265,6 +265,12 @@ async function offeredAction(api: ChaosApi, record: ConfigTaskRecord, resources: const response = await api.post(`/api/issues/${record.issueId}/retry`, { idempotencyKey: randomUUID(), observedRunId: current.interruption.observedRunId }); return `clicked Retry (accepted=${String(response?.accepted)})`; } + // A rejected model offers Retry on the run's "Model unavailable" marker, which retries that run on the agent. + if (current.interruption?.userAction === "choose_model" && current.interruption.observedRunId) { + const response = await api.post(`/api/agents/${resources.agentId}/wakeup`, { source: "on_demand", triggerDetail: "manual", + reason: "retry_failed_run", failedRunId: current.interruption.observedRunId }); + return `clicked the model marker's Retry (run ${String(response?.id ?? "none")})`; + } if (current.agent && current.agent.lifecycleState !== "ready") { await api.post(`/api/agents/${resources.agentId}/lifecycle/retry`, {}); return `agent setup Retry (lifecycle ${current.agent.lifecycleState})`;