Skip to content

bug: Inspect View WorkQueue stalls after first batch of 6 eval logs #3

Description

@Troubladore

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

  1. 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.
  2. 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.
  3. 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.
  4. Rendering disconnect: Data reaches IndexedDB but the Zustand store or React component doesn't re-render for new entries.

Reproduction

  1. Create a directory with 17+ .eval files
  2. uv run inspect view start --log-dir /path/to/dir/
  3. Open the UI — observe only a subset of files in the list
  4. Check IndexedDB in browser DevTools — all entries present in log_previews

Relationship to Other Issues

Acceptance Criteria

  • All eval logs in a directory appear in the Inspect View list (not just the first batch)
  • WorkQueue processes all batches to completion
  • No silent failures in preview loading

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    design-neededRequires design work before implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions