Changeset 0.10.2 (#58)

This commit is contained in:
2026-02-24 20:29:08 +00:00
parent 13772ebd6c
commit 4061e4a145
20 changed files with 1223 additions and 41 deletions

View File

@@ -2,6 +2,61 @@
All notable changes to Chat Switchboard.
## [0.10.2] — 2026-02-24
### Added
- **Summarize & Continue** — User-triggered conversation compaction using the
utility model role. Button appears in context warning bar at ≥75% context
usage. `POST /channels/:id/summarize` calls the utility role to generate a
summary, inserts it as a tree node with `metadata.type = "summary"`, and
updates the cursor. Subsequent completions use the summary as a context
boundary — messages before it are replaced by the summary as a system message.
Multiple summaries stack. Fork-aware (summaries are tree nodes with their own
branch position). "Show full history" toggle reveals collapsed earlier messages.
- **BYOK Role Overrides** — Users with personal providers can override the org's
utility and embedding model roles. Resolution chain: personal → team → global.
New "Model Roles" tab in Settings (visible when BYOK is enabled). Stored in
`user.settings` JSONB under `model_roles` key, same shape as team overrides.
- **Utility Rate Limiting** — `utility_rate_limit` global setting (default: 20
calls/hour/user, 0 = unlimited). Org-funded utility calls check against
`usage_log` before executing. BYOK calls exempt (user pays their own way).
Returns 429 with clear message when exceeded.
- **Message metadata in path** — `PathMessage` now includes `metadata` JSONB
field, enabling summary detection and future message-type extensibility.
- **Per-chat model/preset restore** — Switching between chats now restores the
last-used model or preset in the selector. Stored in localStorage keyed by
channel ID. Falls back to the channel's base model, then the global default,
if the original selection is no longer available. Cleaned up on chat deletion.
### Changed
- **Generation role removed** — `RoleGeneration` ("generation") removed from
`ValidRoles` and admin Roles tab. Image/media generation will be
extension-managed (v0.11.0) with its own provider config, not a role slot.
The current completion/embedding abstraction doesn't fit image gen's
fundamentally different API surface.
- **Resolver.Complete/Embed signatures** — Now accept `userID` parameter for
personal role override resolution. Empty string skips personal lookup.
- **Proactive token refresh** — Access token is now refreshed at 80% of its
lifetime (~12min for 15min tokens). On page reload, a conservative 60s refresh
is scheduled since token age is unknown. Eliminates the race condition where
profile succeeds on a near-expired token but subsequent calls fail.
- **Auth guard in `startApp()`** — If token is invalidated during startup
(e.g., 401 on loadChats after profile succeeded), app returns to login
instead of rendering a broken UI with cascading 401 errors.
- **Per-chat model restore fallback** — When the stored model/preset is removed,
falls back to admin default → first visible model (was keeping stale selection).
Also cleans up the stale localStorage entry.
- **BYOK Role Overrides** — Fixed response parsing (`configs.configs` not
`configs.data`) and model field mapping (`configId`/`baseModelId` not
`provider_config_id`/`model_id`).
- **`GetRole` endpoint integration test** — `GET /admin/roles/:role` now
exercised by CI via `TestIntegration_Roles_GetSingleRole`, catching the
`GetConfig` signature mismatch that caused the build failure.
- **Auth resilience frontend tests** — 10 tests covering startup auth guard,
token refresh lifecycle, and the profile-success-then-401 edge case.
- **JS syntax lint in CI** — `node --check` runs on all `src/js/*.js` files
before frontend tests, catching parse errors that tests alone can't detect.
## [0.10.1] — 2026-02-24
### Added