Removing a model from the picker is not that simple

Before a release, we decided to remove a few old models from the picker. Routine cleanup, apparently. We checked the log: one of the supposedly obsolete models was the most used default. Another had no turns during the past week but still had chats pinned to it.

In this gateway, removing a version from the picker meant withdrawing it. Withdrawal also prohibited new calls from existing chats. The code showed that the next turn without an eligible successor would return 422 and ask the user to select a model again.

There was a successor mechanism, but only within the same profile name. It could not move a chat to a profile with a different name. A user’s personal default also stored a version reference and did not fall back to the shared default.

That time, we changed the active version first, then withdrew the old ones with no turns running. Users were told to select a model again. We did not fix the mechanism; we accepted its consequences. Withdrawal was irreversible: restoring a version required a new one and another admission check.

Before doing this again, we need counts of pinned chats and personal defaults. No automated check was added at the time. Its test case is simple: zero turns in a week, one old chat. That version is still in use.

The picker and existing chats serve different purposes. Controlling both with one flag is convenient until the first cleanup like this.