feat(llm-pi-ai): dormant bare mount — routes live entirely in the settings plane

An empty or omitted providers dict is now the valid dormant posture: the
adapter mounts with zero routes and no catalog entries, registers routes
the moment the llm-pi-ai settings section supplies profiles, and drops
them when it empties. The TUI demo mounts the adapter bare, so adding an
openai/anthropic provider is purely a settings.yaml (or, next PR, web
form) operation with per-request apiKeyEnv credential resolution.
This commit is contained in:
Yichen Jiang
2026-07-29 14:56:09 +08:00
parent 9336fed1e9
commit 4e9916b3e5
13 changed files with 76 additions and 36 deletions
+3 -1
View File
@@ -395,7 +395,9 @@ describe('provider profile lifecycle', () => {
})
it('validates empty, unknown, legacy-shaped, and explicitly blank profiles', () => {
expect(() => resolveProfiles({})).toThrow(/at least one/)
// Empty and omitted dicts are the dormant zero-route posture, not errors.
expect(resolveProfiles({}).size).toBe(0)
expect(resolveProfiles(undefined).size).toBe(0)
expect(() => resolveProfiles({ '': {} })).toThrow(/non-empty/)
expect(() => resolveProfiles({ 'not-real': {} })).toThrow(/unknown/)
// The pre-release array shape and its per-profile provider field fail