Repository navigation
fix(ui): an upload waiting for the embedder is not stopped as stalled - #5452
Conversation
Since amd#5328, a wait for a model slot lasts as long as the holder is alive, and amd#5339 stops an index that goes 600 s without progress. An upload queued for the embedder or VLM behind a long chat reported no progress, so it failed with "made no progress" while it was only waiting its turn. This was the merge-order item amd#5328 owed as the later of the two to land. - _do_index listens to the broker's queue updates: each one is progress, and Cancel ends the queued wait through the same _step check. - A Cancel that reaches a model-slot wait is a stop, not an embedder failure: the RAG SDK unwraps an IndexingStopped found behind the client's wrapping instead of logging "Batch failed" and raising EmbeddingUnavailableError, and _do_index treats a stop absorbed along the way (a degraded image page) as the stop it was.
|
Verdict: Approve with suggestions Before this change, a document uploaded in the Agent UI while a long chat held the model failed with "made no progress for 600 s", even though it was only waiting in line. Now the broker's regular queue updates count as progress, so the upload keeps waiting, and Cancel during that wait still stops it at once. A Cancel that lands while the embedder is loading is now logged as a stop, not as an embedder outage. I traced the stop through the broker's queue loop, the in-process model lock, and the SDK's error wrapping. In each case it propagates cleanly and releases the lease or lock, and none of them retries it. I found no blocking bugs.
Real-world evidenceN/A: no evidence bundle was produced for this run, and reproducing the bug needs a running daemon holding the model slot. The verdict rests on static review alone. I could not run the new tests here either, because this runner has no pytest installed. 🔍 Technical detailsIssues 🟡 No test drives a real queued lease ( 🟢 A pre-streaming daemon gives no progress during the wait ( 🟢 The post-index stop check discards a finished result ( Strengths
|
Combines with amd#5448: indexing now uses its lease_cancel_scope and a non-raising queue listener; _stop_behind also unwraps a LeaseWaitCancelled, so a cancelled embedder wait is a stop rather than an embedder failure. The fake-broker tests duplicated amd#5448's and are replaced by tests against a real daemon: a queued upload outlives the timeout, Cancel leaves the queue without a second lease request, and a dead holder is reclaimed.
|
Merged main after #5448, which wired the same fix a different way, so this PR now builds on it. Every review point is covered: new tests run against a real daemon instead of faked broker updates, the old-daemon case is noted in the docstring, and discarding a result that finishes after a stop is kept on purpose, because the caller has already given up. The manual Agent UI step is still open, since this machine has no Lemonade running for the embedder. 🔍 Technical details
|
An Agent UI upload queued for the embedder behind a long chat failed with "made no progress for 600 s", even though it was only waiting its turn for the model. #5448 made the broker's queue updates count as progress and let Cancel end that wait; this PR finishes the job. A Cancel during the embedder's wait is now logged as a stop rather than an embedder failure, and the fix is proven against a real daemon instead of a faked broker, including that a dead holder can't keep an upload waiting forever.
Test plan
python -m pytest tests/unit/test_daemon_broker_queue.py -k upload tests/unit/rag/test_embedding_outage.py -q(the three real-daemon tests fail with the fix(ui): an upload queued for the model isn't stopped as stuck, and Cancel reaches it #5448 wiring removed)python -m pytest tests/unit/chat/ui tests/unit/rag tests/unit/agents/tools tests/unit/test_broker_wiring.py tests/unit/test_daemon_broker_queue.py tests/unit/test_vlm_extraction_failures.py -q: 2733 passedpython util/lint.py --allgaia daemonrunning, hold the model slot with a rawPOST /host/v1/models/leasefor longer thanGAIA_INDEX_TIMEOUT, then upload a document in the Agent UI. It indexes once the slot is released, instead of failing with "made no progress".🔍 Technical details
gaia.rag.sdk._stop_behindfinds anIndexingStoppedorLeaseWaitCancelledbehind the client's wrapping (LemonadeClientError, thenEmbeddingUnavailableError)._load_embedderand_embed_batchre-raise it._index_document._do_indexraisesIndexingStoppedwhen the stop is set afterindex_documentreturns, which covers a stop absorbed along the way. The caller has already given up by then, so discarding that result changes nothing the user sees.test_daemon_broker_queue.py: a queued upload outlives an 0.8 s timeout while the holder lives; Cancel removes it from the broker's queue with exactly one lease request (no reattach retry); a granted lease that is never renewed is reclaimed and the upload indexes.