Free profile: a model's 400 'could not be rendered into a prompt' is re-prompted to the same model with a false 'quota is back' message #200

Closed
opened 2026-10-18 07:03:52 -04:00 by cmoriarty · 4 comments
Owner

Seen in run 77 (production ead9f7e, the first run on #196's fix), openspec.propose.tasks attempt 1, 2026-10-18 ~11:02Z. The session was served only by Kilo's reflection/beam-free: four turns, the last with 34,650 characters of reasoning and a write of the whole tasks.md. The next request got:

400 {"error":{"message":"The request could not be rendered into a prompt for this model.","provider":"kilo","type":"invalid_request_error"}}

Opencode ended the turn with provider.invalid-request. Within 2-3 s Braid then sent the same session:

"You were paused while the free models' quota was spent, and it is back. Continue the step from where you stopped: do not redo work that is already done."

It did this three times, each refused the same way within a second. The attempt then ended with tasks.md not done (tasks: ready — 0 non-empty path(s)), and mediation started attempt 2 in a fresh session.

What is wrong

  1. A 400 is not in the router's retry_on_statuses, and the phrase is not in FAILOVER_ERRORS, so GoModel did not try the next model of the chain.
  2. #196's dry handling took a model-specific refusal (a request this model cannot render) for a dry chain. It re-prompted the same model with the same history, which can only fail again. It did so within seconds, not after a wait. And its continue prompt says quota was spent, which was false.

To do

  1. Add "could not be rendered into a prompt" (and kin: invalid_request_error with "chat template", "prompt rendering") to FAILOVER_ERRORS, so the router fails over at once.
  2. In Braid: a provider.invalid-request from one model is a refusal of this session by that model. Do not park as dry. Move the session to the next model that can serve (a lane move, recorded, with its own prompt), and keep the model out of this session's chain for the rest of the attempt.
  3. The continue prompt names its real reason (quota back, a model change, a stall). No re-prompt may follow a refusal within seconds: the same request to the same model needs a different model or a wait.
  4. A simulated-run scenario: a chain head that refuses to render a long session, and the step finishing on the next model.
Seen in run 77 (production ead9f7e, the first run on #196's fix), `openspec.propose.tasks` attempt 1, 2026-10-18 ~11:02Z. The session was served only by Kilo's `reflection/beam-free`: four turns, the last with 34,650 characters of reasoning and a `write` of the whole tasks.md. The next request got: > 400 `{"error":{"message":"The request could not be rendered into a prompt for this model.","provider":"kilo","type":"invalid_request_error"}}` Opencode ended the turn with `provider.invalid-request`. Within 2-3 s Braid then sent the same session: > "You were paused while the free models' quota was spent, and it is back. Continue the step from where you stopped: do not redo work that is already done." It did this three times, each refused the same way within a second. The attempt then ended with tasks.md not done (`tasks: ready — 0 non-empty path(s)`), and mediation started attempt 2 in a fresh session. **What is wrong** 1. A 400 is not in the router's `retry_on_statuses`, and the phrase is not in `FAILOVER_ERRORS`, so GoModel did not try the next model of the chain. 2. #196's dry handling took a model-specific refusal (a request this model cannot render) for a dry chain. It re-prompted the same model with the same history, which can only fail again. It did so within seconds, not after a wait. And its continue prompt says quota was spent, which was false. **To do** 1. Add "could not be rendered into a prompt" (and kin: `invalid_request_error` with "chat template", "prompt rendering") to `FAILOVER_ERRORS`, so the router fails over at once. 2. In Braid: a `provider.invalid-request` from one model is a refusal of this session by that model. Do not park as dry. Move the session to the next model that can serve (a lane move, recorded, with its own prompt), and keep the model out of this session's chain for the rest of the attempt. 3. The continue prompt names its real reason (quota back, a model change, a stall). No re-prompt may follow a refusal within seconds: the same request to the same model needs a different model or a wait. 4. A simulated-run scenario: a chain head that refuses to render a long session, and the step finishing on the next model.
Author
Owner

Seen on production after this fix (c1228b4, run 78, openspec.apply[6], ~14:21-14:24Z). The new behaviour works: a refusal moves the session, recorded as osf.free.moved with its reason. One choice is poor, though:

  1. 14:21Z: Zen glm-5.3-flash-free refused 3 times for capacity, so it was stalled (cause: busy, 30 min) and the step moved back to the router.
  2. ~14:22:35Z: Kilo refused the session (the #202 reasoning_content 400). The refusal move sent it to zen/glm-5.3-flash-free, the model stalled as busy 90 s earlier.
  3. Zen then answered "Endpoint is unavailable" on retries 2 to 6 (about a minute). It was stalled again (cuts 2), the step moved back to the router and parked zen_busy.

The router was dry at that moment (Gemini's minute spent, Kilo refusing, OVH's 2 a minute used), so Zen was the only target, and behind is not out. Still, a model stalled as busy minutes ago is a worse bet than waiting for the earliest reset (OVH's minute). The refusal move and zen_for should skip a Zen model stalled as busy and wait, unless the wait is longer than its cool-down.

Seen on production after this fix (c1228b4, run 78, `openspec.apply[6]`, ~14:21-14:24Z). The new behaviour works: a refusal moves the session, recorded as `osf.free.moved` with its reason. One choice is poor, though: 1. 14:21Z: Zen `glm-5.3-flash-free` refused 3 times for capacity, so it was stalled (`cause: busy`, 30 min) and the step moved back to the router. 2. ~14:22:35Z: Kilo refused the session (the #202 reasoning_content 400). The refusal move sent it to `zen/glm-5.3-flash-free`, the model stalled as busy 90 s earlier. 3. Zen then answered "Endpoint is unavailable" on retries 2 to 6 (about a minute). It was stalled again (cuts 2), the step moved back to the router and parked `zen_busy`. The router was dry at that moment (Gemini's minute spent, Kilo refusing, OVH's 2 a minute used), so Zen was the only target, and behind is not out. Still, a model stalled as busy minutes ago is a worse bet than waiting for the earliest reset (OVH's minute). The refusal move and `zen_for` should skip a Zen model stalled as `busy` and wait, unless the wait is longer than its cool-down.
Author
Owner

Shipped in c1228b4 (change free-refused-session-moves-on). Seen on production in run 78: Kilo's 400 moved the session to OVH (osf.free.moved, with the refusal as its why), and no quota re-prompt loop. Open: the move once chose a Zen model stalled as busy 90 s earlier (see the comment above). Design call left for the operator: free_refused is not mediated.

Left open: the OpenSpec change is not archived yet, and its tasks are not ticked against production. Deferred when the session wrapped up (2026-10-18).

Shipped in c1228b4 (change `free-refused-session-moves-on`). Seen on production in run 78: Kilo's 400 moved the session to OVH (`osf.free.moved`, with the refusal as its why), and no quota re-prompt loop. Open: the move once chose a Zen model stalled as busy 90 s earlier (see the comment above). Design call left for the operator: `free_refused` is not mediated. Left open: the OpenSpec change is not archived yet, and its tasks are not ticked against production. Deferred when the session wrapped up (2026-10-18).
Author
Owner

Closing: verified on production (run 78, c1228b4): Kilo's 400 moved the session to OVH with the refusal as its reason, and no re-prompt loop. The busy-Zen choice noted above is #204. The OpenSpec change free-refused-session-moves-on archives after free-profile (#164).

Closing: verified on production (run 78, c1228b4): Kilo's 400 moved the session to OVH with the refusal as its reason, and no re-prompt loop. The busy-Zen choice noted above is #204. The OpenSpec change `free-refused-session-moves-on` archives after `free-profile` (#164).
Author
Owner

Archived in OpenSpec as free-refused-session-moves-on (5a953a0).

Archived in OpenSpec as `free-refused-session-moves-on` (5a953a0).
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#200
No description provided.