A Free run can't be resumed: its router key was deactivated when it ended #331

Closed
opened 2026-10-30 03:49:04 -04:00 by cmoriarty · 1 comment
Owner

What happens
Run 157 (Free) failed, and was resumed after #326's fix deployed. Its spec-test steps passed. Then agent.code-review burned all 5 attempts in 3 seconds: each request to the Free router got 401 provider.auth. When a run ends, FreeService.release deactivates its router key and deletes its virtual models. On a restart, attach puts the chains back, which recreates the virtual models, but never makes the key again. So a failed or stopped Free run cannot be resumed.

Fix
On attach, check the run's key. When the router lists it inactive or not at all, make a new key, as provision does, and write it to the same file the run's config reads.

Done when
A Free run resumed after it ended reaches the router. A test with the fake router covers a released key made again.

**What happens** Run 157 (Free) failed, and was resumed after #326's fix deployed. Its spec-test steps passed. Then `agent.code-review` burned all 5 attempts in 3 seconds: each request to the Free router got 401 `provider.auth`. When a run ends, `FreeService.release` deactivates its router key and deletes its virtual models. On a restart, `attach` puts the chains back, which recreates the virtual models, but never makes the key again. So a failed or stopped Free run cannot be resumed. **Fix** On `attach`, check the run's key. When the router lists it inactive or not at all, make a new key, as `provision` does, and write it to the same file the run's config reads. **Done when** A Free run resumed after it ended reaches the router. A test with the fake router covers a released key made again.
Author
Owner

Confirmed on production (add5fd1, PR #330); closing. Run 157, resumed again after the deploy: agent.code-review succeeded on attempt 6, the first after the fix. Attempts 1 to 5 had each died at once on 401 provider.auth with the key released when the run ended. The run went on to its Visual check.

**Confirmed on production (add5fd1, PR #330); closing.** Run 157, resumed again after the deploy: `agent.code-review` succeeded on attempt 6, the first after the fix. Attempts 1 to 5 had each died at once on 401 `provider.auth` with the key released when the run ended. The run went on to its Visual check.
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#331
No description provided.