Skip to content

Analytics: track and display per-project agent time #541

Closed

Description

@waleedkadous

Problem

We don't track how much actual agent compute time each project consumes. Wall clock time tells us how long a project took end-to-end, but agent time tells us how much AI work was involved.

What we need

Agent time = total time the builder's AI agent was actively working on a project.

Instrumentation needed

Options:

  1. Terminal session duration — Tower already manages builder terminal sessions. Track cumulative active time per builder terminal.
  2. Consultation duration — MetricsDB already tracks per-consultation duration. Sum by project ID.
  3. Porch phase timing — status.yaml has gate timestamps. Phase durations approximate agent time.

Display

Show avg agent time per protocol alongside avg wall clock time in the Activity section:

Protocol Count Avg Wall Clock Avg Agent Time
SPIR 25 2.5h 45min
Bugfix 78 35min 12min

Phase 1 (consultation-based estimate)

Sum consultation durations per project from MetricsDB as an approximation of agent time. This underestimates (doesn't include non-consultation work) but is available now.

Phase 2 (terminal session tracking)

Add session duration tracking to Tower terminal management. When a builder terminal is destroyed or cleaned up, record the total active duration.

Activity

  1. waleedkadous commented on Feb 24, 2026

    @waleedkadous
    ContributorAuthor

    On it! Working on a fix now.

  2. added 2 commits that reference this issue on Feb 24, 2026
    4538898
    990bc21
  3. added a commit that references this issue on Feb 24, 2026
    456be45
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions