Skip to content

Track specialist costs with time period filtering #55

@eltmon

Description

@eltmon

Summary

Add the ability to view specialist agent costs over different time periods, similar to how we track issue agent costs.

Requirements

API Enhancements

  • Extend /api/specialists/:name/cost to accept time period filters:

    • ?period=today - costs from today
    • ?period=week - costs from this week
    • ?period=month - costs from this month
    • ?period=all - all-time costs (default, current behavior)
  • Add /api/specialists/costs/summary endpoint:

    • Returns aggregated costs for all specialists
    • Supports same time period filters
    • Shows breakdown by specialist

Dashboard UI

  • Add cost summary section to specialists panel
  • Time period selector (Today / This Week / This Month / All Time)
  • Cost breakdown by specialist with visual chart/bars
  • Total specialist cost prominently displayed

Data Model

Consider whether to:

  1. Parse JSONL files on-demand (current approach, slower for large files)
  2. Maintain a cost tracking database/file that gets updated incrementally

Technical Notes

  • Specialist JSONL files contain costUSD field per entry
  • Need to filter entries by timestamp
  • May need to cache/index for performance with large session files

Acceptance Criteria

  • Can view specialist costs filtered by time period
  • Dashboard shows cost breakdown by specialist
  • Cost data refreshes automatically (polling)
  • Performance acceptable even with large session files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions