mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-17 03:38:32 +02:00
* feat(issues): display token usage per issue in detail sidebar Add a new "Token usage" section to the issue detail right sidebar that shows aggregated input/output tokens, cache tokens, and run count across all tasks for the issue. Backed by a new SQL query and API endpoint. * fix(db): add index on agent_task_queue(issue_id) for usage queries The GetIssueUsageSummary query joins agent_task_queue filtered by issue_id across all statuses. The existing partial index (migration 022) only covers queued/dispatched rows, so completed tasks require a sequential scan. Add a general index to prevent performance degradation as task volume grows.
6 lines
330 B
SQL
6 lines
330 B
SQL
-- Add a general index on agent_task_queue(issue_id) to support aggregation
|
|
-- queries like GetIssueUsageSummary that scan across all task statuses.
|
|
-- (Migration 022 only covers queued/dispatched rows via a partial index.)
|
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_agent_task_queue_issue_id
|
|
ON agent_task_queue (issue_id);
|