Merge remote-tracking branch 'origin/master' into claude/unified-environment-credentials-c8841a

# Conflicts:
#	docs/config-catalog.md
#	packages/llm/llm-pi-ai/src/config.ts
#	packages/llm/llm-pi-ai/src/index.ts
#	packages/llm/llm-pi-ai/tests/sdk-options.spec.ts
This commit is contained in:
Yichen Jiang
2026-08-06 16:52:19 +08:00
157 changed files with 8735 additions and 942 deletions
@@ -155,13 +155,16 @@ describe('request-level dynamic profiles', () => {
expect(ctx.llm.listProviders().map(provider => provider.id)).toEqual(['openai'])
})
it('keeps the last good profiles when a settings snapshot names an unknown provider', async () => {
it('refuses a settings write this adapter could not serve, leaving its routes alone', async () => {
const dir = await home()
const ctx = await boot(dir, { providers: { openai: {} } })
// Schema-valid but catalog-invalid: the resolver rejects it and the
// last good route set keeps serving.
await ctx.settings.update(NS, { providers: { 'not-a-real-provider': {} } })
// Shape-valid but unserviceable: a route the catalog does not ship and
// that lists no models of its own. The section schema resolves the whole
// profile set, so this is refused where it is written rather than stored
// and then quietly disabling every route in the namespace.
await expect(ctx.settings.update(NS, { providers: { 'not-a-real-provider': {} } }))
.rejects.toThrow(/resolves no models/)
expect(ctx.llm.listProviders().map(provider => provider.id)).toEqual(['openai'])
})