Skip to content

[Bug] Daily run metrics exclude runs from sessions created on previous days #11062

Open

Description

@banaglitch

Description

Daily run metrics in Agno OS appear to be calculated based on the session creation date instead of the actual run execution date.

When a session is created on one day and reused on subsequent days, new runs belonging to that session are not included in the daily metrics for the days on which they actually occurred.

This leads to missing runs, inaccurate token usage statistics, and potentially permanently incomplete historical metrics.

Steps to Reproduce

  1. Create an agent session on Day 1 (e.g., October 10).
  2. Execute one run in that session.
  3. On Day 2 (e.g., October 14), reuse the same session_id.
  4. Execute two additional runs.
  5. Open the Agno OS metrics dashboard and inspect the daily run counts.

Agent Configuration (if applicable)

No response

Expected Behavior

  • October 10: 1 run
  • October 14: 2 runs

Total: 3 runs

Each run should be counted on its actual execution date, regardless of when its parent session was created.

Actual Behavior

  • October 10: The initial run is counted.
  • October 14: The two additional runs are missing from the daily metrics.

Runs associated with sessions created on October 14 are counted normally.

Depending on when metrics are calculated, the missing runs may either be absent from the aggregated metrics entirely or incorrectly attributed to the original session creation date.

The underlying runs are not necessarily lost from storage. The problem concerns their aggregation into daily metrics.

Screenshots or Logs (if applicable)

No response

Environment

- Agno 3.0.11
- PGSQL storage

Possible Solutions (optional)

No response

Additional Context

Suggested fix

  • Aggregate runs based on their own execution timestamps, independently of session creation dates.
  • Use session records only to resolve metadata such as user_id, agent/team/workflow identifiers, and session type.
  • Calculate daily token usage from run-level metrics rather than cumulative session metrics.
  • Preserve session creation counts based on session creation dates, while calculating run counts based on run execution dates.
  • Provide a way to rebuild historical daily metrics from persisted runs.

Activity

  1. Kylinny commented on Oct 14, 2026

    @Kylinny

    Thanks for the detailed report with clear repro steps — this looks like a real bug. I'll take this one and investigate a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions