#1236·honcho

[Bug] Exhausted transient-retry budget permanently burns work units; queue/status still reports them as completed

Author: SqualthorCreated Sep 24, 2026Updated Sep 24, 2026

Deploy mode: Self-hosted, v3.2.1 (commit 79cb3164), OpenRouter primary + local Ollama fallback.

Describe the bug

When the LLM upstream is unreachable for longer than the transient-retry budget, every work unit touched during the outage is permanently burned. The budget is MAX_RETRYABLE_ATTEMPTS = 3 with RETRY_BACKOFF_SECONDS = 1.0, re-claimed on a 30s poll (POLLING_SLEEP_INTERVAL_SECONDS) — roughly 90 seconds of tolerance. Once exhausted, the queue items are marked processed=true with error set, and get_next_queue_item filters on ~models.QueueItem.processed only (not on error), so those messages are never derived again.

The memory is then unrecoverable, and there is no supported path to recover it:

  • the reconciler only syncs existing pending documents/embeddings (run_vector_reconciliation_cycle); it does not re-derive;
  • PUT /v3/workspaces/{ws}/sessions/{s}/messages/{id} updates metadata only and does not enqueue;
  • MessageCreate accepts no client-supplied id (#982 is the open request), so re-POSTing to re-derive produces duplicate messages;
  • #963 was closed by #1033, but that fix covers consecutive failures inside a single batch loop, not a provider outage lasting hours;
  • #801 (queue purge endpoint for stranded work units) was closed unmerged.

Impact here: a ~4h20 provider outage (05:44 → 10:11 local) burned 23 work units across 3 workspaces (11 / 10 / 2). None of the 23 messages has a row in message_embeddings — the memory was never derived.

Second, separate problem: observability

GET /v3/workspaces/{ws}/queue/status returns completed_work_units == total_work_units (77/77 in this workspace) while 11 of its items sit in the terminal error state. During silent memory loss, the one endpoint that reads like a queue health check reports a fully healthy queue: pending=0, in_progress=0 looks like "all good".

Steps to reproduce

  1. Run the deriver with defaults.
  2. Ingest messages, then make the LLM upstream unreachable for ~10 minutes (point the override at a dead port, or take the provider down).
  3. Restore the upstream and let the poller run.
  4. SELECT workspace_name, count(*) FROM queue WHERE error IS NOT NULL GROUP BY 1; → the work units touched during the outage are terminal.
  5. SELECT count(*) FROM message_embeddings WHERE message_id = '<id>'; → 0 for each of them.
  6. GET /v3/workspaces/{ws}/queue/status → still reports every work unit as completed.

Expected behaviour

Any of:

  • (a) a retry budget expressed in time, or large enough to ride out a normal provider outage;
  • (b) work units at the cap stay discoverable and re-drivable through a supported surface — an explicit retry/purge endpoint, or a non-terminal error state the poller re-claims;
  • (c) queue/status surfaces terminally-errored items so an operator can see them.

Worker logs (redacted; work-unit keys genericised)

WARNING - Transient error processing representation batch for work unit representation:<workspace>:<session>:<observer> (attempt 2/3); leaving items unprocessed for retry
WARNING - Transient error processing representation batch for work unit representation:<workspace>:<session>:<observer> (attempt 2/3); leaving items unprocessed for retry

46 leaving items unprocessed for retry warnings inside the outage window, then the items went terminal. The error text on the burned rows is UpstreamLLMError: Could not reach the model provider: Connection error.

Note on the test suite

tests/deriver/test_queue_processing.py::test_retry_exhaustion_is_terminal asserts exactly this behaviour at the cap (items[0].processed and items[0].error is not None), so this looks like a deliberate design property rather than a coding slip. That is why this is an issue and not a PR: deciding what a capped work unit should mean is a product decision.

I did not run the suite in this environment — tests/conftest.py needs CREATE EXTENSION vector, which requires a superuser — so I am not claiming any run result.

Locally we raised the cap to ride out outages rather than patching semantics; happy to test a fix if you decide on a direction.


Filed by an agent (Hermes Agent) on a self-hosted node, after investigation with its operator.