Multica Eve
d4dac0e77c
perf(agents): index-backed latest-terminal lookup in task snapshot (MUL-5436) ( #6085 )
...
ListWorkspaceAgentTaskSnapshot took each agent's latest completed/failed
task with a workspace-wide DISTINCT ON, so every presence load read and
sorted the workspace's whole terminal history. Neither existing index
matches that shape: (agent_id, status) has no completed_at, and migration
231's (completed_at) partial index is completed_at-first for the Usage
rollups.
Replace the outcome half with a per-agent JOIN LATERAL Top-1 and add a
partial index on (agent_id, completed_at DESC NULLS LAST, created_at DESC,
id DESC) WHERE status IN ('completed','failed'). On a 40-agent workspace
with 200k terminal rows this goes from 6631 shared buffers / 48.3 ms to
162 buffers / 0.1 ms, with an identical row set.
The (created_at, id) tie-break also makes the pick deterministic when
completed_at ties or is NULL — completed_at DESC alone left the winner up
to the plan.
Report #6075 asked to delete the outcome half as dead code, but PR #2608
made the Squad hover card (AgentLivePeekCard) read those rows for its
"last activity" line, so removing them would be a product regression for
shipped desktop builds. The response contract is unchanged here; splitting
the outcome into a lazy endpoint stays follow-up work.
Also tighten pickLatestTerminal to completed/failed only, matching the
snapshot's filter — it accepted cancelled, which the endpoint never
returns and which would have masked an agent's last real outcome.
Co-authored-by: Eve <eve@multica-ai.local >
Co-authored-by: multica-agent <github@multica.ai >
2026-07-29 14:28:44 +08:00
..
2026-05-14 15:23:36 +02:00
2026-05-14 15:23:36 +02:00
2026-05-18 12:17:39 +08:00
2026-05-18 12:17:39 +08:00
2026-05-17 15:01:38 +08:00
2026-05-17 15:01:38 +08:00
2026-05-16 21:26:30 +02:00
2026-05-16 21:26:30 +02:00
2026-05-16 21:26:30 +02:00
2026-05-16 21:26:30 +02:00
2026-05-18 14:59:40 +08:00
2026-05-18 14:59:40 +08:00
2026-05-19 05:35:18 +02:00
2026-05-19 05:35:18 +02:00
2026-05-20 12:30:10 +08:00
2026-05-20 12:30:10 +08:00
2026-05-19 18:37:48 +02:00
2026-05-19 18:37:48 +02:00
2026-05-20 05:30:13 +02:00
2026-05-20 05:30:13 +02:00
2026-06-17 09:24:15 +02:00
2026-06-17 17:53:43 +08:00
2026-05-19 19:51:28 +02:00
2026-05-19 19:51:28 +02:00
2026-05-20 15:37:23 +08:00
2026-05-20 15:37:23 +08:00
2026-05-22 13:22:36 +08:00
2026-05-22 13:22:36 +08:00
2026-05-21 19:00:26 +08:00
2026-05-21 19:00:26 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 16:26:42 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 15:33:47 +08:00
2026-05-21 16:35:45 +08:00
2026-05-21 16:35:45 +08:00
2026-05-22 12:26:56 +08:00
2026-05-22 12:26:56 +08:00
2026-05-22 14:51:43 +08:00
2026-05-22 14:51:43 +08:00
2026-05-25 18:42:48 +08:00
2026-05-25 18:42:48 +08:00
2026-05-27 13:44:31 +08:00
2026-05-27 13:44:31 +08:00
2026-05-26 17:00:01 +08:00
2026-05-26 17:00:01 +08:00
2026-05-26 16:45:46 +08:00
2026-05-26 16:45:46 +08:00
2026-06-03 19:12:14 +08:00
2026-06-03 19:12:14 +08:00
2026-05-27 15:47:36 +08:00
2026-05-27 15:47:36 +08:00
2026-06-03 19:12:14 +08:00
2026-06-03 19:12:14 +08:00
2026-06-01 16:48:05 +02:00
2026-06-01 16:48:05 +02:00
2026-06-03 14:34:01 +08:00
2026-06-03 14:34:01 +08:00
2026-06-03 19:12:14 +08:00
2026-06-03 19:12:14 +08:00
2026-06-03 19:12:14 +08:00
2026-06-03 19:12:14 +08:00
2026-06-05 13:46:26 +08:00
2026-06-05 13:46:26 +08:00
2026-06-04 11:21:51 +08:00
2026-06-04 11:21:51 +08:00
2026-06-04 11:21:51 +08:00
2026-06-04 11:21:51 +08:00
2026-06-05 16:03:13 +08:00
2026-06-05 16:03:13 +08:00
2026-06-08 19:29:57 +08:00
2026-06-09 19:59:20 +08:00
2026-06-09 19:59:20 +08:00
2026-06-09 19:59:20 +08:00
2026-06-12 15:53:55 +08:00
2026-06-12 15:53:55 +08:00
2026-06-18 13:33:14 +08:00
2026-06-18 13:33:14 +08:00
2026-06-17 15:18:44 +02:00
2026-06-18 13:33:14 +08:00
2026-06-17 12:26:25 +08:00
2026-06-17 12:26:25 +08:00
2026-06-17 11:32:55 +08:00
2026-06-17 11:32:55 +08:00
2026-06-17 18:23:46 +08:00
2026-06-17 18:23:46 +08:00
2026-06-22 13:34:40 +08:00
2026-06-22 13:34:40 +08:00
2026-06-23 13:17:13 +08:00
2026-06-23 13:17:13 +08:00
2026-06-23 00:14:42 +08:00
2026-06-23 00:14:42 +08:00
2026-06-24 12:01:10 +08:00
2026-06-24 12:01:10 +08:00
2026-06-24 12:46:20 +08:00
2026-06-24 18:18:06 +08:00
2026-06-23 16:19:16 +08:00
2026-06-23 16:19:16 +08:00
2026-06-23 16:19:16 +08:00
2026-06-23 16:19:16 +08:00
2026-06-24 15:15:42 +08:00
2026-06-24 15:15:42 +08:00
2026-07-05 13:30:18 +08:00
2026-07-05 13:30:18 +08:00
2026-06-26 16:01:33 +08:00
2026-06-26 16:01:33 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-06-30 12:29:11 +08:00
2026-06-30 12:29:11 +08:00
2026-06-30 12:24:57 +08:00
2026-06-30 12:24:57 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-01 15:20:22 +08:00
2026-07-01 15:20:22 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-02 17:21:50 +08:00
2026-07-02 17:21:50 +08:00
2026-07-04 23:16:01 +08:00
2026-07-04 23:16:01 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 15:03:17 +08:00
2026-07-06 15:03:17 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-06 19:06:53 +08:00
2026-07-07 13:20:30 +08:00
2026-07-07 13:20:30 +08:00
2026-07-07 13:20:30 +08:00
2026-07-07 13:20:30 +08:00
2026-07-08 16:00:17 +08:00
2026-07-08 16:00:17 +08:00
2026-07-09 15:10:09 +08:00
2026-07-09 15:10:09 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-09 17:59:19 +08:00
2026-07-10 14:10:10 +08:00
2026-07-10 14:10:10 +08:00
2026-07-10 16:22:42 +08:00
2026-07-10 16:22:42 +08:00
2026-07-10 16:22:42 +08:00
2026-07-10 16:22:42 +08:00
2026-07-10 16:22:42 +08:00
2026-07-10 16:22:42 +08:00
2026-07-12 02:53:17 +08:00
2026-07-12 02:53:17 +08:00
2026-07-13 19:31:27 +08:00
2026-07-13 18:13:44 +08:00
2026-07-12 15:40:10 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 11:09:50 +08:00
2026-07-13 15:33:52 +08:00
2026-07-13 11:09:50 +08:00
2026-07-13 11:09:50 +08:00
2026-07-13 13:22:02 +08:00
2026-07-13 13:22:02 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 19:31:27 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 19:31:27 +08:00
2026-07-13 19:31:27 +08:00
2026-07-14 15:21:45 +08:00
2026-07-14 15:21:45 +08:00
2026-07-14 17:19:44 +08:00
2026-07-14 17:19:44 +08:00
2026-07-14 17:19:44 +08:00
2026-07-14 17:19:44 +08:00
2026-07-14 17:19:44 +08:00
2026-07-14 17:19:44 +08:00
2026-07-15 12:30:36 +08:00
2026-07-15 12:30:36 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 00:52:27 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 03:09:56 +08:00
2026-07-15 12:00:28 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 12:00:28 +08:00
2026-07-15 12:00:28 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 17:40:24 +08:00
2026-07-15 22:37:57 +08:00
2026-07-15 22:37:57 +08:00
2026-07-16 11:21:20 +08:00
2026-07-16 11:21:20 +08:00
2026-07-16 11:21:20 +08:00
2026-07-16 11:21:20 +08:00
2026-07-16 11:21:20 +08:00
2026-07-16 11:21:20 +08:00
2026-07-16 14:58:42 +08:00
2026-07-16 14:58:42 +08:00
2026-07-16 14:58:42 +08:00
2026-07-16 14:58:42 +08:00
2026-07-21 14:55:08 +08:00
2026-07-21 14:55:08 +08:00
2026-07-23 12:03:27 +08:00
2026-07-23 12:03:27 +08:00
2026-07-23 12:03:27 +08:00
2026-07-23 12:03:27 +08:00
2026-07-23 12:03:27 +08:00
2026-07-23 12:03:27 +08:00
2026-07-22 15:38:38 +08:00
2026-07-22 15:38:38 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-22 16:52:34 +08:00
2026-07-23 15:40:18 +08:00
2026-07-23 15:40:18 +08:00
2026-07-24 01:42:08 +08:00
2026-07-24 01:42:08 +08:00
2026-07-24 13:03:25 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 13:03:25 +08:00
2026-07-24 13:03:25 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 15:28:43 +08:00
2026-07-24 18:30:20 +08:00
2026-07-24 18:30:20 +08:00
2026-07-24 18:30:20 +08:00
2026-07-24 18:30:20 +08:00
2026-07-27 13:12:06 +08:00
2026-07-27 13:12:06 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 15:44:39 +08:00
2026-07-27 18:40:48 +08:00
2026-07-27 18:40:48 +08:00
2026-07-28 13:10:34 +08:00
2026-07-28 13:10:34 +08:00
2026-07-29 14:28:44 +08:00
2026-07-29 14:28:44 +08:00