mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 04:56:20 +02:00
A quick Stop before the agent's first token no longer races a late reply. Started-but-empty cancellations defer the empty/non-empty judgment until the daemon acks its transcript flush (or a grace-period sweeper fires), then settle to a single outcome. Empty outcomes persist a durable, creator-authorized draft restore (fetched/consumed via a dedicated endpoint, reconnect-safe and at-most-once) instead of broadcasting the prompt over the workspace bus. Closes #5219
10 lines
502 B
SQL
10 lines
502 B
SQL
-- Partial index over pending deferred finalizations only: the sweeper scans
|
|
-- for rows past the grace period, and the pending set is tiny (cancelled
|
|
-- started-but-empty chat tasks awaiting a daemon ack).
|
|
--
|
|
-- Single-statement migration: CREATE INDEX CONCURRENTLY cannot run inside a
|
|
-- transaction or a multi-command string.
|
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_task_chat_finalize_deferred
|
|
ON agent_task_queue (chat_finalize_deferred_at)
|
|
WHERE chat_finalize_deferred_at IS NOT NULL;
|