You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the model ends a turn with refusal, ox now rolls the turn back and asks the user to rephrase. Anthropic's streaming-refusal guide notes that resending a refused request to the same model usually results in another refusal and recommends retrying with a fallback model, either server-side or in the client, as its refusals and fallback page describes. oh-my-pi retries a classifier refusal on other models (packages/coding-agent/src/session/turn-recovery.ts). Let the user opt into the same recovery.
Acceptance criteria
A config setting names the fallback model to retry a refused turn on. By default, no retry occurs, so behavior stays as it is today.
When a fallback is configured, a refused turn is rolled back and sent once more to the fallback model. The chat says which model answered.
If the fallback also refuses, the turn ends as it does today when refused, with the turn rolled back.
The retry follows the same prompt cache rules as a /model swap, keeping the system prompt byte-identical.
Tests cover recovery from a refusal on the fallback, refusals from both models, and no configured fallback.
Notes
This builds on the rollback implemented in #475 through the rewind session entry and Engine::roll_back.
Activity
fix(engine): roll a refused turn back so a rephrased prompt can succe…