Skip to content

Add new aggregation API#667

Merged
hadarishav merged 2 commits into
devfrom
fix/aggregation-docs
May 25, 2026
Merged

Add new aggregation API#667
hadarishav merged 2 commits into
devfrom
fix/aggregation-docs

Conversation

@sarthakFuture
Copy link
Copy Markdown
Contributor

Pull Request

Description

Describe the changes in this pull request:

  • What feature/bug does this PR address?
  • Provide any relevant links or screenshots.

Checklist

  • Code compiles correctly.
  • Created/updated tests.
  • Linting and formatting applied.
  • Documentation updated.

Related Issues

Closes #<issue_number>

##Linear
Fixes TH-5466

@sarthakFuture sarthakFuture requested a review from hadarishav May 22, 2026 17:50
Copy link
Copy Markdown
Contributor

@hadarishav hadarishav left a comment

Choose a reason for hiding this comment

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

Well-scoped PR and the content is solid — the conditional aggregated_score / value shapes by output_type are explained clearly. A few things to align with our API-docs conventions before merge (see inline comments). The nav/sidebar wiring and auth/param types all look correct.

Comment thread src/pages/docs/api/eval-tasks/eval-task-aggregations.mdx Outdated
<ResponseField name="eval_aggregation" type="object">
Per-eval rollup. Present only when `eval_aggregation=true`. Keys are `CustomEvalConfig` names; values are one rollup object per eval.
</ResponseField>
<ApiCollapsible title="Show eval rollup properties">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

<ApiCollapsible> is a sibling of the eval_aggregation ResponseField (which closed on line 78), so it renders as a standalone collapsible instead of nested under eval_aggregation. Move it inside the parent ResponseField:

<ResponseField name="eval_aggregation" type="object">
  Per-eval rollup. Present only when `eval_aggregation=true`...

  <ApiCollapsible title="Show eval rollup properties">
    ...
  </ApiCollapsible>
</ResponseField>

(Same pattern we standardized on the agent-versions pages.)

<ResponseField name="span_aggregation" type="object">
Per-span pivot. Present only when `span_aggregation=true`. Outer keys are `span_id` (one per span the task evaluated); inner keys are eval names; inner values are one entry per eval that touched the span.
</ResponseField>
<ApiCollapsible title="Show span entry properties">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same nesting issue here — this <ApiCollapsible> should be nested inside the span_aggregation ResponseField rather than sitting as a sibling.

</ApiSection>

<ApiSection title="Behavior notes">
<ParamField name="At least one flag required" type="Behavior">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This "Behavior notes" section fakes a parameter type (<ParamField type="Behavior">) to render notes — no other API page does this. Use <Note> blocks instead, and fold the "at least one flag required" point into the query-param descriptions since it's a request constraint.

</ParamField>
</ApiSection>

<ApiSection title="Errors">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Errors section has 400 + 401 but no 500 — every other API page includes a 500. Add it unless this endpoint genuinely never 500s.

@hadarishav hadarishav merged commit 698e1ad into dev May 25, 2026
2 checks passed
@hadarishav hadarishav deleted the fix/aggregation-docs branch May 25, 2026 14:33
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