Repository navigation
[Feature]: Configurable course material file count with deployment-wide parsing concurrency control #2309
Replies: 2 comments
|
OpenMAIC automated triage This is a feature/design request affecting browser generation and server persistence. In this checkout, the reporter's `Promise.all` path in `app/generation-preview/page.tsx` is no longer present: attachments upload to `/api/materials`, extraction runs in the background, and database leases coordinate workers. The configured file count still defaults to the hardcoded 5 (`MAX_DOCUMENT_BUNDLE_FILES`), enforced by the client from `/api/generate-classroom/capabilities` and again by run-input validation. Extraction exposes a per-process cap and a deployment-wide per-owner cap, but no single deployment-wide global cap, bounded queue capacity, or queue-full/timeout feedback was found. Because the reporter's deployment/version may differ and the remaining changes involve configuration and queue semantics, this needs a maintainer design decision rather than an investigation. Suggested next step: maintainer-review.
AI-generated assessment from the issue, discussion and source. No reproduction was executed; maintainers decide the next action. |
|
Thanks for the assessment. I’m willing to contribute an implementation based on the current server-backed materials pipeline. Would maintainers support splitting this into two changes: (1) a configurable attachment count with consistent frontend/backend validation, and (2) deployment-wide extraction concurrency and bounded queue semantics extending the existing database lease mechanism? Is there a preferred configuration mechanism or an existing design I should follow? |
Uh oh!
There was an error while loading. Please reload this page.
Problem or Motivation
In our current deployment, Classic course generation allows a maximum of 5 course material files per generation. Users need to combine more than 5 documents as references for a single course.
The limit is hardcoded as MAX_DOCUMENT_BUNDLE_FILES in lib/document/bundle.ts. Changing it currently requires modifying application code.
However, simply increasing this limit could increase parsing load: our deployed version uses Promise.all in app/generation-preview/page.tsx to send a separate /api/extract-document request for each file concurrently.
We run 3 Web servers with shared PostgreSQL and Redis. A frontend or per-process concurrency limit would not provide a deployment-wide cap when multiple users generate courses simultaneously.
We would like to align with upstream before implementing a local customization. Related work includes #621 and #1736; please clarify whether the server-first architecture already addresses this use case.
Proposed Solution
Allow deployment operators to configure the maximum number of course material files per generation, retaining 5 as the default.
Pair this flexibility with deployment-wide document extraction concurrency control and a bounded waiting queue, so allowing more attachments does not allow unlimited simultaneous parsing.
Frontend validation, backend validation, and localized hints/errors should consistently reflect the configured file count.
We have Redis and PostgreSQL available, but do not require a specific implementation. We would welcome maintainer guidance on whether this should extend existing parsing infrastructure or use asynchronous extraction jobs.
The existing per-file size and 150 MB bundle-size limits should remain independent settings.
Acceptance Criteria
Alternatives Considered
Area
Classroom generation
Additional Context
No response
All reactions