project-nomad/admin/app/jobs
Chris Sherwood a5fe52f66f fix(KB): respect Manual ingest policy on post-download dispatch
RunDownloadJob's onComplete handler was unconditionally firing
EmbedFileJob.dispatch after every ZIM download, gated only by "is
Ollama installed?". The rag.defaultIngestPolicy KV setting was never
consulted, so users who explicitly set Auto-index to Manual still got
every newly-downloaded ZIM auto-embedded.

RagService.scanAndSync already handles Manual correctly by recording
pending_decision rows instead of dispatching (rag_service.ts:1587-1638
via decideScanAction). The post-download path skipped that gate.

Mirror the same check at the dispatch site: read the policy KV; if
Manual, firstOrCreate a pending_decision row in kb_ingest_state so the
per-file Index affordance from PR #909 surfaces the file the same way
scan-time-discovered Manual files do. firstOrCreate (not create) so a
re-download doesn't demote an existing indexed/failed row — the user
can explicitly re-index from the KB panel if they want fresh content.

Verified on NOMAD3: with rag.defaultIngestPolicy='Manual', every ZIM
downloaded today via Content Explorer (agriculture-essential +
computing-essential, ~62 MB across 7 files) wrote kb_ingest_state
rows with state='indexed' instead of pending_decision. Real bug,
not a hot-patch artifact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 10:16:00 -07:00
..
check_service_updates_job.ts fix(queue): singleton QueueService to stop ioredis connection leak 2026-05-20 10:16:00 -07:00
check_update_job.ts fix(queue): singleton QueueService to stop ioredis connection leak 2026-05-20 10:16:00 -07:00
download_model_job.ts fix(queue): singleton QueueService to stop ioredis connection leak 2026-05-20 10:16:00 -07:00
embed_file_job.ts feat(KB): status pill + last-activity timestamp on Processing Queue (RFC #883 §5/§10) 2026-05-20 10:16:00 -07:00
run_benchmark_job.ts fix(queue): singleton QueueService to stop ioredis connection leak 2026-05-20 10:16:00 -07:00
run_download_job.ts fix(KB): respect Manual ingest policy on post-download dispatch 2026-05-20 10:16:00 -07:00
run_extract_pmtiles_job.ts fix(queue): singleton QueueService to stop ioredis connection leak 2026-05-20 10:16:00 -07:00