You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(upload): chunked, resumable upload for large media and KB files — one shared service, streamed to disk, size limits from config #19713
Large media cannot be added to the knowledge base, including video files of a few GB whose audio is meant for transcription. Every upload is a single request, and the request size is capped at several layers: the 1 MiB perimeter cap (#19712), the route's own 10 MB, and the web server's 10 MB or 1 GB depending on location. Even with those raised, a multi-GB single request ties up a worker, and if the connection drops the user restarts from zero.
Decision
Maintainer decision (2026-10-26): chunked, resumable upload is the M1 target. Simply raising the limits, or a server-folder-only import, was not chosen.
Design
One shared upload service for knowledge files, chat files and transcriber media. No per-feature copy.
The client splits the file into chunks (size from config, for example 8 MB). The server streams each chunk to a staging file on disk. The server never holds the whole file in memory.
An upload session has an id, the offsets received and a checksum. An interrupted upload resumes from the last acknowledged offset.
The maximum total size is one config value, and is not hardcoded. Finished files are handed to the existing intake (KB add_document, or the transcriber job) by path.
Staging files are cleaned up only after the handoff has been recorded. An abandoned session expires after a configured TTL and is listed for review; it is not silently deleted.
Acceptance criteria
A 4 GB video uploads from the Knowledge UI, and backend memory stays bounded. A test sends N chunks and asserts the staged file's size and checksum.
Killing the connection mid-upload, then retrying, resumes from the last acknowledged chunk. A test pins resume.
The uploaded video reaches the transcriber, and its transcript lands in the KB.
KB document upload and chat file upload use the same service: one implementation, with callers listed in the PR.
Chunk size, maximum total size and session TTL are env-backed config. No literal appears in code or in web server config.
Maintainer decision (2026-11-02): this goes ahead of other new work and is exempt from the hold on new PRs. The current upload size is too small, and the chunked design stays rather than raising limits as a stopgap, so uploads stay at 10 MB until this lands. Work starts when the queue allows it.
Branch issue-19713-chunked-upload (PR #20694, head 325b1d6) was deleted as a zero-change branch: its content is already on main. None of the five ACs is ticked; no chunked-upload test, resume test, transcript landing or env-backed chunk config was verified.
Activity
mrveiss commentedon Nov 2, 2026
Maintainer decision (2026-11-02): this goes ahead of other new work and is exempt from the hold on new PRs. The current upload size is too small, and the chunked design stays rather than raising limits as a stopgap, so uploads stay at 10 MB until this lands. Work starts when the queue allows it.
fix(kb): upload storage limits, review list removal, codes, and a che…
fix(kb): removing a listed upload goes on the record first, under its…
fix(merge): resolve the env_registry_knowledge.py clash with main, bo…
fix(train): the redaction guard follows upload routes into the shared…
fix(train): the upload spec answers the resumable limits route with i…
feat(kb): resumable chunked uploads, staged on disk, for large files …
refactor(kb): the upload service's names are its own (mrveiss#19713)
fix(train): freeing an abandoned upload is a canonical audit action, …
mrveiss commentedon Nov 20, 2026
Branch
issue-19713-chunked-upload(PR #20694, head 325b1d6) was deleted as a zero-change branch: its content is already on main. None of the five ACs is ticked; no chunked-upload test, resume test, transcript landing or env-backed chunk config was verified.