Skip to content

Latest commit

 

History

History
164 lines (118 loc) · 7.98 KB

File metadata and controls

164 lines (118 loc) · 7.98 KB

📋 All Releases English | 简体中文

Chats 1.7.0 Release Notes (Major Update)

Release date: 2025-09-20 (100+ commits since 1.6.9.30)

1.7.0 is a major upgrade centered around full MCP (Model Context Protocol) enablement and enhanced Tool Call experience, accompanied by a large-scale refactor of database and data model, drag-and-drop ordering for models/keys/presets, a new Markdown Mermaid renderer, image size controls, and numerous UX improvements and fixes across both backend and frontend.

Highlights

  • Full MCP support: end-to-end server/frontend integration, per-user authorization, tool discovery, in-chat usage, and permission validation
  • Enhanced Tool Calls: richer SSE events, new message content types for tool request/response, streaming UI
  • Data model & DB refactor (breaking): Message → ChatTurn/Step layering, migration script, default constraint cleanup
  • Model & key management revamp: accordion grouping and drag-and-drop ordering for Providers/Keys/Models with matching backend APIs and schema
  • Chat UX upgrades: per-message / whole-segment regeneration, System Prompt edit/render modes, auto-hide input while generating, richer statuses
  • Markdown Mermaid: better dark/light themes, fullscreen view, caching & debounce, streaming-friendly
  • Image generation sizes: common sizes added and configurable in chat
  • Stronger OpenAI compatibility: tool-call fixes (e.g., gpt-5/Qwen), improved Keycloak login compatibility, Google AI integration validated

What’s New

1) MCP (Model Context Protocol)

Backend entities & relations:

  • Tables: McpServer, McpTool, UserMcp, ChatConfigMcp
  • UserMcp strictly controls user access to MCP servers; creators are auto-assigned
  • Server labels: globally unique, colon : disallowed; headers must be empty or valid JSON object

Backend APIs (partial):

  • List/Management/Details: GET /api/mcp, GET /api/mcp/management, GET /api/mcp/{id}
  • Create/Update/Delete: POST /api/mcp, PUT /api/mcp/{id}, DELETE /api/mcp/{id}
  • Fetch tools: POST /api/mcp/fetch-tools (enumerates tools via SSE to remote MCP server)
  • User assignment: POST /api/mcp/{id}/assign-to-users, plus endpoints for unassigned/assigned users

Chat integration:

  • Each Chat Span can bind multiple MCPs (ChatConfigMcp)
  • Server validates user permission to all bound MCP servers (via UserMcp) before chat
  • Tool calls stream parameters & results into message content; UI renders them in real time

Frontend management:

  • New “MCP” tab in Settings: create/edit MCP servers, fetch tools, assign users, and gated editability

2) Tool Calls & Streaming Protocol

  • SSE kinds extended (SseResponseKind): CallingTool, ToolProgress, ToolCompleted, StartResponse, StartReasoning, ImageGenerated, etc.
  • Message content types: toolCall, toolResponse (frontend assembles streaming parameters and displays results)
  • Backend SSE output uses richer JSON polymorphism; frontend types updated accordingly

3) Database & Data Model Refactor (Breaking)

To improve maintainability and observability, the message storage layer has been refactored.

  • Schema & model changes:
    • MessageChatTurn
    • MessageContent*Step* (new Step table; StepContent references Step)
    • Chat.LeafMessageIdLeafTurnId
  • Usage relations:
    • UserModelUsage no longer references UserModel; now UserId + ModelId
    • UsageTransaction no longer references UserModel; now directly ModelId
    • Removed UserModel.IsDeleted
  • Archival & performance:
    • New ChatConfigArchived to store former HashCode, which is removed from ChatConfig
  • Ordering capabilities:
    • Add Order to ModelKey; make Model.Order NOT NULL
    • Add Order to ChatPreset
  • Default constraints cleanup: removed multiple defaults to avoid “implicit writes”; app layer controls explicitly
  • Migration script (SQL Server): src/scripts/db-migration/1.7/20250516-mcp.sql

