Skip to content

Keep AgentX profile captures when AIPerf fails only its metric-coverage gate - #124

Merged
haofrank merged 2 commits into
mainfrom
fix/agentx-aiperf-coverage-waiver
Oct 28, 2026
Merged

haofrank merged 2 commits into
mainfrom
fix/agentx-aiperf-coverage-waiver

Conversation

@Ahmedhasssan-aig

@Ahmedhasssan-aig Ahmedhasssan-aig commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

SGLang writes a large profiled Chrome trace synchronously, and the server serves no tokens for the 15–18 minutes that export takes. AIPerf measures a fixed profiling window, exits non-zero with insufficient_profile_metric_coverage, and Magpie treats that client failure as fatal, stopping the server while the trace is still being written.

A profiled AgentX replay is diagnostic-only. When the AIPerf result is uncancelled, error_summary is empty, and the only submission_invalid_reasons entry is insufficient_profile_metric_coverage, Magpie now treats the replay as finished and lets the trace flush complete. The waived reason is recorded on agentx_metrics.client_waived_invalid_reasons. A cancellation, a non-empty error_summary, or any other invalid reason still fails the run. The result stays diagnostic and is not publishable benchmark evidence.

Validation

  • pytest tests/unit/modes/test_agentx_profile_integration.py — 30 passed
  • Coverage-only failure: run succeeds, capture status is complete, and the waived reason is recorded.
  • request_error_rate_exceeded, alone or together with the coverage reason: run fails and no reason is waived.

…etric-coverage gate

Synchronous trace export stalls the server for long captures, so AIPerf's
profiling-phase latency coverage falls below its floor by construction. A
profiled replay is diagnostic-only; treat a client exit whose sole invalid
reason is insufficient_profile_metric_coverage (uncancelled, no request
errors) as a finished replay so the trace flush completes, and report the
waived reasons in agentx_metrics.
Signal termination (negative return code) or any exit code other than
AIPerf's fatal validation exit (1) now fails the profiled replay even if a
coverage-only result was already exported.

Co-authored-by: Cursor <cursoragent@cursor.com>
@haofrank
haofrank self-requested a review October 28, 2026 16:54

@haofrank haofrank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@haofrank
haofrank merged commit b79670c into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants