mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add chat debug retention purge (#24943)
> Mux is acting on Mike's behalf. Adds configurable retention for chat debug data, including the purge query, updated_at index, site config, experimental API, SDK types, frontend lifecycle setting, and docs. The purge deletes debug runs older than the configured retention window and relies on existing cascades to delete steps. The default retention is 30 days, and setting the value to 0 disables the purge.
This commit is contained in:
@@ -358,6 +358,20 @@ VALUES ('agents_chat_retention_days', CAST(@retention_days AS integer)::text)
|
||||
ON CONFLICT (key) DO UPDATE SET value = CAST(@retention_days AS integer)::text
|
||||
WHERE site_configs.key = 'agents_chat_retention_days';
|
||||
|
||||
-- name: GetChatDebugRetentionDays :one
|
||||
-- Chat debug run retention window in days. 0 disables.
|
||||
SELECT COALESCE(
|
||||
(SELECT value::integer FROM site_configs
|
||||
WHERE key = 'agents_chat_debug_retention_days'),
|
||||
@default_debug_retention_days::integer
|
||||
) :: integer AS debug_retention_days;
|
||||
|
||||
-- name: UpsertChatDebugRetentionDays :exec
|
||||
INSERT INTO site_configs (key, value)
|
||||
VALUES ('agents_chat_debug_retention_days', CAST(@debug_retention_days AS integer)::text)
|
||||
ON CONFLICT (key) DO UPDATE SET value = CAST(@debug_retention_days AS integer)::text
|
||||
WHERE site_configs.key = 'agents_chat_debug_retention_days';
|
||||
|
||||
-- name: GetChatAutoArchiveDays :one
|
||||
-- Auto-archive window in days. 0 disables.
|
||||
SELECT COALESCE(
|
||||
|
||||
Reference in New Issue
Block a user