Repository navigation
A request a safety classifier declined goes to the bot's fallback model, that request alone - #349
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daf9ed4b93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
daf9ed4 to
93b3d2c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93b3d2c370
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a46dc16 to
7de1ff4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7de1ff466b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…el, that request alone A bot created with `--fallback PROVIDER/MODEL` (a known provider's model in its family, inherited by forks) resends a request that ended with `stop_reason: "refusal"` to that model, on the same body. The next request goes back to the bot's own model, with the fallback's answer in its history. A refusal the fallback repeats, or one on a bot with no fallback, ends the turn with `provider_refusal` as before. - The refusal's `stop_details` category and fallback credit are kept as the error's facts. On the Claude API, a retry on the bot's own provider redeems the credit (`fallback-credit-2026-07-01`); a 400 to it sends the same retry without it. Bedrock requests send no credit. - The retry is a `retry` event naming the fallback; the answer fires `model_fallback` and its usage is priced at the fallback's model. - Anthropic's server-side `fallbacks` is no longer asked for: its routing sticks to the fallback model for about an hour. `--fallbacks` is replaced by `--fallback`; the store's `fallbacks` column by `fallback` (schema 60). Its beta stays on the Claude API so stored answers it served replay. - Only `prefix_binding_mismatch` thinking drops count as binding drops; a fallback's blocks dropped on the bot's model (`model_binding_mismatch`) are expected. - `[fallbacks]` in ~/.agent/config.toml names a fallback per model; the CLI, Sonny's leads and its tasks give it to a new bot that names none. - The Harbor adapter takes `fallback` instead of always asking for server-side fallbacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGCoLcHQMmGw188SP8o
…point that refused A call parked on the fallback model's pool kept its attempts but not its fallback, so it resumed on the bot's model and was refused again. The park now keeps the fallback and its credit. The credit went with the retry only when the fallback named the bot's own provider; a turn run on another binding's model compared the wrong one. It now goes when the fallback is on the endpoint that refused, and the `model_fallback` event names the model the call asked for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGCoLcHQMmGw188SP8o
…sent to A provider name rebound to another family across a restart would have taken the bot's history in the wrong encoding; the refusal stands instead, for a new fallback and one a parked call resumes alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGCoLcHQMmGw188SP8o
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGCoLcHQMmGw188SP8o
7de1ff4 to
b997b99
Compare
What
A bot created with
--fallback PROVIDER/MODEL(a known provider's model in its family, inherited by forks) resends a request that ended withstop_reason: "refusal"to that model, on the same body. Only that request. The next request goes straight back to the bot's own model, with the fallback's answer in its history. A refusal the fallback repeats, or a refusal on a bot with no fallback, ends the turn withprovider_refusalas before.Triggered only by the typed
stop_reason; nothing matches message text.Details
stop_details.categoryandfallback_credit_tokenare kept as the error's facts. The credit is taken out before the error is recorded.fallback-credit-2026-07-01), so the fallback's cache writes are priced as if it had run there all along. A 400 to the credit sends the same retry without it. Bedrock requests send no credit: Mantle answers betas it does not take with a 400, and this one has not been tried there.retryevent withfallback: "provider/model"; the answer fires the existingmodel_fallbackevent, and its usage names the fallback's provider and model inmodels, so it is priced at that model.fallbacks: "default"is no longer asked for, since its routing sticks to the fallback model for about an hour.--fallbacksis replaced by--fallback, and the store'sfallbackscolumn byfallback TEXT(schema 60). The server-side beta stays on the Claude API so stored answers it served still replay.prefix_binding_mismatchentries ininput_transformationscount as binding drops. A fallback's thinking blocks that the API drops on the bot's model (model_binding_mismatch) are expected.[fallbacks]in~/.agent/config.tomlnames a fallback per model. The CLI, Sonny's leads and its tasks give it to a new bot that names none:--ak fallback=PROVIDER/MODELinstead of always asking for server-side fallbacks, andbot_settingsrecords each bot's fallback model.Tests
[fallbacks]and--fallbackwins.A follow-up will send a refusal that stands to later requests as a short note naming the category, in place of the refused turn.
Generated by Claude Code