fix(report): keep personal-report leases alive through serial chapter writes
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled

Staging verification wrote four ready sections then lost the 120s job lease
mid-chapter. Lengthen the worker lease and cap summary tokens with the same
3072 ceiling the section budget already uses.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-03 02:07:18 +08:00
co-authored by Cursor
parent eda37c1523
commit 4329426530
6 changed files with 56 additions and 6 deletions
+2 -1
View File
@@ -46,7 +46,8 @@ export const SECTION_OUTPUT_TOKEN_BUDGET_CAP = 3072;
export const SECTION_OUTPUT_TOKEN_BUDGET_FLOOR = 1024;
/** title/actions/caveats/refs JSON envelope on top of narrative. */
export const SECTION_STRUCTURE_TOKEN_ALLOWANCE = 568;
export const SUMMARY_OUTPUT_TOKEN_BUDGET_CAP = 4096;
/** Same cap as sections: 08-30 whole-report stop was 3069 output tokens. */
export const SUMMARY_OUTPUT_TOKEN_BUDGET_CAP = 3072;
export const SUMMARY_OUTPUT_TOKEN_BUDGET_FLOOR = 1536;
/** headline + priorities + JSON envelope on top of the 2000-char summary field. */
export const SUMMARY_STRUCTURE_TOKEN_ALLOWANCE = 580;
@@ -197,6 +197,8 @@ function createProductionWorker(workerId: string) {
};
return createPersonalReportWorker({
workerId,
leaseSeconds: 600,
heartbeatIntervalMs: 20_000,
jobs: createSupabasePersonalReportJobService(admin),
reports: createSupabasePersonalReportService(admin),
sectionService: createPersonalReportSectionService(admin as never),