Summary
The Inspect View client-side WorkQueue for loading log previews stalls after processing the first batch, leaving most eval logs invisible in the UI even though their data is correctly stored in IndexedDB.
Discovered During
Investigation of #1 (filename parsing fix). While the filename parsing is the primary cause of garbled metadata, we also observed that even with correct data in IndexedDB, the UI fails to render all logs.
Root Cause (Observed)
The Log-Preview-Queue in src/inspect_ai/_view/www/src/state/sync/replicationService.ts is configured with:
batchSize: 6
concurrency: 2
maxRetries: 3
processingDelay: 20
Observed behavior: The first batch of 6 files loads successfully and appears in the UI. Subsequent batches are never processed. No console errors are emitted beyond a 404 for the optional flow.yaml.
IndexedDB evidence: The log_previews store contained all 17 entries (in a test with 17 files), but the UI displayed only 1. The logs store also had all 17 entries. This indicates the data loads into the DB but the UI rendering layer doesn't pick up all entries.
Key Code Locations
| File |
What |
src/inspect_ai/_view/www/src/utils/workQueue.ts |
Generic WorkQueue with batch processing, retry, priority sorting |
src/inspect_ai/_view/www/src/state/sync/replicationService.ts:65-85 |
Preview queue config and worker |
src/inspect_ai/_view/www/src/client/api/client-api.ts:239-284 |
get_log_summaries — routes .eval files to individual byte-range reads |
Potential Causes
- Promise resolution issue in
get_log_summaries: For .eval files, each file triggers an individual read_eval_file_log_summary via openRemoteLogFile + readEvalBasicInfo. If any one in a batch throws, Promise.all rejects the entire batch.
- Worker exit condition: In
workQueue.ts:99, the worker loop checks this.itemsById.size > 0. If items are removed from the map before the worker processes them (e.g., by a concurrent sync), the worker exits early.
- IndexedDB transaction deadlock: The
onComplete callback writes to IndexedDB via _throttledFlushPreviewBatch. If the flush blocks or fails silently, subsequent batches may not trigger UI updates.
- Rendering disconnect: Data reaches IndexedDB but the Zustand store or React component doesn't re-render for new entries.
Reproduction
- Create a directory with 17+
.eval files
uv run inspect view start --log-dir /path/to/dir/
- Open the UI — observe only a subset of files in the list
- Check IndexedDB in browser DevTools — all entries present in
log_previews
Relationship to Other Issues
Acceptance Criteria
Summary
The Inspect View client-side
WorkQueuefor loading log previews stalls after processing the first batch, leaving most eval logs invisible in the UI even though their data is correctly stored in IndexedDB.Discovered During
Investigation of #1 (filename parsing fix). While the filename parsing is the primary cause of garbled metadata, we also observed that even with correct data in IndexedDB, the UI fails to render all logs.
Root Cause (Observed)
The
Log-Preview-Queueinsrc/inspect_ai/_view/www/src/state/sync/replicationService.tsis configured with:batchSize: 6concurrency: 2maxRetries: 3processingDelay: 20Observed behavior: The first batch of 6 files loads successfully and appears in the UI. Subsequent batches are never processed. No console errors are emitted beyond a 404 for the optional
flow.yaml.IndexedDB evidence: The
log_previewsstore contained all 17 entries (in a test with 17 files), but the UI displayed only 1. Thelogsstore also had all 17 entries. This indicates the data loads into the DB but the UI rendering layer doesn't pick up all entries.Key Code Locations
src/inspect_ai/_view/www/src/utils/workQueue.tssrc/inspect_ai/_view/www/src/state/sync/replicationService.ts:65-85src/inspect_ai/_view/www/src/client/api/client-api.ts:239-284get_log_summaries— routes .eval files to individual byte-range readsPotential Causes
get_log_summaries: For.evalfiles, each file triggers an individualread_eval_file_log_summaryviaopenRemoteLogFile+readEvalBasicInfo. If any one in a batch throws,Promise.allrejects the entire batch.workQueue.ts:99, the worker loop checksthis.itemsById.size > 0. If items are removed from the map before the worker processes them (e.g., by a concurrent sync), the worker exits early.onCompletecallback writes to IndexedDB via_throttledFlushPreviewBatch. If the flush blocks or fails silently, subsequent batches may not trigger UI updates.Reproduction
.evalfilesuv run inspect view start --log-dir /path/to/dir/log_previewsRelationship to Other Issues
Acceptance Criteria