WeKnora/frontend/src/api
wizardchen a9d37970ae fix(initialization): fall back to stored apiKey when test-connecting an existing model
Direct regression from the previous credential subresource refactor: the
edit-mode ModelEditorDialog stopped binding apiKey into formData (the
field now lives in <CredentialResource>), so "Test connection" sent
apiKey="" and every upstream call (DeepSeek / lkeap / OpenAI etc.) 401'd.

Fix in the backend so the frontend stays simple:

- ModelTestRequest gains an optional ModelID field.
- New fillSecretsFromStoredModel helper: when ModelID is set AND a secret
  field on the request is empty, copy it from the stored (decrypted) model.
  Non-empty request values still win, so users typing a new key to verify
  it before saving behave the same as before.
- The four test entrypoints (chat / embedding / rerank / asr) call the
  helper right after ShouldBindJSON.

Frontend: ModelEditorDialog.testConnection forwards modelId when isEdit
is true. The four API client signatures accept the optional field.

WebSearch and MCP are unaffected: WebSearch already has a TestProviderByID
ID-based path, MCP has no standalone raw test endpoint.
2026-05-17 15:27:52 +08:00
..
agent feat(im): tenant-wide IM channels overview under the user menu 2026-04-30 15:29:14 +08:00
auth fix oidc auth login 2026-05-05 00:21:41 +08:00
chat feat(observability): log end-to-end TTFB on both ends of chat stream 2026-05-12 21:16:37 +08:00
chunker feat(frontend): chunking debug panel with live preview 2026-05-06 17:17:07 +08:00
datasource refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
initialization fix(initialization): fall back to stored apiKey when test-connecting an existing model 2026-05-17 15:27:52 +08:00
knowledge-base feat(knowledge-base): document list filters and explicit batch-management UX 2026-05-12 18:29:47 +08:00
model refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
organization feat(api): integrate per-organization resource counts into organization listing 2026-02-09 11:40:25 +08:00
skill feat: enhance agent skills sandbox configuration and availability 2026-02-04 20:58:24 +08:00
system feat(system-info): surface DB migration errors with troubleshooting links 2026-05-14 16:34:50 +08:00
tenant feat(tenant): expose API Key reset from the API Info page 2026-04-29 20:07:38 +08:00
wiki perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
chat-history.ts feat: implement chat history and retrieval settings 2026-03-09 11:46:56 +08:00
mcp-service.ts refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
retrieval.ts feat: implement chat history and retrieval settings 2026-03-09 11:46:56 +08:00
vector-store.ts feat: add VectorStore management UI settings page 2026-04-17 21:51:25 +08:00
web-search-provider.ts refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
web-search.ts feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00