Preserve Claude model and thinking preferences (#2912)
* fix(agents): preserve Claude thinking selections Model switches now resolve thinking against the target model's saved preference instead of resetting to the catalog default. Claude owns its configured-model defaults and legacy Fable alias handling, while persisted permission modes remain unchanged. * chore(claude): tag Fable compatibility shim * fix(app): resolve persisted model aliases * fix(models): preserve aliases for older clients * fix(models): hide compatibility aliases from listings * fix(settings): hide compatibility model aliases * test(claude): cover legacy catalog entry * test(app): expect mock thinking controls in schedules * fix(app): preserve queued thinking preferences * fix(app): reconcile schedule provider snapshots * fix(app): preserve schedule model selections * fix(claude): preserve exact configured model ids * fix(app): preserve committed thinking preferences * fix(app): preserve aliased schedule thinking
This commit is contained in:
@@ -42,6 +42,23 @@ describe("resolveProviderDiscoveredModels", () => {
|
||||
expect(refreshing.models).toEqual([grokModel]);
|
||||
});
|
||||
|
||||
it("excludes compatibility-only models from display and cache", () => {
|
||||
const compatibilityModel: AgentModelDefinition = {
|
||||
...piModel,
|
||||
id: "pi/model-legacy",
|
||||
label: "Pi Model legacy",
|
||||
isSelectable: false,
|
||||
};
|
||||
|
||||
const result = resolveModels({
|
||||
provider: "pi",
|
||||
currentModels: [piModel, compatibilityModel],
|
||||
});
|
||||
|
||||
expect(result.models).toEqual([piModel]);
|
||||
expect(result.cache?.models).toEqual([piModel]);
|
||||
});
|
||||
|
||||
it("does not show one provider's cached models while another provider loads", () => {
|
||||
const ready = resolveModels({ provider: "pi", currentModels: [piModel] });
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { AgentModelDefinition } from "@getpaseo/protocol/agent-types";
|
||||
import { filterSelectableModels } from "@/provider-selection/model-catalog";
|
||||
|
||||
export interface ProviderDiscoveredModelsCache {
|
||||
serverId: string;
|
||||
@@ -26,9 +27,10 @@ export function resolveProviderDiscoveredModels({
|
||||
providerSnapshotRefreshing,
|
||||
previousCache,
|
||||
}: ResolveProviderDiscoveredModelsInput): ResolveProviderDiscoveredModelsResult {
|
||||
if (currentModels && currentModels.length > 0) {
|
||||
const cache = { serverId, provider, models: currentModels };
|
||||
return { models: currentModels, cache };
|
||||
const selectableModels = filterSelectableModels(currentModels ?? null) ?? [];
|
||||
if (selectableModels.length > 0) {
|
||||
const cache = { serverId, provider, models: selectableModels };
|
||||
return { models: selectableModels, cache };
|
||||
}
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user