Note: This section contains breaking changes. Back up your database and follow the upgrade guide strictly.

4) Model & Key Management

  • New management UI: accordion grouping for Providers/Keys
  • Drag-and-drop ordering via dnd-kit: Providers, Models, and ModelKeys
  • Backend reorder APIs and fields to persist fine-grained ordering
  • Support user-level model management, usage stats link, provider icons

5) Chat UX & Usability

  • Regeneration:
    • Single message: POST /api/chats/regenerate-assistant-message
    • Regenerate all assistant messages after a given user message: POST /api/chats/regenerate-all-assistant-message
  • System Prompt: new edit/render modes
  • Image size: 1024×1024, 1536×1024, 1024×1536 (KnownImageSize and ChatConfig.ImageSizeId)
  • Mermaid Markdown:
    • New MermaidBlock and fullscreen dialog with dark/light theming
    • Debounced rendering, SVG caching, graceful fallback to reduce flicker/failures
  • Other improvements:
    • Auto-hide ChatInput while generating
    • More icons, tooltips, disabled states, mobile page and multiple UI tweaks

6) OpenAI Compatibility & Third Parties

  • Continued improvements for OpenAI-compatible flows
  • Fixes for tool-calls with gpt-5/Qwen
  • Keycloak login compatibility improvements
  • Google AI integration validated

7) Governance & Permissions

  • MCP server labels must be unique and cannot contain :; headers must be empty or a JSON object
  • MCP servers aren’t auto-loaded; access fully controlled by UserMcp

8) Fixes & Misc

  • Multiple frontend build/runtime fixes, dependency upgrades, and console.log cleanup
  • Fixes for share page display, initial settings load/save, model reference loading, empty turns and edge cases
  • Polish on prompt/title behavior and microcopy
  • Scripts: new and combined restore scripts (e.g., restore-dev.local), updated dev.win.sql

Upgrade Guide (Read Carefully)

  1. Back up the database (strongly recommended)
  2. Run the migration script on SQL Server: src/scripts/db-migration/1.7/20250516-mcp.sql
  3. Rebuild and redeploy the backend; for frontend, consider removing src/FE/node_modules and reinstall/build due to dependency changes
  4. Login as admin, go to “Settings → MCP” to create/import MCP servers and assign users
  5. For ordering features, use the model management UI to drag/drop Provider/Model/Key/Presets

If you rely on the old DB defaults/shape in any external scripts/reports, please adapt them accordingly.


API Changes (Partial)

  • New chat regeneration:
    • POST /api/chats/regenerate-assistant-message
    • POST /api/chats/regenerate-all-assistant-message
  • New MCP management/assignment:
    • GET /api/mcp, GET /api/mcp/management, GET /api/mcp/{id}
    • POST /api/mcp, PUT /api/mcp/{id}, DELETE /api/mcp/{id}
    • POST /api/mcp/fetch-tools
    • POST /api/mcp/{id}/assign-to-users, GET /api/mcp/{id}/get-unassigned-users, GET /api/mcp/{id}/assigned-user-details, GET /api/mcp/{id}/assigned-user-names
  • SSE events: richer JSON polymorphism; frontend SseResponseKind and unions updated accordingly

Breaking Changes

  • Wide-ranging DB schema changes and renames; migration SQL is required
  • UserModelUsage/UsageTransaction no longer reference UserModel; removed UserModel.IsDeleted
  • Chat.LeafMessageIdLeafTurnId
  • Multiple default constraints removed; adjust external dependencies if any

Known Notes

  • Remote MCP tool enumeration depends on the peer service; initial fetch may take noticeable time when many tools exist
  • Some third-party model/tool-call edge cases may still require vendor-specific adjustments

Acknowledgements

  • Thanks to the community! Special thanks to PR #96 (by @xiehs211) for fixing the login page runtime error.

If you have any issues or suggestions for this release, please open an Issue or PR. Enjoy!