Repository navigation
perf: Store prompt media on disk and reduce memory usage - #290
Merged
Mag1cFall merged 2 commits intoNov 22, 2026
Merged
Conversation
- 修复媒体去重表待保存保护、MIME 参数保留、句柄占用磁盘回收与 JSON 转义引用解析 - 保留媒体响应的 no-store 缓存头并按时间间隔回收运行期未关联孤儿媒体 - 拆分附件媒体存储模块消除循环依赖,落盘优先读服务端副本并统一上传生成与分支内联媒体 - 修复切换对话与取消读取时的运行态、token 统计、OpenAI 图片历史读取及队列删除竞态
Owner
|
Thanks for contributing! |
Mag1cFall
added a commit
that referenced
this pull request
Nov 25, 2026
perf: Store prompt media on disk and reduce memory usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
runtime/prompt-media/viaPOST /api/prompts/media, serve them with HTTPRangesupport onGET /api/prompts/media/{id}, and track media references and orphan reclamation inprompts.db(mediaandprompt_mediatables)mediaIdreferences for uploaded and generated Playground attachments, load previews, PDF thumbnails, and text excerpts directly from the media endpoint, hydrate non-Drive attachment payloads on demand for requests and token counts, and renew expired Drive video uploads sequentially; temporary chats keep localBlobreferences and persist them to the media store on save or branchObject URLs and in-flight token count requests on chat switch, delete, rerun, or compare pane close, and revokeObject URLs whenVideoResultdownloads are abortedContentLength, release raw Base64 strings after decodinginlineData, bound concurrent inline Drive uploads, and clear themp4Durationmoovbuffer once parsedVerification
go vet ./...go test -mod=readonly ./cmd/... ./internal/...cd web && npm run typecheck && npm run lint && npm run format:check && npm run buildabout:memory) and Windows Task Manager: frontend memory delta dropped from +1.31 GB to +72 MB, andaistudio2api.exeworking set dropped from 2.16 GB to ~203 MB