docs(assistant): record provider settings rollout and UI verification

This commit is contained in:
abaishu0730 committed 2026-10-28 11:00:00 +08:00
1 parent 528120a088
commit 1747361a1d
8 files changed
+74 -23

No files matched your search

@@ -26,7 +26,7 @@
**Interfaces:** `new ProviderRegistry(store)`, methods `list()`, `save(input)`, `chooseDefault(input)`, `remove(id,input)`, `resolve(selection?)`, `syncLegacy(settings)`, `discover(id,{version,signal}={})`. `list()` returns `{version,providers,defaultSelection,catalog}`; providers expose `{id,version,name,preset,protocol,apiBase,enabled,hasApiKey,models:[{id,name,contextWindow?,maxTokens?}]}`. `resolve` returns private config `{providerId,providerName,providerVersion,preset,protocol,apiBase,apiKey,model,modelName,contextWindow,maxTokens}`. Fixed legacy provider ID is `deepseek`.
- [ ] Write tests proving migration from old DeepSeek configuration retains secret/default; multiple providers stay isolated/encrypted; address/protocol changes require a new key; version conflicts/disabled/missing models fail. Run red before implementation.
- [x] Write tests proving migration from old DeepSeek configuration retains secret/default; multiple providers stay isolated/encrypted; address/protocol changes require a new key; version conflicts/disabled/missing models fail. Run red before implementation.
```js
const registry=new ProviderRegistry(store);
@@ -35,9 +35,9 @@ assert.equal(registry.resolve().model,'legacy');
assert.equal(registry.list().providers[0].apiKey,undefined);
```
- [ ] Implement encrypted provider records and independently versioned defaults. Limit30 providers/100 models, validate names/IDs/endpoints/model bounds; save id absent creates stable ID, new version0 and stale existing version reject. Blank key preserves existing, no source/environment key discovery.
- [ ] Reuse installed native catalogue metadata where possible; expose DeepSeek/OpenAI/Anthropic/custom presets. Explicit `discover` lists models with a bounded GET using only that provider's key; unsupported response fails without saving.
- [ ] Adapt `profilePatch`/environment to selected route: legacy DeepSeek remains byte-compatible in behavior, other protocols mount only native `dsh-llm-pi-ai` with the chosen explicit route/model and fixed private credential reference. No tools or additional ambient credentials. Honor timeout/output limits.
- [x] Implement encrypted provider records and independently versioned defaults. Limit30 providers/100 models, validate names/IDs/endpoints/model bounds; save id absent creates stable ID, new version0 and stale existing version reject. Blank key preserves existing, no source/environment key discovery.
- [x] Reuse installed native catalogue metadata where possible; expose DeepSeek/OpenAI/Anthropic/custom presets. Explicit `discover` lists models with a bounded GET using only that provider's key; unsupported response fails without saving.
- [x] Adapt `profilePatch`/environment to selected route: legacy DeepSeek remains byte-compatible in behavior, other protocols mount only native `dsh-llm-pi-ai` with the chosen explicit route/model and fixed private credential reference. No tools or additional ambient credentials. Honor timeout/output limits.
```js
const profile=profilePatch({...config,protocol:'openai-responses',providerId:'fixture'});
@@ -45,7 +45,7 @@ assert.match(profile,/dsh-llm-pi-ai/);
assert.doesNotMatch(profile,/TEST_KEY/);
```
- [ ] Test actual fixed official DSH against local fake Messages, Chat Completions and Responses endpoints, ensure zero native tools, correct route, credentials and cancellation cleanup. Run previous dsh-runtime/dsh-events tests and commit owned paths only.
- [x] Test actual fixed official DSH against local fake Messages, Chat Completions and Responses endpoints, ensure zero native tools, correct route, credentials and cancellation cleanup. Run previous dsh-runtime/dsh-events tests and commit owned paths only.
## Task 2: Conversation lifecycle, settings and routing integration
@@ -53,7 +53,7 @@ assert.doesNotMatch(profile,/TEST_KEY/);
**Interfaces:** store.providers is ProviderRegistry; service.resolve per-conversation or default selection before each new run; existing settings API fields remain compatible. Conversation model choice endpoint updates encrypted metadata with version. Store methods `trash`, `restoreDeleted`, `purge` implement deleted scope; `usage()` reads durable ledger.
- [ ] Write failing tests for deleted filtering/restoration, owner/version/busy guards, quota retained after purge, continued child usable after parent deletion, and model selection pinned to a running turn.
- [x] Write failing tests for deleted filtering/restoration, owner/version/busy guards, quota retained after purge, continued child usable after parent deletion, and model selection pinned to a running turn.
```js
const c=store.create('owner'),turn=store.beginTurn(c.id,'owner','fixture');
@@ -64,20 +64,24 @@ store.purge(c.id,'owner',{version:deleted.version,confirm:'delete'});
assert.equal(store.usage().calls,used);
```
- [ ] Add deleted_at and call ledger migration. Exclude deleted rows from active/search/send/actions; explicit deleted scope permits read-only history. Inherit three successful turns into child metadata before parent removal. Delete events/requests/turns atomically on purge, independent audit/ledger survive.
- [ ] Integrate registry in store; legacy saveFields sync only explicit legacy writes. New runtime settings omit old endpoint/key fields. Enabling checks selected usable config, preserving old tests and stored settings.
- [ ] Integrate provider/default/model endpoints with same-origin, admin/owner, secure credential transport, version and running provider-delete guards. Pin private provider config to each run and persist only public per-turn selection metadata.
- [ ] Update SSE/polling with conversation_removed terminal control, no authentication logout on deleted conversation. Update backup payload AAD mapping for config/providers/defaults/events/requests and verify backup/restore roundtrip.
- [ ] Run focused HTTP, lifecycle, old assistant and backup tests. Commit only task paths after Task1 implementation agent has committed.
- [x] Add deleted_at and call ledger migration. Exclude deleted rows from active/search/send/actions; explicit deleted scope permits read-only history. Inherit three successful turns into child metadata before parent removal. Delete events/requests/turns atomically on purge, independent audit/ledger survive.
- [x] Integrate registry in store; legacy saveFields sync only explicit legacy writes. New runtime settings omit old endpoint/key fields. Enabling checks selected usable config, preserving old tests and stored settings.
- [x] Integrate provider/default/model endpoints with same-origin, admin/owner, secure credential transport, version and running provider-delete guards. Pin private provider config to each run and persist only public per-turn selection metadata.
- [x] Update SSE/polling with conversation_removed terminal control, no authentication logout on deleted conversation. Update backup payload AAD mapping for config/providers/defaults/events/requests and verify backup/restore roundtrip.
- [x] Run focused HTTP, lifecycle, old assistant and backup tests. Commit only task paths after Task1 implementation agent has committed.
## Task 3: Settings/model menu, row actions and return controls
**Files:** Create `web/modules/assistant/providers.js`, `model-picker.js`; modify assistant `view.js`, `layout.js`, `workspace.css`, `commands.js`, `events-client.js`, `web/app.js`, assets/index, user guide; add browser tests `providers-ui.test.cjs`, `conversation-trash-ui.test.cjs`.
- [ ] Add failing UI tests: add/edit supplier via actual assistant-settings route; models fetched into draft then saved; default and composer selection consistent; trash/archive visible from row menus; recover/purge confirmation; return controls44px high and target tools on desktop/mobile.
- [ ] Build supplier rows/one expanded editor, protocol presets, write-only key input, editable model rows, explicit model discovery, default model chooser. Keep runtime/permissions in a separate existing settings form and honor dirty draft guards.
- [ ] Add grouped searchable picker and `/model`, showing unavailable selection honestly. Selecting updates conversation version; the next request uses it while a running turn retains the previous choice. No key reaches browser pickers.
- [ ] Add `⋯` row actions and deleted scope; owner-confirmation dialog for permanent deletion; stop and discard event subscriptions when current conversation is deleted elsewhere. Preserve existing draft/search/scroll and archive/continue behavior.
- [ ] Emphasize return button with text/arrow,44px height and110px minimum width, `#tools`; adapt tools subpage breadcrumb consistently and verify narrow screens.
- [ ] Run new+old UI, assistant suite and isolated fresh `npm test`; perform independent final review and fix important findings. Preserve known full-suite baseline limitations from prior verification, avoid unrelated fixes.
- [ ] Update guide/design/verification, commit and push dsh. Stop local test copy, verified backup, deploy tracked files, retain config/dependencies, restart healthy and open both settings/assistant for visual review; no actual credential setup or real model calls.
- [x] Add failing UI tests: add/edit supplier via actual assistant-settings route; models fetched into draft then saved; default and composer selection consistent; trash/archive visible from row menus; recover/purge confirmation; return controls44px high and target tools on desktop/mobile.
- [x] Build supplier rows/one expanded editor, protocol presets, write-only key input, editable model rows, explicit model discovery, default model chooser. Keep runtime/permissions in a separate existing settings form and honor dirty draft guards.
- [x] Add grouped searchable picker and `/model`, showing unavailable selection honestly. Selecting updates conversation version; the next request uses it while a running turn retains the previous choice. No key reaches browser pickers.
- [x] Add `⋯` row actions and deleted scope; owner-confirmation dialog for permanent deletion; stop and discard event subscriptions when current conversation is deleted elsewhere. Preserve existing draft/search/scroll and archive/continue behavior.
- [x] Emphasize return button with text/arrow,44px height and110px minimum width, `#tools`; adapt tools subpage breadcrumb consistently and verify narrow screens.
- [x] Run new+old UI, assistant suite and isolated fresh `npm test`; perform independent final review and fix important findings. Preserve known full-suite baseline limitations from prior verification, avoid unrelated fixes.
- [x] Update guide/design/verification, commit and push dsh. Stop local test copy, verified backup, deploy tracked files, retain config/dependencies, restart healthy and open both settings/assistant for visual review; no actual credential setup or real model calls.
## Execution outcome
功能已实施并更新本机测试副本;官方协议专项28/28、新增集中专项24/24、备份回归16/16通过,业务回归376/377且波动项单独复验通过。详细范围和限制见[验证记录](../../dsh-providers-verification-2026-10-28.md)。没有启用真实模型或修改业务发送规则。