multica/server/internal/handler
Jiang Bohan 8a8d3ea20e feat(usage): add per-task token usage tracking
Extract token usage from Claude Code's stream-json output in real-time
during task execution, replacing the inaccurate global JSONL log scanner.

- New `task_usage` table: tracks (task_id, provider, model) level usage
- Agent SDK: parse `message.usage` from assistant messages, accumulate
  per-model and return in Result
- Daemon: convert agent usage to entries, send with CompleteTask
- Server: store usage on task completion, expose workspace-level
  aggregation APIs (GET /api/usage/daily, GET /api/usage/summary)
2026-04-08 13:08:15 +08:00
..
activity.go feat(upload): signed URLs for CLI + eager load attachments on comments 2026-03-31 15:42:10 +08:00
activity_test.go feat(activity): unified activity timeline with comment reply support 2026-03-28 21:53:08 +08:00
agent.go feat(agent): replace hard delete with archive/restore (#346) 2026-04-02 17:33:52 +08:00
auth.go Merge pull request #462 from multica-ai/agent/j/ffea36be 2026-04-07 15:32:08 +08:00
comment.go fix(triggers): remove assignee skip in enqueueMentionedAgentTasks 2026-04-07 14:36:08 +08:00
daemon.go feat(usage): add per-task token usage tracking 2026-04-08 13:08:15 +08:00
file.go fix(attachment): use UUIDv7 as S3 key and link attachments on issue/comment creation 2026-04-05 07:55:17 +08:00
handler.go feat(runtime): support CLI update from web runtime page (#331) 2026-04-02 14:12:49 +08:00
handler_test.go fix(auth): enforce auth on daemon API routes (#224) 2026-03-31 16:13:58 +08:00
inbox.go fix(inbox): archive all items for the same issue instead of just one 2026-04-04 00:18:14 +08:00
issue.go feat(issues): load all open issues without limit, paginate closed (#459) 2026-04-07 00:59:03 -07:00
issue_reaction.go feat(reactions): add emoji reactions for comments and issue descriptions 2026-03-30 22:37:59 +08:00
personal_access_token.go feat(auth): email verification login and personal access tokens 2026-03-26 14:32:30 +08:00
reaction.go feat(inbox): auto-scroll to comment from notification and add jump-to-bottom button 2026-04-02 13:43:05 +08:00
runtime.go feat(usage): add per-task token usage tracking 2026-04-08 13:08:15 +08:00
runtime_ping.go feat(runtimes): add Runtimes tab with usage tracking and connection test 2026-03-26 18:28:36 +08:00
runtime_update.go feat(runtime): support CLI update from web runtime page (#331) 2026-04-02 14:12:49 +08:00
skill.go fix(agent): allow members to manage skills on their own agents 2026-04-02 12:25:19 +08:00
subscriber.go feat(api): strict workspace isolation + agent parity fixes 2026-03-30 16:49:13 +08:00
subscriber_test.go feat(notifications): replace hardcoded inbox notifications with subscriber-driven model 2026-03-28 19:33:20 +08:00
trigger_test.go Merge pull request #361 from JimmyPang02/fix/issue-mention-on-comment 2026-04-03 18:42:16 +08:00
workspace.go refactor(server): consolidate workspace permission checks into middleware 2026-03-30 03:40:20 +08:00