Skip to content

fab perf: collectSessionMetrics is never called — per-role table stays empty #32

Description

@stxkxs

Context

collectSessionMetrics (src/perf.ts:50) is exported and wired into fab perf via loadPerf/formatPerfReport, but it is never called anywhere in the workflow execution path. As a result the per-role agent performance table (.fab-perf.json) is always empty — fab perf reads a file nothing writes.

The quality-trend work (#) deliberately scoped this out: the grade trend is transport-agnostic and captured in runMergeGate, whereas collectSessionMetrics is managed-agents-API-specific (api.getSession, api.listEvents) and is not reachable through the AgentRuntime abstraction that the runtimes now go through.

What's needed

Thread per-role session metrics collection through the runtime layer so the per-role table populates regardless of transport — or scope it cleanly to the managed-agents runtime and no-op elsewhere. Either way:

  • collectSessionMetrics (or an equivalent) fires after each role session.
  • fab perf's agent table shows real sessions/tokens/cost again.
  • A test covers the wiring (today there is no perf.test.ts).

Why deferred

It is orthogonal to the grade trend (the richer, transport-agnostic signal), and doing it right means deciding how per-session token metrics flow through AgentRuntime — a larger change than the loop-closing wire-up warranted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions