mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-11 13:28:57 +00:00
a4be8ecb95
Correctness fixes from the internal/ai code review: - gate reindex commits on the snippet row still existing, so a delete racing reconcile can't re-insert its embeddings forever - cap one logical provider request at 90s across all retries, so a hanging provider can't stall the reply box for minutes - return proper error envelopes from the copilot message store instead of raw sqlx errors that surfaced as "Error interface conversion failed" - reject blank AI replies in the generate-reply and copilot handlers - build GET tool URLs with url.Parse so a # in the URL doesn't swallow the query params - let a blank api_key clear the stored key (masked keeps it), restoring a way to disable AI Cleanups and hardening: - share one SSRF transport between tool and provider clients instead of building a new transport per AI call - copy the provider config struct instead of listing every field - backfill temperature 0.7 for configured providers upgrading from releases that hardcoded it - only pass user/assistant roles from copilot history to the provider - reject enc:-prefixed secrets that would be stored raw and fail decrypt - rune-safe truncation of test errors, one-line doc comments