Repository navigation
Expose knowledge-base upload size ceiling as admin-configurable #72
Copy link
Copy link
Open
Labels
area:knowledge-baseDocument upload/indexing surfaceDocument upload/indexing surfaceeffort:SSmall: single file/component, hours not daysSmall: single file/component, hours not dayspolishAdmin/UI surfacing or refinement of existing capability, not new functionalityAdmin/UI surfacing or refinement of existing capability, not new functionalitypriority:P3Deferred/speculative — explicitly not scheduled yetDeferred/speculative — explicitly not scheduled yettype:improvementMakes an existing capability better/safer/more completeMakes an existing capability better/safer/more complete
Description
Context
docs/CONFIG_AUDIT_2026-09-04.md found that backend/app/core/config.py:221 hardcodes knowledge_base_upload_max_bytes = 25 * 1024 * 1024 (25 MiB) as an env-only field — not DB-backed, unlike comparable ceilings such as guardrail_max_input_length (env-default + nullable DB override, capped by a hard non-overridable ceiling per Phase 4c's pattern).
Scope
- Add nullable
SystemSettingscolumnknowledge_base_upload_max_bytes, following the exactmax_input_lengthpattern: a hard, non-overridable ceiling constant in code (e.g.KNOWLEDGE_BASE_UPLOAD_MAX_BYTES_CEILING) enforced at the API request boundary, with the DB value bounded by it. - Wire into the upload endpoint's existing size check (
backend/app/api/knowledge_base.pyor wherever the current env-only field is read). - Add to the existing Settings UI (new field in whichever section fits best — likely alongside other content-handling settings) with a tooltip.
- Audit-log on change.
Non-goals
knowledge_base_upload_allowed_content_types(the MIME type allow-list) is explicitly excluded from this issue — the audit judged a free-text DB-editable list unsafe, since each type maps to specific extraction code intext_extraction.pythat must exist to support it. If ever exposed, it should be per-type on/off toggles over the existing fixed set (like guardrail pattern toggles), which is a larger, separate design — not bundled here.
Definition of Done
-
knowledge_base_upload_max_bytesnullable column + non-overridable ceiling constant + Alembic migration. - Resolver wired into the upload size check, unit-tested at and beyond the ceiling.
- Settings UI field + tooltip.
- Audit logging on change.
- RBAC call-out per
AGENTS.mdTDD Discipline step 0: admin feature. - Standard merge gate from
AGENTS.md's Definition of Done applies in full.
Metadata
Metadata
Assignees
Labels
area:knowledge-baseDocument upload/indexing surfaceDocument upload/indexing surfaceeffort:SSmall: single file/component, hours not daysSmall: single file/component, hours not dayspolishAdmin/UI surfacing or refinement of existing capability, not new functionalityAdmin/UI surfacing or refinement of existing capability, not new functionalitypriority:P3Deferred/speculative — explicitly not scheduled yetDeferred/speculative — explicitly not scheduled yettype:improvementMakes an existing capability better/safer/more completeMakes an existing capability better/safer/more complete
Activity