Deploy restarts production while a step waits on an agent question #32

Closed
opened 2026-09-15 01:32:31 -04:00 by cmoriarty · 1 comment
Owner

On 2026-09-15, openspec.apply[3] of run_01M2HF4SNRBVJ6TA8ZX11T2Z4H asked a "Status" question at 05:18:08. The deploy of fd581bf restarted Braid at 05:19:05, and the agent's opencode session went with it. The operator's answer at 05:19:27 came back gone (404).

deploy/wait-for-idle.sh reads running_steps from /api/status, and that counts only provisioning, running and interrupting. A step parked on an agent's question tool is awaiting_approval, so it counted as idle. The script's comment says "a gate is a row, not a process". That holds for a human.* step, but not for an agent question, which is a live session inside a running opencode serve.

Expected: the deploy waits while any step is waiting on an agent question, the same as while one is running. A human-gate step still does not delay it.

On 2026-09-15, `openspec.apply[3]` of run_01M2HF4SNRBVJ6TA8ZX11T2Z4H asked a "Status" question at 05:18:08. The deploy of fd581bf restarted Braid at 05:19:05, and the agent's opencode session went with it. The operator's answer at 05:19:27 came back `gone` (404). `deploy/wait-for-idle.sh` reads `running_steps` from `/api/status`, and that counts only `provisioning`, `running` and `interrupting`. A step parked on an agent's question tool is `awaiting_approval`, so it counted as idle. The script's comment says "a gate is a row, not a process". That holds for a `human.*` step, but not for an agent question, which is a live session inside a running `opencode serve`. **Expected:** the deploy waits while any step is waiting on an agent question, the same as while one is running. A human-gate step still does not delay it.
Author
Owner

Fixed in d1923bb, deployed with a4f4ac7 (archived as deploys-wait-for-agent-questions).

GET /api/status now also reports busy_steps: provisioning, running, interrupting, and awaiting_question, because an agent's question lives in its session and a restart ends it. running_steps keeps its meaning. deploy/wait-for-idle.sh waits on busy_steps, falling back to running_steps for a build that predates the field. A human gate still does not delay a deploy.

On production: /api/status answers busy_steps. This deploy itself ran against the old build, so it waited on running_steps; it hit the 60-minute limit while the run's steps kept running back to back, and deployed anyway at 07:14 UTC. Recovery completed openspec.reconcile-tasks for free (its predicate held), and openspec.test.unit started on the new build.

Fixed in d1923bb, deployed with a4f4ac7 (archived as `deploys-wait-for-agent-questions`). `GET /api/status` now also reports `busy_steps`: provisioning, running, interrupting, and `awaiting_question`, because an agent's question lives in its session and a restart ends it. `running_steps` keeps its meaning. `deploy/wait-for-idle.sh` waits on `busy_steps`, falling back to `running_steps` for a build that predates the field. A human gate still does not delay a deploy. On production: `/api/status` answers `busy_steps`. This deploy itself ran against the old build, so it waited on `running_steps`; it hit the 60-minute limit while the run's steps kept running back to back, and deployed anyway at 07:14 UTC. Recovery completed `openspec.reconcile-tasks` for free (its predicate held), and `openspec.test.unit` started on the new build.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cmoriarty/braid#32
No description provided.