Commit 4b12648
1.11.0 (#131)
* chore(deps): update package references to latest versions
* fix: respect total_tokens for Azure AI Foundry Grok usage
Use total_tokens - prompt_tokens as the authoritative output token count
when parsing OpenAI-compatible usage payloads, since Grok streaming chunks
on Azure AI Foundry report completion_tokens without reasoning tokens.
Add a regression test for the final SSE usage segment.
* fix(chat): align file upload behavior with vision and agent capabilities
Show the upload button only when the chat supports vision or has code execution enabled, allow mobile device uploads of any file when agent mode is enabled, keep camera uploads image-only for vision models, and filter remote files to match the same capability rules.
* fix: Invalid 'max_output_tokens': integer below minimum value. Expected a value >= 16, but got 1 instead.
* fix: ensure 'max_output_tokens' is set to minimum value of 16 if below threshold
* delete patch_file & read_file tool since it's not friendly to LLM and easily replacable by run_command
* build(code-interpreter): add python alias, python-docx support, and refresh playwright versions
* fix: preserve Anthropic usage fields across partial stream deltas
Keep previously reported input and cache token counts when message_delta only includes output_tokens.
Add regression tests for DeepSeek Anthropic streaming usage inheritance.
* fix: preserve tool response images across chat services
Keep tool-role multimodal outputs attached to their corresponding tool responses
during provider-specific request serialization. Split grouped tool responses when
needed for OpenAI-compatible payloads, preserve multimodal tool outputs for
Responses API, Anthropic, and Gemini, and add regression tests covering image
artifacts returned from tool calls.
* fix: preserve tool outputs and normalize provider-specific payloads
Keep tool response images attached to their corresponding tool results across
OpenAI, Responses API, Anthropic, and Google AI request serialization. Normalize
empty tool-call arguments to {} for providers that expect JSON object payloads,
and collapse DeepSeek tool message text arrays into a single string to satisfy
its chat completion API requirements. Add regression tests covering multimodal
tool outputs, empty tool arguments, and DeepSeek-specific tool serialization.
* fix: normalize Gemini tool schemas and usage accounting
convert OpenAI-style function parameter schemas into Gemini-compatible schemas, including nullable unions, nested properties, arrays, enums, and basic validation constraints
expose GoogleAI usage parsing for tests, honor cachedContentTokenCount, and derive output tokens from candidate and thought usage fields
send tool responses as structured result/success payloads and add regression coverage for nullable schemas and cached tokens
skip empty and SVG images when extracting image info
* Fix code interpreter workdir path resolution
Anchor relative container paths to the configured work directory while leaving absolute paths unchanged. Reuse the same resolution logic in download_chat_files and add regression tests for relative and absolute write_file paths plus configured workdir downloads.
* Add view_image tool and rewrite multimodal message filtering
- add Code Interpreter view_image to fetch session images, validate them, and attach them as artifacts
- only expose view_image for vision-capable models
- rewrite vision preprocessing to operate on the full message list instead of single messages
- only feed user images and view_image tool attachments back into vision models
- drop links and non-view_image artifacts from model input while preserving tool response history
- resolve view_image tool responses by toolCallId against prior assistant tool calls
- rename FilterVision to RewriteVisionMessages to reflect message-list rewriting semantics
- update image generation override and inject FileImageInfoService into executor tests
- add unit tests for view_image behavior and vision message rewriting
* fix(be): resolve vulnerable NuGet dependency and nullable build warning
override Microsoft.Bcl.Memory to a patched version
remove the CS8600 nullable warning in CodeInterpreterExecutor
restore clean backend build without vulnerability warnings
* fix mobile user message bubbles to shrink for short text and keep padding for wrapped content
* fix(chat): make mobile user message bubbles shrink to content naturally
* refactor: centralize and optimize client info id resolution
- remove AsyncClientInfoManager and route callers through ClientInfoManager
- cache ClientInfoId per request scope and resolve it from an isolated db scope
- replace ClientInfo entity flow with ClientInfoId across controllers and rate limiting
- optimize client info lookup for id-only access and update affected tests
* big refactor(be): introduce ChatRunService and move retry/billing out of controllers
add scoped ChatRunService orchestration for paid generation runs
move 429 retry logic into service layer (preserve pre-first-yield retry semantics)
centralize usage persistence, balance/usage updates, and transaction creation in ChatRunService
simplify ChatRunRequest by deriving user and API context from UserModel/ChatRequest.Source
switch WebChat + OpenAI/Anthropic/Image API controllers to consume ChatRunService
link Step/UserApiUsage via UsageId instead of constructing usage in controllers
remove obsolete InChatContext and shared multi-scope UserModelBalanceCalculator
keep non-paid utility flows (count tokens/list models/validate model) outside the new run layer
add minimal fallback in TurnDto model metadata resolution (Usage.Model -> ChatConfig.Model) to prevent navigation-missing errors
* refactor(db): remove TransactionType lookup table and related EF mappings
* refactor(db): remove db context TransactionType class
* refactor: update transaction types to use descriptive enum values
* refactor: persist usage source on UserModelUsage and align source filtering
add and backfill UserModelUsage.SourceId in 1.10.3 migration
write/copy SourceId on usage creation paths and filter/stat usages by SourceId
align frontend UsageSource names with backend and expose Summary in source selectors
* feat(db): add UserConfig table for user-specific string configurations
* feat: add first-turn AI title summary with billing, settings, and admin config APIs
- generate and stream chat titles in parallel with the first web chat turn
- add title summary billing/config resolution services and user config endpoints
- support admin and user title summary settings with backend-provided default template
- default title summary mode to truncate and hide prompt template in truncate mode
- split admin global config loading into per-key APIs and remove shared config state helper
- add unit tests for title summary config resolution
* perf(frontend): lazy-load markdown rendering, KaTeX assets, charts, and session UI to cut initial payloads
- move chat markdown rendering onto light vs rich on-demand paths
- lazy-load Mermaid, code highlighting, tool-call blocks, and thinking message rendering
- remove global KaTeX CSS import and load KaTeX CSS/fonts on demand from static assets
- lazy-load admin dashboard charts and sandbox session manager UI
- switch production build to webpack after bundle comparison showed smaller output
Measured results:
- build output:
- /: 811 KB gzip -> 233 KB gzip
- /home: 811 KB gzip -> 233 KB gzip
- /message/[id]: 736 KB gzip -> 183 KB gzip
- /share/[id]: 735 KB gzip -> 184 KB gzip
- /admin/dashboard: 306 KB gzip -> 128 KB gzip
- browser DevTools experiments:
- empty chat: 3339 KB -> 1478 KB
- markdown chat: 3339 KB -> 2263 KB
- mermaid chart: 3468 KB -> 2947 KB
- katex formula: 3381 KB -> 1840 KB
- all features combined: 3518 KB -> 3318 KB
* perf(markdown): render code blocks as plain monospace text before syntax highlighter loads
* chore: upgrade actions/checkout from v4 to v5 in build workflows to supress node20 expire
* chore: upgrade actions/upload-artifact and actions/download-artifact to v7 and v8 respectively
* chore: update package references to latest versions across multiple projects
* feat(fe): add resizable desktop chat sidebar with persisted width sync
* feat(db): update project version to 1.11.0 and rename migration script for database changes
* Merge pull request #124 from Alex-wuhu/novita-integration
Add Novita AI provider
* Handle Notiva.ai null usage detail objects in OpenAI-compatible streaming responses
- guard `completion_tokens_details` and `prompt_tokens` parsing by `JsonValueKind`
- prevent Novita `usage-only` SSE chunks with `null` detail fields from crashing
- add a regression test for Novita streaming usage parsing
* feat(admin): unify paginated tables on request-trace style and upgrade users management table
- introduce shared `UnifiedTable` shell under `components/table` and migrate paginated admin/usage pages to it
- standardize table UX across target pages: filter card + refresh button placement, icon action area, column selector, compact row height, and fixed `pageSize=20`
- keep mobile card layout while unifying desktop table behavior and URL state (`page`, `columns`, per-page filters)
- refactor usage/security-logs/messages/request-trace pages to reuse the shared table stack and aligned pagination/query handling
- migrate `/admin/users` into unified table:
- add `User Id` column and split login method into standalone `Login Type` column
- add structured filters (`id`, `username`, `phone`, `email`, `loginType`) with URL sync
- default-hide `Account` and `Login Type` columns (toggleable via column selector)
- keep add/edit/recharge/model-count interactions and icon action order (export -> add user -> columns)
- extend users export/list API contracts on FE (`GetUsersParams`, `GetUsersExportParams`) and add dedicated permission-query type to avoid cross-usage conflicts
- extend BE users endpoints:
- replace single `query` with structured query DTO for list/export
- implement exact `id` filter, fuzzy username/phone/email filters, and login-type filter (`password`/`phone`/`keycloak`)
- support column-ordered Excel export including optional `Login Type`
* feat(unitified-table): implement debounce to all tables text input criterias
* feat(unified-table): refactor admin user-model also using same unified-table
* fix(novita.svg): update fill color for dark mode to #23D57C
* fix(fe): prevent collapsed chat sidebar content from leaking in mobile and desktop views
* fix(frontend): prevent lazy-loaded markdown components from flickering during streaming caused by f0cec5f
* 增加模型定价页面 (#126)
* feat(model-prices): 添加模型定价页面
- 新增模型定价页面,展示各模型的价格信息
- 从后端获取可用模型,并按提供者分组
- 支持选择不同提供者以查看对应模型的价格
- 显示输入价格、缓存输入价格和输出价格
- 处理加载状态和无模型可用的情况
* feat(model-prices): 添加模型搜索功能和无模型提示
- 在模型定价页面中添加搜索框,允许用户根据模型名称进行搜索。
- 当没有找到匹配的模型时,显示“未找到匹配的模型”提示。
- 通过使用 useMemo 优化搜索逻辑,确保在输入搜索查询时性能良好。
- 允许用户选择“全部”按钮以查看所有模型,并重置搜索查询。
* feat(model-prices): 添加仅显示免费模型的过滤功能
- 新增状态管理以控制是否仅显示免费模型
- 在模型过滤逻辑中添加条件,当选择仅显示免费模型时,过滤出价格为零的模型
- 更新搜索框以支持新的过滤选项,提升用户体验
* refactor(i18n): replace legacy pricing translation keys with new model price labels
* refactor(fe): migrate model prices page to shared UI components
- replace custom buttons, input, cards, and table markup with built-in UI components
- reuse shared provider icon rendering for the sidebar
- keep existing filtering and pricing behavior unchanged
* chore: remove pnpm lockfile and clean up build doc references
* chore: update dependencies for Next.js, React, and TypeScript
- upgraded Next.js from 16.1.6 to 16.2.2
- upgraded React and ReactDOM from 19.2.1 to 19.2.4
- upgraded eslint-config-next from 16.1.6 to 16.2.2
- upgraded TypeScript from 5.9.3 to 6.0.2
* Refine model prices page responsive UX, add API type filters, and clarify pricing/context display
* Polish model prices page layout, filtering, and scroll behavior across desktop and mobile
* refactor: replace 'custom-scrollbar' with 'scroller' for consistent styling across components
* refactor: extract getCopyableMessageText function for support copy text/error, fix #127
* fix(docs): update WeChat group QR code in README files
* feat: update README and model provider documentation for version 1.11.0, add Novita AI support and enhance pricing transparency
---------
Co-authored-by: Alex <yanglongwei06@gmail.com>
Co-authored-by: DealiAxy <deali@live.com>199 files changed
Lines changed: 10895 additions & 17371 deletions
File tree
- .github/workflows
- code-interpreter
- AzureFileMigrator
- doc
- en-US
- release-notes
- zh-CN
- release-notes
- src
- BE
- db
- Enums
- docker
- tests
- Chats.BE.ApiTest
- Chats.BE.UnitTest
- ChatServices
- Anthropic
- ChatCompletions
- GoogleAI
- Response
- CodeInterpreter
- Services
- Security
- TitleSummary
- web
- Controllers
- Admin
- AdminModels
- Dtos
- AdminUser
- Dtos
- GlobalConfigs
- Dtos
- Statistics
- UserBalances
- Api
- AnthropicCompatible
- OpenAICompatible
- Chats
- Chats
- Dtos
- Files
- Messages
- Dtos
- UserConfigs
- Dtos
- Public/AccountLogin
- Users/Usages
- Dtos
- DB
- Init
- Jsons
- Services
- CodeInterpreter
- Configs
- FileServices
- Models
- ChatServices
- Anthropic
- GoogleAI
- OpenAI
- Special
- Neutral
- Security
- TitleSummary
- FE
- actions
- apis
- components
- Button
- ChatMessage
- ChatModelDropdownMenu
- Chatbar
- Chat
- Home
- Markdown
- Popover
- Sidebar
- UserMenuPopover
- admin
- ModelKeys
- Models
- Users
- global-configs
- request-trace
- security-logs
- user-models
- common
- settings/tabs
- table
- ui
- usage
- contexts
- locales
- pages
- admin
- dashboard
- global-configs
- messages
- request-trace
- usage
- user-models
- users
- build/usage
- model-prices
- settings
- public
- logos
- vendor/katex
- fonts
- reducers
- types
- utils
- scripts/db-migration/1.11
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | | - | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 177 | | |
181 | 178 | | |
182 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments