Changeset 0.17.0 (#75)

This commit is contained in:
2026-02-27 16:25:39 +00:00
parent 8bb77710b9
commit c9141a6896
37 changed files with 2778 additions and 968 deletions

View File

@@ -2,6 +2,61 @@
All notable changes to Chat Switchboard.
## [0.17.0] — 2026-02-27
### Added
- **Persona-KB binding.** Personas can now have knowledge bases directly
bound to them. When a user selects a persona with bound KBs, the
`kb_search` tool is automatically scoped to those KBs and the persona's
system prompt includes a KB listing hint. Admin and team admin preset
forms include a KB picker with per-KB auto-search toggles.
Migration adds `persona_knowledge_bases` join table.
- **Enterprise KB mode.** New `discoverable` flag on knowledge bases
controls whether users can see and attach KBs directly. When
`kb_direct_access` platform policy is set to `true`, users cannot
attach KBs to channels directly — they access KBs exclusively through
persona bindings curated by admins. New `ListDiscoverableKBs` and
`SetDiscoverable` endpoints.
- **Role fallback alerts (issue #69).** When a role's primary provider
fails and the fallback activates, the resolver emits a `role.fallback`
event on the EventBus with audit log entry. Admin users see a persistent
dismissable banner. 5-minute per-role cooldown prevents flooding.
- **Chat rename.** Double-click any chat title in the sidebar to edit
inline. Enter saves, Escape cancels.
- **Utility model auto-naming.** After the first assistant response,
a background request to the utility role generates a concise title.
Falls back to truncation when no utility model is configured.
New endpoint: `POST /channels/:id/generate-title`.
- **Chat token count.** Conversation token estimate shown in the model
bar, color-coded against context budget.
- **State restore on refresh.** Active chat ID persisted to
`sessionStorage`, auto-restored on page reload.
### Fixed
- **ResolvePreset group access bypass.** `ResolvePreset()` used raw SQL
that skipped `resource_grants` checks from v0.16.0. Now uses
`PersonaStore.UserCanAccess()`.
- **KB create scope authorization.** Now enforces admin role for global
KBs and team admin role for team KBs.
- **Completion handler persona ID scoping.** `personaID` variable scoped
inside an `if` block but referenced downstream. Fixed by threading
through function signatures.
- **Nil slice JSON marshaling.** `ListDiscoverableKBs` returns `[]`
instead of `null` when no KBs match.
### Changed
- `UpdateDocumentStorageKey` moved from raw `ExecContext` to store method.
- EventBus route table: `role.fallback``DirToClient`.
- Resolver gains `.WithBus(bus)` builder (nil-safe, backwards compatible).
- Service worker: `/extensions/` excluded from fetch handler.
- Mermaid renderer v2.0 (pan/zoom, export) promoted to builtin.
- Removed DIAG diagnostics from `TestGroupBasedPersonaAccess`.
- Paste-to-file threshold synced from backend `PublicSettings`
(`storage.paste_to_file_chars`, admin-configurable, default 2000).
Resolves hardcoded constant in `attachments.js`.
- Embedding dropdown already had tolerant type filter, manual model ID
fallback, and auto-switch on empty — confirmed complete, checkbox updated.
## [0.12.0] — 2026-02-25
### Added