diff --git a/tests-js/scripts/desktop-smoke.test.ts b/tests-js/scripts/desktop-smoke.test.ts index 837de3e1a1..a06ff2c815 100644 --- a/tests-js/scripts/desktop-smoke.test.ts +++ b/tests-js/scripts/desktop-smoke.test.ts @@ -52,11 +52,11 @@ test('provider reconfiguration preserves feed, plugins, history and explicit fix writeEnvFile(home) expect(yaml.load(fs.readFileSync(path.join(home, 'config.yaml'), 'utf8'))).toMatchObject({ updates: feed, plugins: { witness: true }, - model: { provider: 'custom', temperature: 0.7, context_length: 12000 }, + model: { provider: 'custom', base_url: 'http://127.0.0.1:9001/v1', temperature: 0.7, context_length: 12000 }, providers: {}, - // Exactly one entry, repointed at the second URL: a bare `custom` resolves - // from this list on every vintage, and reconfiguring must not stack - // duplicates. + // Exactly one entry, repointed at the second URL: reconfiguring must not + // stack duplicates. The readiness ladder reads model.base_url (above), + // not this list; the entry names the same endpoint for `custom:`. custom_providers: [{ name: 'Mock', base_url: 'http://127.0.0.1:9001/v1', key_env: 'OPENAI_API_KEY' }], auxiliary: { title_generation: { enabled: false } }, approvals: { mode: 'smart' }, display: { interim_assistant_messages: true }, }) diff --git a/tests-js/scripts/mock-provider-config.ts b/tests-js/scripts/mock-provider-config.ts index 45dcd24fba..ad95cfa5a0 100644 --- a/tests-js/scripts/mock-provider-config.ts +++ b/tests-js/scripts/mock-provider-config.ts @@ -44,15 +44,19 @@ export function writeMockProviderConfig( const display = section.parse(extraDisplayConfig ? yaml.load(extraDisplayConfig) ?? {} : {}) const merged = { ...config, - model: { ...config.model, default: 'mock-model', provider: 'custom', context_length: modelContextLength ?? 64000 }, - // Two shapes, one endpoint. `providers:` stays untouched (a provider named - // 'mock' only resolved on trees that had registered such a profile, so - // older refs died with "Unknown provider 'mock'"). A bare `custom` resolves - // from `custom_providers:` on every vintage -- v2026.8.31's desktop - // readiness check reports "No usable credentials found for custom ... - // runtime resolution still failed" without an entry here -- while the .env - // OPENAI_BASE_URL/OPENAI_API_KEY pair (writeEnvFile) is how trees that - // resolve the endpoint from the environment reach the same URL. + // The endpoint must live in config.yaml: runtime_provider's bare-`custom` + // trust path reads the CONFIG base_url, and v2026.8.31 says so outright -- + // "OPENAI_BASE_URL env var is no longer consulted -- config.yaml is the + // single source of truth for endpoint URLs". Without it `custom` resolves to + // no endpoint and the app boots on its onboarding overlay ("No usable + // credentials found for custom"), which is what every +desktop smoke leg + // hit. The `custom_providers` entry names the same endpoint for the + // named/`custom:` form; the .env OPENAI_BASE_URL/OPENAI_API_KEY pair + // (writeEnvFile) stays for the trees that resolve the endpoint from the + // environment. `providers:` stays untouched (a provider named 'mock' only + // resolved on trees that had registered such a profile, so older refs died + // with "Unknown provider 'mock'"). + model: { ...config.model, default: 'mock-model', provider: 'custom', base_url: `${url}/v1`, context_length: modelContextLength ?? 64000 }, providers: { ...config.providers }, custom_providers: [ ...(config.custom_providers ?? []).filter(entry => entry?.name !== MOCK_PROVIDER_NAME),