Skip to content

Preserve exact custom provider identity across session restore #4334

Description

@Hmbown

Problem

Saved/restored TUI sessions persist a built-in ApiProvider classification, but a user-named custom provider such as lm-studio or my-openai-proxy can collapse to the generic custom enum identity. After resume, CodeWhale may no longer have the exact provider key needed to re-resolve the original endpoint, credentials, route limits, and model metadata.

The original custom-provider contract landed through #1519, and #3205 covers explicit route receipts in Fleet/loadout scope. Neither tracks exact custom provider identity across ordinary session persistence and restore.

Expected behavior

  • Persist the exact configured provider key separately from the built-in provider kind.
  • Restore and re-resolve the named provider from live config; never infer it from model ID.
  • Fail closed with an actionable missing-provider message if the named provider was removed.
  • Keep persisted session records backward compatible and secret free.
  • Cover resume, cross-workspace load, runtime threads, rename, and session export/import.

Current evidence

Draft PR #4332 makes built-in provider/model route facts fresh and provider-aware, but intentionally does not redesign saved-session provider identity. This remains a follow-up seam and must not be represented as solved by #4332.

Acceptance

  • Session metadata has a backward-compatible exact provider identifier.
  • A custom named provider resumes through its original endpoint/model route.
  • Missing/renamed custom providers fail closed without falling back to another provider.
  • Tests cover built-in, custom, legacy, and removed-provider records.
  • Runtime and UI receipts show the effective named provider without secrets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreliabilityReliability, flaky behavior, retries, fallbacks, and robustnesssubagentsSub-agent orchestration, lifecycle, and completion handlingtuiTerminal UI behavior, rendering, or interactionv0.8.69Targeting v0.8.69

    Projects

    Status
    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions