Back to notes
The Tesseract MemoryTechnical note

Why the study guide worker wouldn't start

The worker failed on an unsupported command option before it could run generation, so retrying the job couldn't address the cause.

Topics

Get the worker to the point where it can accept work

The permanent worker was started with stop-when-empty-for, an option Laravel didn't support. The command now uses supported options and validates queue names and numeric controls before constructing the worker arguments.

The permanent worker and backfill drain have different jobs. One stays available for later work; the other can use stop-when-empty to exit after its initial queue is drained. The command checks preserve that distinction.

Handle generation failures inside the job

GenerateLessonStudyPack has a lesson-specific uniqueness key, three attempts, a 180-second timeout and backoff intervals. Its uniqueness window lasts 900 seconds. That limits overlapping work for a period; it isn't an exactly-once guarantee or a permanent ban on regeneration.

The job checks that AI is enabled before proceeding. A retryable provider exception releases it with the requested delay; terminal failure stores a controlled reason and message through the study-pack service. Temporary unavailability, invalid payloads and other provider exceptions remain distinct cases.

Tests include malformed JSON, failed extraction and rejection of fabricated fallback content. Failed extraction must leave no ready payload and dispatch no embedding job. Those assertions check the consequences of failure, not just that an exception was caught.

Keep startup and completion evidence separate

The June closeout records a passing Study Pack group and a worker-configuration regression with 79 assertions. The configuration test checks the command, not a live process. Startup, dispatch, provider retry and the final stored result remain separate things to check when a guide doesn't appear.

Worker startup and generation retries are different boundaries

The permanent worker must start correctly before job-level runtime, retry and failure controls can operate.

Direct callAsync taskResponse / return
Worker process
Generation job
Provider and result

Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.

Choose a component to explore

Select a numbered component on the map or use the component menu. Its details and connections will appear here.

No component selected.

All connections (9)
  1. 01 · Worker command configuration02 · Laravel queue workerConstruct supported command · Direct call
  2. 03 · Queued generation work02 · Laravel queue workerDeliver queued work · Async task
  3. 02 · Laravel queue worker04 · GenerateLessonStudyPackExecute job · Async task
  4. 04 · GenerateLessonStudyPack05 · AI runtime gateCheck runtime · Direct call
  5. 05 · AI runtime gate06 · StudyPackServiceContinue when enabled · Direct call
  6. 06 · StudyPackService07 · Configured AI providerRequest generation · Direct call
  7. 07 · Configured AI provider06 · StudyPackServiceResult or provider failure · Response / return
  8. 06 · StudyPackService08 · Artifact and version statePersist result or failure · Direct call
  9. 04 · GenerateLessonStudyPack03 · Queued generation workRelease retryable work · Async task