Asynchronous Report Generation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- nextjs, typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu bằng cách đọc server action submit trong app/actions.tsx, bao gồm processResolutionSearch, processEvents và researcher loop. So sánh hành vi streaming hiện tại với OPTIMIZATION_SUMMARY.md và các trang wiki về orchestration được liên kết trước khi chọn cách tiếp cận cho queue và persistence. Được xem là hoàn tất khi việc tạo báo cáo nhanh chóng trả về một job ID, công việc nền theo dõi trạng thái và các kết quả trung gian, đồng thời client nhận được các bản cập nhật tiến độ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I understand you want to make report generation asynchronous so users can interact with other parts of the system while reports are being generated. Currently, the submit server action in app/actions.tsx processes requests synchronously, blocking until all agent work completes before returning 1 .
Current Blocking Behavior
The system uses streaming primitives for progressive UI rendering, but the server action itself is synchronous:
- The
submitfunction initializes streaming state but waits for all processing to complete 1 - The researcher agent runs in a synchronous loop until a non-empty response is generated 2
- Resolution search processing is called synchronously 3
- The function only returns after all work is done 4
Required Changes for Asynchronous Processing
To make report generation truly asynchronous, you would need to implement a background job queue system:
1. Job Queue Infrastructure
- Implement a job queue (e.g., Bull, Agenda, or database-backed queue)
- Create a separate worker process to handle report generation jobs
- Store job state in a database for persistence
2. Modified Submit Flow
// Instead of blocking, return immediately with job ID
async function submit(formData?: FormData, skip?: boolean) {
const jobId = nanoid()
// Enqueue the job for background processing
await queue.add('report-generation', {
jobId,
formData,
skip
})
// Return immediately with job ID
return {
jobId,
status: 'processing'
}
}
3. Status Checking Mechanism
- Create a new server action to check job status
- Implement polling or websocket updates on the client
- Stream partial results as they become available from the worker
4. Worker Process
- Move the current
processEvents()andprocessResolutionSearch()logic to a worker - Update AIState progressively as results are generated
- Store intermediate results in the database
Notes
This is a significant architectural change that requires implementing a job queue system, worker processes, and status tracking infrastructure. The current streaming approach in app/actions.tsx provides progressive UI updates but still blocks the server action. True asynchronous processing would require background job processing with a queue system like Bull or a database-backed solution. The existing optimizations in OPTIMIZATION_SUMMARY.md focus on reducing re-renders and caching, not on making the actual generation process non-blocking.
Wiki pages you might want to explore:
Citations
File: app/actions.tsx (L36-42)
async function submit(formData?: FormData, skip?: boolean) {
'use server'
const aiState = getMutableAIState<typeof AI>()
const uiStream = createStreamableUI()
const isGenerating = createStreamableValue(true)
const isCollapsed = createStreamableValue(false)
File: app/actions.tsx (L223-223)
processResolutionSearch();
File: app/actions.tsx (L516-550)
while (
useSpecificAPI
? answer.length === 0
: answer.length === 0 && !errorOccurred
) {
const { fullResponse, hasError, toolResponses } = await researcher(
currentSystemPrompt,
uiStream,
streamText,
messages,
mapProvider,
useSpecificAPI,
drawnFeatures
)
answer = fullResponse
toolOutputs = toolResponses
errorOccurred = hasError
if (toolOutputs.length > 0) {
toolOutputs.map(output => {
aiState.update({
...aiState.get(),
messages: [
...aiState.get().messages,
{
id: groupeId,
role: 'tool',
content: JSON.stringify(output.result),
name: output.toolName,
type: 'tool'
}
]
})
})
}
File: app/actions.tsx (L619-624)
return {
id: nanoid(),
isGenerating: isGenerating.value,
component: uiStream.value,
isCollapsed: isCollapsed.value
}
- Ngôn ngữ chính
- TypeScript
- Star
- 19
- Fork
- 7
- Merge trung bình
- 55 phút
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QueueLab/QCX
-
SettingsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
QueueLab/QCX#734 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
QueueLab/QCX#646 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update Gemini 3.1 ProĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
QueueLab/QCX#583 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CollaborationĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
QueueLab/QCX#791 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Image preview Gen UIĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
QueueLab/QCX#790 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
siyuan-note/siyuan#20040 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RunestoneInteractive/rs#1574 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
remotion-dev/remotion#11901 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Poll constructor throws for an uncached channel while resolving a message context-menu interactionĐang mởbug need repro packages:discord.js
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
discordjs/discord.js#11645 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
🐞 bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Sitecore/content-sdk#641 ·
Maintainer thường phản hồi trong vòng 2 ngày