Highlights
Observation pipeline cleanup — kill the per-message retry counter. The AI's parseable response is the only success signal; any other response (unparseable, empty, transport error) is a no-op. No more silent data loss after 3 retries.
What changed
- Parser: collapsed to binary
{ valid: true, observations, summary } | { valid: false }. No morekind/skippedenum dispatch in callers. - ResponseProcessor: two branches only — parseable → store + clear pending → broadcast; not parseable → reset claimed-but-unprocessed messages to pending. Removed per-message FIFO popping and the summarize-special-case best-effort confirm.
- PendingMessageStore: 226 → 165 lines. Removed
markFailed(the retry counter that silently dropped data after 3 attempts),transitionMessagesTo,confirmProcessed,clearFailedOlderThan, plus four other dead methods. - Provider cleanup: removed
processingMessageIdstracking from Claude, Gemini, OpenRouter providers. The session-scoped clear handles the success path; no per-message in-flight tracking needed. - GeneratorExitHandler: drain-in-flight loop deleted; hard-stop / restart-guard paths now just clear pending for the session.
- Schema migration v31 + v32: dropped four dead columns from
pending_messages—retry_count,failed_at_epoch,completed_at_epoch,worker_pid. Status enum reduced to'pending' | 'processing'(the unreachable'processed'and'failed'are gone).
Bug fixes / polish
SessionQueueProcessor: removed two arbitrary 1-second recovery sleeps after error inclaimNextMessage/waitForMessage; let the iterator end cleanly soGeneratorExitHandlercan restart it.Server.ts+SettingsRoutes.ts: unified four magic-numbersetTimeoutexit-flush patterns (100ms × 2, 1000ms × 2) into oneflushResponseThenhelper usingres.on('finish', ...).- PR review feedback (21+ threads): install.ts argument fixes, settings cache TTL, Dockerfile login-banner sourcing, docs port-model + Node version updates, regex whitespace fix, Date.UTC for year-mismatch test, sync-marketplace port range guard, banner inflate fail-open, version-bump arg validation.
Net diff
-181 lines (worker-service.cjs unaffected; total source lines down).
Migration
Existing databases auto-migrate on worker startup (schema v31 + v32 drop the dead columns). No user action needed.