Skip to content

feat(agents): aggregate_metrics proxy helper on SimpleResponsesAPIAgent #2250

Description

@adil-a

Problem

Eight agent servers override aggregate_metrics with the same ~8 line proxy to their resources server: speed_bench_agent, non_executing_simple_agent, browsecomp_agent, gymnasium_agent, finance_agent, stirrup_agent, simple_agent, remote_agent. remote_agent additionally bounds the hop with asyncio.wait_for(600s) because the ServerClient call otherwise retries connection errors forever (see #2248); a dead resources server at end of run would hang the collector after all rollouts are on disk.

Proposal

An additive helper on SimpleResponsesAPIAgent:

async def proxy_aggregate_metrics(self, server_name, body, timeout_secs=600.0) -> AggregateMetrics

POST /aggregate_metrics to the named server, raise_for_status, validate, bounded by wait_for when timeout_secs is set. Opt-in per agent; the default local aggregation is untouched (harbor_agent deliberately keeps local aggregation despite having a resources server).

Origin: #2163 (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