multica/server/internal/daemon
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
..
execenv Merge pull request #456 from multica-ai/agent/j/25583cc6 2026-04-07 14:53:53 +08:00
repocache feat(daemon): add opencode as supported agent provider (#341) 2026-04-02 17:52:07 +08:00
usage fix(daemon): fix Codex token usage parsing from session logs 2026-03-28 00:03:47 +08:00
client.go feat(usage): add per-task token usage tracking 2026-04-08 13:08:15 +08:00
config.go feat(agent): add OpenClaw runtime support 2026-04-07 14:40:51 +08:00
daemon.go feat(usage): add per-task token usage tracking 2026-04-08 13:08:15 +08:00
daemon_test.go refactor: decouple task lifecycle from issue status (#151) 2026-03-27 18:30:21 +08:00
health.go feat(daemon): agent-driven repo checkout with bare clone cache 2026-03-29 19:37:48 +08:00
helpers.go fix(daemon): prevent stuck tasks from blocking queue and add concurrent execution 2026-03-30 03:08:52 +08:00
prompt.go refactor: decouple task lifecycle from issue status (#151) 2026-03-27 18:30:21 +08:00
types.go feat(usage): add per-task token usage tracking 2026-04-08 13:08:15 +08:00