From 263ef18098ef47e58405f0137117745165a526aa Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 10 Nov 2026 02:06:47 -0600 Subject: [PATCH] test(chaos): retry a rejected model's run the way its task marker does A rejected model asks the user to choose a model (userAction choose_model) instead of offering the task-level Retry. Its "Model unavailable" marker offers Retry, which retries that run on the agent. The config wave now uses that action after it restores the model. Co-Authored-By: Claude --- tests/restart-chaos/config-wave.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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})`;