Repository navigation
Description
Problem
Rome picks a model provider in a hard-coded order (Codex subscription → Claude → Codex on ChatGPT credits → Codex on Rome credits), and a chat stays pinned to the provider of its last successful turn. From the guardian's side:
- Signing in to a second provider changes nothing, and there is nowhere to say "use this one from now on".
- Removing a provider breaks every chat pinned to it: each message fails with "not signed in". Only the Concierge recovers, after one failed turn.
- With Rome credits linked, removing Codex makes pinned chats silently keep running Codex on Rome credits, while the guardian's Claude subscription sits idle.
- The web model selector lists the whole catalog, including providers that aren't signed in.
- When a provider can't run, chats behave differently: the Concierge switches providers on its own; other chats, task chats and routines just fail.
- After a provider switch the new thread has seen none of the chat. The
<continuation>notice tells the agent to read history on demand.
Root cause: "the guardian removed this provider" and "the login is temporarily broken" are handled the same way, and pins are never invalidated.
Design (agreed with the guardian)
Concepts
- Default provider. The guardian picks it in AI Tools, from the signed-in providers. With one signed in, that one is the default. Rome credits appear as a provider of their own. This is a new domain word: add it to
docs/domains/agents.md. - A chat either follows the default (every normal chat) or has an exact selection (a developer option: a concrete model picked in the model selector). UI copy names providers, never concrete models.
Resolution rule: an exact selection runs that model; otherwise the chat runs on the default provider. Within one provider, a chat keeps the model it last ran. The cross-provider session pin goes away.
Guardian actions
| Action | Effect |
|---|---|
| One provider signed in | It is the default. |
| A second one signs in | The default stays. AI Tools offers "Set as default". |
| Change the default | A confirm dialog with one line of copy: "Ongoing chats switch to {provider} on their next reply." Following-default chats move on their next turn and show a one-line note, "Switched to {provider}". Exact selections are untouched. |
| Remove a provider | If it was the default, the remaining one becomes the default, with a note in AI Tools. Following-default chats on it move on their next turn, with the note. With none left, the next send shows the failure card. |
| Re-sign-in to a removed provider | Nothing moves back, and the default is unchanged. |
On upgrade, the initial default is the provider the old hard-coded order would pick, so nothing moves.
When a provider can't run
- Silent, with no card: one background retry for a transient error (429, 5xx, network). A single-model limit tries another model of the same provider.
- Otherwise (quota, login lost, provider removed) a failure card in the chat gives the reason and these actions:
- Following default: "Make {other} the default" (only when another provider is usable; it uses the same confirm dialog, then resends), Sign in (embed
AiToolsPanel, asAiToolsCarddoes), and "Retry at {time}". - Exact selection: "Back to following default" (primary; it resends), Sign in, and Retry later.
- Following default: "Make {other} the default" (only when another provider is usable; it uses the same confirm dialog, then resends), Sign in (embed
- No automatic cross-provider switch for any chat. The Concierge's provider failover is removed and supersedes
docs/adrs/concierge-provider-failover.md. This also replaces feat(concierge): run on the strongest model at low effort, and pick each task's model #2296's "fail over to the other provider's strong model". - Unattended chats (task chats, routines): a failure doesn't card each chat. It is grouped per provider outage into one notice in the Concierge main chat, plus one push, e.g. "Claude quota used up (back at 15:00), 3 chats waiting", with the same actions.
- The existing usage-limit continuation (
docs/concepts/sessions.md, restart/usage-limit continuation) is extended to task chats and routines, so they resume on their own when the window resets. - The notice adds "Run them on {other provider} now".
- The existing usage-limit continuation (
Rome credits
- They are used only when the guardian picks them as the default, or when they're the only usable provider. They are no longer swapped in automatically when ChatGPT disconnects (
rome-cloud/codex-login.tscodexLoginFor). - They're shown with the remaining balance. There is no extra confirm.
- Open: does moving between a Codex subscription and Codex on credits keep the same thread? Verify. If it does, it isn't a provider switch.
Context on a provider switch. Reuse #2273's light handoff, for every agent, not only the Concierge. The new thread's first turn carries the retired session's text messages and open tasks. When that would exceed half the context limit, a full handoff note is written instead. Tool traces are not carried.
Model selector (developer option): it lists only signed-in providers' models. A pick is an exact selection; Auto means following the default.
Known trade-offs
- A provider that can't run stops the Concierge until the guardian acts on the card. Unattended work waits for the window reset, or a tap on "run on {other} now".
- Changing the default moves every following-default chat. Text carries over; tool traces don't, so a mid-work task may re-read files. The voice shifts with the model.
- Guardians who relied on credits silently covering an expired ChatGPT login now see a card.
Scope
- One PR covers core plus web: resolution, pins, the default provider, removing the Concierge failover, explicit credits, the provider-switch handoff for all agents, the failure card, the grouped notice and the unattended continuation, the AI Tools default/confirm UI, and the login-aware selector. It also updates the docs:
docs/domains/agents.md,docs/concepts/sessions.md(model pin, continuation),docs/concepts/rome-cloud.md(credits), and both ADRs (pinned-session-fails-closed, Concierge failover). - iOS follows in a separate PR, later. Until then the app shows the new card through its generic card fallback. Resolution error payloads only add fields.
Activity