Files
webdev-pipeline/backlog/tasks/task-25 - Harden-website-enrichment-against-Convex-action-runtime-aborts.md

2.3 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, priority, ordinal
id title status assignee created_date updated_date labels dependencies priority ordinal
TASK-25 Harden website enrichment against Convex action runtime aborts In Progress
2026-06-05 06:59 2026-06-05 07:04
high 27000

Description

Website enrichment actions can be killed by Convex with a transient invalid environment error before the JS catch block runs, leaving runs without normal failure finalization or PageSpeed queueing. Add an internal action runtime budget so long browser/bootstrap/crawl work fails inside the action before the platform aborts it.

Acceptance Criteria

  • #1 Website enrichment has an action-level runtime budget below the Convex runtime abort window
  • #2 Long Chromium bootstrap, browser launch, crawl, link checks, and screenshots are bounded by remaining action time
  • #3 When the runtime budget is exceeded, the existing catch path finalizes the enrichment run and queues PageSpeed for the lead
  • #4 Regression tests cover the runtime budget guard and full verification passes

Implementation Plan

  1. Add RED source regression for action runtime budget and bounded browser/crawl steps
  2. Implement minimal runtime budget helper in websiteEnrichmentAction
  3. Run tests/type/lint and deploy Convex dev
  4. Record findings and leave task open pending manual retest

Implementation Notes

2026-06-05: Investigation found latest website_enrichment run was manually set to failed, but Convex logs show the underlying action ended with "Transient error while executing action" and environment "invalid" before app-level catch/finalization ran. This explains missing finishedAt/errorSummary/PageSpeed follow-up.

2026-06-05: Implemented action-level budget guard (default 120s, TASK8_ACTION_BUDGET_MS override) around Playwright import, Chromium executable resolution, AL2023 library preparation, browser launch/context creation, page crawls, internal link checks, and desktop/mobile screenshots so long work rejects inside the action catch path before Convex invalidates the runtime. Verified with targeted website-enrichment action tests, full pnpm test, TypeScript, lint, and Convex dev typecheck/deploy.