Skip to content

Per-thread opt-out for provider-retry #4131

Open

Description

@mistakeknot

The workflow

An orchestrator (Clavain) spawns bb threads and applies its own retry and fallback policy. When a turn fails it decides whether to retry, on which account or model, or to stop. It records every physical attempt. For that to be sound, it has to be the only thing re-running the thread's turns.

More context: Clavain's BB integration ADR (its parity matrix and capability gaps).

What happens today

The provider-retry plugin retries any thread's failed turn on overload or a subscription-window limit (server.ts#L47). There's no per-thread or per-project opt-out; the only switch is disabling the plugin for every thread. A turn the orchestrator has already recorded as failed can therefore be re-run behind its back hours later, when the window resets.

(The retry replays the recorded model, effort and tier, so it never switches model (turn-retry.ts#L147). The concern is the unowned re-attempt, not a silent fallback.)

What you would expect

A per-thread opt-out that a caller sets right after spawning:

  • bb provider-retry disable <thread-id> makes the turn.failed handler skip that thread. It also cancels a retry already queued for it, covering a turn that failed between spawn and disable.
  • bb provider-retry enable <thread-id> removes the opt-out, and bb provider-retry status <thread-id> shows it.

It would be stored in the plugin's kv, the way bb pool bypass <thread-id> stores the account pool's per-thread bypass.

Prototype: https://github.com/mistakeknot/bb/tree/provider-retry-thread-opt-out (one commit: plugin, tests, docs). I'll open the PR once you're happy with the shape. A bb thread spawn flag or a core thread setting would also work if you'd rather core own it.

Context and alternatives

  • The workaround today is disabling provider-retry globally, which also removes it from threads a person is driving.
  • Related, and separate: recording the effective provider settings per turn.
  • I searched open and closed issues for "provider-retry" and "disable retry" and found no existing request.

AGENT GENERATED

Activity

  1. added
    providers
    provider-retry
    on Sep 23, 2026
  2. bb-slop-cop commented on Sep 23, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Type Feature, Priority Medium, Effort Low, and labels providers, provider-retry. All classifications were missing; no existing values were replaced. Verified the final Type is Feature.

    Per-thread retry control adds functionality to the existing automatic retry policy. Global disabling provides a workaround, and the expected change is contained within the plugin. No reproduction report or pull request was created because this is a feature request.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    provider-retryproviders

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions