WeKnora/internal/container
lyingbug 967ed09706
feat(models): add system admin model catalog console (#3662)
* feat(models): add system admin model catalog console

System administrators can now maintain the model catalog from
Settings → System administration → Model catalog instead of editing
models.json on every replica. Administrator changes are stored as a
versioned overlay in the database (new model_catalog_config table),
layered between the deployment file and explicit per-model settings,
and synchronised to other instances within about 5 seconds.

Backend
- GET/POST preview/PUT /system/admin/model-catalog with optimistic
  version + deployment baseline checks (409 on conflict), 20-version
  history and audit logging.
- Console overlays reject credentials, headers, env interpolation and
  non-inline icons; those stay deployment-owned.
- Catalog views include each chat model's resolved thinking levels and
  the vendor defaults, so the console never re-implements level
  inheritance.

Frontend
- Model list in the shared data-table style with provider/type filters,
  "modified only" filter and source tags (built-in / deployment / admin).
- Edit drawer saves and applies immediately: display name, context
  window, max output, input modalities, reasoning, thinking levels,
  embedding dimension and picker visibility, each with its inherited
  default and a layer comparison table.
- Add-model drawer, JSON editor with server-side change check before
  publishing, and version history with one-step restore.
- Model settings gets a system-admin shortcut to the catalog; model
  editor reloads providers when opened so published catalogs apply.

* fix(models): harden the admin model catalog console

- Reject console base_url, base_urls, url_patterns and auth: moving a
  vendor's default URL would send its deployment api_key (and keys of rows
  without their own base URL) to another host. With every interpolated
  field now deployment-owned, '$' in names and descriptions is plain text.
- Drop deployment base URLs from catalog views; they may carry
  interpolated tokens.
- Remember a stored version this replica cannot compile and skip it until
  the version changes, instead of re-reading and recompiling every poll.
- Resolve vendor default thinking levels with reasoning forced on, like
  per-model levels.
- Compute builtin/deployment views once; preview returns only the
  candidate catalog and normalized overlay.
- Share deployment file lookup via runtime.ReadDeploymentOverlay.
- The model editor force-refreshes its own type instead of resetting the
  provider store for every type; the refreshed list wins in the id index.
2026-09-24 16:31:45 +08:00
..
audit_sink.go feat(retriever): activate OpenSearch k-NN driver (PR 3 of 3) 2026-05-29 16:32:27 +08:00
audit_sink_test.go feat(retriever): activate OpenSearch k-NN driver (PR 3 of 3) 2026-05-29 16:32:27 +08:00
cleanup.go init commit 2025-08-05 15:08:07 +08:00
container.go feat(models): add system admin model catalog console (#3662) 2026-09-24 16:31:45 +08:00
datasource_registry_test.go feat(datasource): add DingTalk Docs integration with safe sync and localization (#2313) 2026-09-14 19:53:29 +08:00
engine_factory.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
engine_factory_opensearch_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
engine_factory_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
host_project_lookup.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
host_project_lookup_test.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
nolocalsandbox_test.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
recover_pending_wiki_tasks.go fix(tenant): stop wiki tasks of soft-deleted tenants from issuing model requests (#3602) 2026-09-23 12:13:32 +08:00
reset_pending_tasks.go fix(knowledge): recover tasks safely after server restart 2026-07-14 17:55:26 +08:00
reset_pending_tasks_test.go fix(tenant): stop wiki tasks of soft-deleted tenants from issuing model requests (#3602) 2026-09-23 12:13:32 +08:00
retrieve_registry_wiring_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
router_wiring_test.go fix(container): wire shared agent lookup for MCP handler 2026-09-21 14:38:54 +08:00
sandbox.go feat(session): fork conversations from a historical user message (#3304) 2026-09-17 14:20:18 +08:00
sandbox_host.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
sandbox_host_shared.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
sandbox_host_stub.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
sandbox_host_test.go feat(sandbox): run unpinned Lite sessions on the host OS sandbox (#3549) 2026-09-22 19:35:03 +08:00
sandbox_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
ssrf_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
storagebackend_migration_test.go feat(knowledge): derive knowledge base descriptions from document profiles (#3370) 2026-09-17 22:21:55 +08:00
vector_store_whitelist_only_test.go feat(security): add a whitelist-only outbound mode that refuses before DNS (#3393) 2026-09-23 12:02:06 +08:00