Keep agent profile settings valid across providers (#3331)

* fix(app): keep profile modes scoped to providers

Applying a profile through sequential field setters allowed a provider change
to race mode persistence, poisoning modeless provider preferences with another
provider's mode. Apply profiles as one form transition and heal invalid
provider-scoped mode preferences when profiles are used.

* test(app): cover profile features across providers
This commit is contained in:
Mohamed Boudra
2026-08-13 18:48:02 +02:00
committed by GitHub
parent 90f3d95415
commit 9c195feb9b
17 changed files with 622 additions and 193 deletions
@@ -104,21 +104,24 @@ export interface SeededProviderModel {
* list is what avoids running anything: replacement models skip catalog
* discovery, and Claude's static modes mean the provider never spawns. The
* command only has to resolve for the availability probe, hence `node`.
* Providers with dynamic catalogs can pass a small RPC fixture as `command`.
*/
export async function seedModelProvider(input: {
id: string;
label: string;
models: SeededProviderModel[];
extends?: "claude" | "pi";
command?: string[];
}): Promise<HostSeed> {
const client = await connectAgentProfilesClient();
await client.patchDaemonConfig({
providers: {
[input.id]: {
extends: "claude",
extends: input.extends ?? "claude",
label: input.label,
description: `${input.label} test provider`,
enabled: true,
command: ["node"],
command: input.command ?? ["node"],
models: input.models,
},
},