fix(work_assistant): 修复审核任务并发初始化与超时问题
- review_jobs/bid_queue 增加 schema 锁与双重检查初始化 - 调用失败时关闭连接,避免资源泄漏 - review_commentary 复用阶段剩余超时预算,避免误重启 - routes 捕获 SQLite BUSY/LOCKED 并返回 503 重试响应 - submission_advice 精简数据模型与提示语,聚焦用途校验
This commit is contained in:
@@ -206,7 +206,9 @@ def review_commentary(*, subject, goal, tasks, sources, review_kind, workflow,
|
||||
remaining = deadline - time.monotonic()
|
||||
if remaining < 1:
|
||||
raise TimeoutError()
|
||||
raw = invoke(instruction, data, schema, timeout_seconds=min(30, remaining), max_tokens=3000)
|
||||
# Admission and generation share the caller's bounded stage budget.
|
||||
# A second 30s cap caused queued, otherwise valid task reviews to restart.
|
||||
raw = invoke(instruction, data, schema, timeout_seconds=remaining, max_tokens=3000)
|
||||
return validate_commentary(raw, subject.id, available, review_kind, alignment)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user